Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/layout/style/CSS.cpp
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
3
/* This Source Code Form is subject to the terms of the Mozilla Public
4
 * License, v. 2.0. If a copy of the MPL was not distributed with this
5
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
/* DOM object holding utility CSS functions */
8
9
#include "CSS.h"
10
11
#include "mozilla/dom/BindingDeclarations.h"
12
#include "mozilla/ServoBindings.h"
13
#include "nsGlobalWindow.h"
14
#include "nsIDocument.h"
15
#include "nsIURI.h"
16
#include "nsStyleUtil.h"
17
#include "xpcpublic.h"
18
19
namespace mozilla {
20
namespace dom {
21
22
/* static */ bool
23
CSS::Supports(const GlobalObject& aGlobal,
24
              const nsAString& aProperty,
25
              const nsAString& aValue,
26
              ErrorResult& aRv)
27
0
{
28
0
  NS_ConvertUTF16toUTF8 property(aProperty);
29
0
  NS_ConvertUTF16toUTF8 value(aValue);
30
0
  return Servo_CSSSupports2(&property, &value);
31
0
}
32
33
/* static */ bool
34
CSS::Supports(const GlobalObject& aGlobal,
35
              const nsAString& aCondition,
36
              ErrorResult& aRv)
37
0
{
38
0
  NS_ConvertUTF16toUTF8 cond(aCondition);
39
0
  return Servo_CSSSupports(&cond);
40
0
}
41
42
/* static */ void
43
CSS::Escape(const GlobalObject& aGlobal,
44
            const nsAString& aIdent,
45
            nsAString& aReturn)
46
0
{
47
0
  nsStyleUtil::AppendEscapedCSSIdent(aIdent, aReturn);
48
0
}
49
50
} // namespace dom
51
} // namespace mozilla