/src/mozilla-central/layout/style/MappedDeclarations.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 | | #include "mozilla/MappedDeclarations.h" |
8 | | |
9 | | namespace mozilla { |
10 | | |
11 | | void |
12 | | MappedDeclarations::SetIdentAtomValue(nsCSSPropertyID aId, nsAtom* aValue) |
13 | 0 | { |
14 | 0 | Servo_DeclarationBlock_SetIdentStringValue(mDecl, aId, aValue); |
15 | 0 | if (aId == eCSSProperty__x_lang) { |
16 | 0 | // This forces the lang prefs result to be cached so that we can access them |
17 | 0 | // off main thread during traversal. |
18 | 0 | // |
19 | 0 | // FIXME(emilio): Can we move mapped attribute declarations across |
20 | 0 | // documents? Isn't this wrong in that case? This is pretty out of place |
21 | 0 | // anyway. |
22 | 0 | if (nsPresContext* pc = mDocument->GetPresContext()) { |
23 | 0 | pc->ForceCacheLang(aValue); |
24 | 0 | } |
25 | 0 | } |
26 | 0 | } |
27 | | |
28 | | void |
29 | | MappedDeclarations::SetBackgroundImage(const nsAttrValue& aValue) |
30 | 0 | { |
31 | 0 | if (aValue.Type() != nsAttrValue::eURL) { |
32 | 0 | return; |
33 | 0 | } |
34 | 0 | // FIXME(emilio): Going through URL parsing again seems slightly wasteful. |
35 | 0 | nsAutoString str; |
36 | 0 | aValue.ToString(str); |
37 | 0 | Servo_DeclarationBlock_SetBackgroundImage( |
38 | 0 | mDecl, str, mDocument->DefaultStyleAttrURLData()); |
39 | 0 | } |
40 | | |
41 | | } // namespace mozilla |