2017-10-27 20:33:53 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-11-25 04:26:07 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
/* DOM object holding utility CSS functions */
|
|
|
|
|
|
|
|
#include "CSS.h"
|
|
|
|
|
2012-12-03 20:07:49 +04:00
|
|
|
#include "mozilla/dom/BindingDeclarations.h"
|
2016-07-18 11:29:04 +03:00
|
|
|
#include "mozilla/ServoBindings.h"
|
2012-11-25 04:26:07 +04:00
|
|
|
#include "nsGlobalWindow.h"
|
2019-01-02 16:05:23 +03:00
|
|
|
#include "mozilla/dom/Document.h"
|
2014-03-21 07:19:43 +04:00
|
|
|
#include "nsStyleUtil.h"
|
2014-10-30 00:00:48 +03:00
|
|
|
#include "xpcpublic.h"
|
2012-11-25 04:26:07 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2019-02-26 01:09:24 +03:00
|
|
|
/* static */
|
|
|
|
bool CSS::Supports(const GlobalObject& aGlobal, const nsAString& aProperty,
|
|
|
|
const nsAString& aValue, ErrorResult& aRv) {
|
2018-03-28 18:34:34 +03:00
|
|
|
NS_ConvertUTF16toUTF8 property(aProperty);
|
|
|
|
NS_ConvertUTF16toUTF8 value(aValue);
|
|
|
|
return Servo_CSSSupports2(&property, &value);
|
2012-11-25 04:26:07 +04:00
|
|
|
}
|
|
|
|
|
2019-02-26 01:09:24 +03:00
|
|
|
/* static */
|
|
|
|
bool CSS::Supports(const GlobalObject& aGlobal, const nsAString& aCondition,
|
|
|
|
ErrorResult& aRv) {
|
2018-03-28 18:34:34 +03:00
|
|
|
NS_ConvertUTF16toUTF8 cond(aCondition);
|
|
|
|
return Servo_CSSSupports(&cond);
|
2012-11-25 04:26:07 +04:00
|
|
|
}
|
|
|
|
|
2019-02-26 01:09:24 +03:00
|
|
|
/* static */
|
|
|
|
void CSS::Escape(const GlobalObject& aGlobal, const nsAString& aIdent,
|
|
|
|
nsAString& aReturn) {
|
2016-01-05 23:05:23 +03:00
|
|
|
nsStyleUtil::AppendEscapedCSSIdent(aIdent, aReturn);
|
2014-03-21 07:19:43 +04:00
|
|
|
}
|
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|