OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Simon Hausmann (hausmann@kde.org) | 4 * (C) 2000 Simon Hausmann (hausmann@kde.org) |
5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
6 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 } | 48 } |
49 | 49 |
50 DEFINE_NODE_FACTORY(HTMLBodyElement) | 50 DEFINE_NODE_FACTORY(HTMLBodyElement) |
51 | 51 |
52 HTMLBodyElement::~HTMLBodyElement() | 52 HTMLBodyElement::~HTMLBodyElement() |
53 { | 53 { |
54 } | 54 } |
55 | 55 |
56 bool HTMLBodyElement::isPresentationAttribute(const QualifiedName& name) const | 56 bool HTMLBodyElement::isPresentationAttribute(const QualifiedName& name) const |
57 { | 57 { |
58 if (name == backgroundAttr || name == marginwidthAttr || name == leftmarginA
ttr || name == marginheightAttr || name == topmarginAttr || name == bgcolorAttr
|| name == textAttr || name == bgpropertiesAttr) | 58 if (name == backgroundAttr || name == marginwidthAttr || name == leftmarginA
ttr || name == marginheightAttr || name == topmarginAttr || name == bgcolorAttr
|| name == textAttr) |
59 return true; | 59 return true; |
60 return HTMLElement::isPresentationAttribute(name); | 60 return HTMLElement::isPresentationAttribute(name); |
61 } | 61 } |
62 | 62 |
63 void HTMLBodyElement::collectStyleForPresentationAttribute(const QualifiedName&
name, const AtomicString& value, MutableStylePropertySet* style) | 63 void HTMLBodyElement::collectStyleForPresentationAttribute(const QualifiedName&
name, const AtomicString& value, MutableStylePropertySet* style) |
64 { | 64 { |
65 if (name == backgroundAttr) { | 65 if (name == backgroundAttr) { |
66 String url = stripLeadingAndTrailingHTMLSpaces(value); | 66 String url = stripLeadingAndTrailingHTMLSpaces(value); |
67 if (!url.isEmpty()) { | 67 if (!url.isEmpty()) { |
68 RefPtrWillBeRawPtr<CSSImageValue> imageValue = CSSImageValue::create
(url, document().completeURL(url)); | 68 RefPtrWillBeRawPtr<CSSImageValue> imageValue = CSSImageValue::create
(url, document().completeURL(url)); |
69 imageValue->setInitiator(localName()); | 69 imageValue->setInitiator(localName()); |
70 imageValue->setReferrer(Referrer(document().outgoingReferrer(), docu
ment().referrerPolicy())); | 70 imageValue->setReferrer(Referrer(document().outgoingReferrer(), docu
ment().referrerPolicy())); |
71 style->setProperty(CSSProperty(CSSPropertyBackgroundImage, imageValu
e.release())); | 71 style->setProperty(CSSProperty(CSSPropertyBackgroundImage, imageValu
e.release())); |
72 } | 72 } |
73 } else if (name == marginwidthAttr || name == leftmarginAttr) { | 73 } else if (name == marginwidthAttr || name == leftmarginAttr) { |
74 addHTMLLengthToStyle(style, CSSPropertyMarginRight, value); | 74 addHTMLLengthToStyle(style, CSSPropertyMarginRight, value); |
75 addHTMLLengthToStyle(style, CSSPropertyMarginLeft, value); | 75 addHTMLLengthToStyle(style, CSSPropertyMarginLeft, value); |
76 } else if (name == marginheightAttr || name == topmarginAttr) { | 76 } else if (name == marginheightAttr || name == topmarginAttr) { |
77 addHTMLLengthToStyle(style, CSSPropertyMarginBottom, value); | 77 addHTMLLengthToStyle(style, CSSPropertyMarginBottom, value); |
78 addHTMLLengthToStyle(style, CSSPropertyMarginTop, value); | 78 addHTMLLengthToStyle(style, CSSPropertyMarginTop, value); |
79 } else if (name == bgcolorAttr) { | 79 } else if (name == bgcolorAttr) { |
80 addHTMLColorToStyle(style, CSSPropertyBackgroundColor, value); | 80 addHTMLColorToStyle(style, CSSPropertyBackgroundColor, value); |
81 } else if (name == textAttr) { | 81 } else if (name == textAttr) { |
82 addHTMLColorToStyle(style, CSSPropertyColor, value); | 82 addHTMLColorToStyle(style, CSSPropertyColor, value); |
83 } else if (name == bgpropertiesAttr) { | 83 } else { |
84 if (equalIgnoringCase(value, "fixed")) { | |
85 UseCounter::countDeprecation(document(), UseCounter::BgPropertiesFix
ed); | |
86 addPropertyToPresentationAttributeStyle(style, CSSPropertyBackground
Attachment, CSSValueFixed); | |
87 } | |
88 } else | |
89 HTMLElement::collectStyleForPresentationAttribute(name, value, style); | 84 HTMLElement::collectStyleForPresentationAttribute(name, value, style); |
| 85 } |
90 } | 86 } |
91 | 87 |
92 void HTMLBodyElement::parseAttribute(const QualifiedName& name, const AtomicStri
ng& value) | 88 void HTMLBodyElement::parseAttribute(const QualifiedName& name, const AtomicStri
ng& value) |
93 { | 89 { |
94 if (name == vlinkAttr || name == alinkAttr || name == linkAttr) { | 90 if (name == vlinkAttr || name == alinkAttr || name == linkAttr) { |
95 if (value.isNull()) { | 91 if (value.isNull()) { |
96 if (name == linkAttr) | 92 if (name == linkAttr) |
97 document().textLinkColors().resetLinkColor(); | 93 document().textLinkColors().resetLinkColor(); |
98 else if (name == vlinkAttr) | 94 else if (name == vlinkAttr) |
99 document().textLinkColors().resetVisitedLinkColor(); | 95 document().textLinkColors().resetVisitedLinkColor(); |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 int HTMLBodyElement::scrollWidth() | 330 int HTMLBodyElement::scrollWidth() |
335 { | 331 { |
336 // Update the document's layout. | 332 // Update the document's layout. |
337 Document& document = this->document(); | 333 Document& document = this->document(); |
338 document.updateLayoutIgnorePendingStylesheets(); | 334 document.updateLayoutIgnorePendingStylesheets(); |
339 FrameView* view = document.view(); | 335 FrameView* view = document.view(); |
340 return view ? adjustForZoom(view->contentsWidth(), &document) : 0; | 336 return view ? adjustForZoom(view->contentsWidth(), &document) : 0; |
341 } | 337 } |
342 | 338 |
343 } // namespace blink | 339 } // namespace blink |
OLD | NEW |