2017-10-27 17:33:53 +00: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 00:26:07 +00: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 16:07:49 +00:00
|
|
|
#include "mozilla/dom/BindingDeclarations.h"
|
2016-07-18 08:29:04 +00:00
|
|
|
#include "mozilla/ServoBindings.h"
|
2012-11-25 00:26:07 +00:00
|
|
|
#include "nsGlobalWindow.h"
|
|
|
|
#include "nsIDocument.h"
|
|
|
|
#include "nsIURI.h"
|
2014-03-21 03:19:43 +00:00
|
|
|
#include "nsStyleUtil.h"
|
2014-10-29 21:00:48 +00:00
|
|
|
#include "xpcpublic.h"
|
2012-11-25 00:26:07 +00:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
/* static */ bool
|
2012-12-03 16:07:49 +00:00
|
|
|
CSS::Supports(const GlobalObject& aGlobal,
|
2012-11-25 00:26:07 +00:00
|
|
|
const nsAString& aProperty,
|
|
|
|
const nsAString& aValue,
|
|
|
|
ErrorResult& aRv)
|
|
|
|
{
|
2018-03-28 15:34:34 +00:00
|
|
|
NS_ConvertUTF16toUTF8 property(aProperty);
|
|
|
|
NS_ConvertUTF16toUTF8 value(aValue);
|
|
|
|
return Servo_CSSSupports2(&property, &value);
|
2012-11-25 00:26:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* static */ bool
|
2012-12-03 16:07:49 +00:00
|
|
|
CSS::Supports(const GlobalObject& aGlobal,
|
2012-11-25 00:26:07 +00:00
|
|
|
const nsAString& aCondition,
|
|
|
|
ErrorResult& aRv)
|
|
|
|
{
|
2018-03-28 15:34:34 +00:00
|
|
|
NS_ConvertUTF16toUTF8 cond(aCondition);
|
|
|
|
return Servo_CSSSupports(&cond);
|
2012-11-25 00:26:07 +00:00
|
|
|
}
|
|
|
|
|
2014-03-21 03:19:43 +00:00
|
|
|
/* static */ void
|
|
|
|
CSS::Escape(const GlobalObject& aGlobal,
|
|
|
|
const nsAString& aIdent,
|
2016-01-05 20:05:23 +00:00
|
|
|
nsAString& aReturn)
|
2014-03-21 03:19:43 +00:00
|
|
|
{
|
2016-01-05 20:05:23 +00:00
|
|
|
nsStyleUtil::AppendEscapedCSSIdent(aIdent, aReturn);
|
2014-03-21 03:19:43 +00:00
|
|
|
}
|
|
|
|
|
2015-07-13 15:25:42 +00:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|