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/. */
7 #include "MappedDeclarations.h"
9 #include "nsAttrValue.h"
10 #include "nsAttrValueInlines.h"
11 #include "mozilla/dom/Document.h"
12 #include "nsPresContext.h"
16 void MappedDeclarations::SetIdentAtomValue(nsCSSPropertyID aId
,
18 Servo_DeclarationBlock_SetIdentStringValue(mDecl
, aId
, aValue
);
19 if (aId
== eCSSProperty__x_lang
) {
20 // This forces the lang prefs result to be cached so that we can access them
21 // off main thread during traversal.
23 // FIXME(emilio): Can we move mapped attribute declarations across
24 // documents? Isn't this wrong in that case? This is pretty out of place
26 mDocument
->ForceCacheLang(aValue
);
30 void MappedDeclarations::SetBackgroundImage(const nsAttrValue
& aValue
) {
31 if (aValue
.Type() != nsAttrValue::eURL
) {
37 CopyUTF16toUTF8(str
, utf8
);
38 Servo_DeclarationBlock_SetBackgroundImage(
39 mDecl
, &utf8
, mDocument
->DefaultStyleAttrURLData());
42 } // namespace mozilla