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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 return HTMLElement::isPresentationAttribute(name); | 56 return HTMLElement::isPresentationAttribute(name); |
57 } | 57 } |
58 | 58 |
59 void HTMLBodyElement::collectStyleForPresentationAttribute(const QualifiedName&
name, const AtomicString& value, MutableStylePropertySet* style) | 59 void HTMLBodyElement::collectStyleForPresentationAttribute(const QualifiedName&
name, const AtomicString& value, MutableStylePropertySet* style) |
60 { | 60 { |
61 if (name == backgroundAttr) { | 61 if (name == backgroundAttr) { |
62 String url = stripLeadingAndTrailingHTMLSpaces(value); | 62 String url = stripLeadingAndTrailingHTMLSpaces(value); |
63 if (!url.isEmpty()) { | 63 if (!url.isEmpty()) { |
64 RefPtrWillBeRawPtr<CSSImageValue> imageValue = CSSImageValue::create
(url, document().completeURL(url)); | 64 RefPtrWillBeRawPtr<CSSImageValue> imageValue = CSSImageValue::create
(url, document().completeURL(url)); |
65 imageValue->setInitiator(localName()); | 65 imageValue->setInitiator(localName()); |
66 imageValue->setReferrer(Referrer(document().outgoingReferrer(), docu
ment().referrerPolicy())); | 66 imageValue->setReferrer(Referrer(document().outgoingReferrer(), docu
ment().getReferrerPolicy())); |
67 style->setProperty(CSSProperty(CSSPropertyBackgroundImage, imageValu
e.release())); | 67 style->setProperty(CSSProperty(CSSPropertyBackgroundImage, imageValu
e.release())); |
68 } | 68 } |
69 } else if (name == marginwidthAttr || name == leftmarginAttr) { | 69 } else if (name == marginwidthAttr || name == leftmarginAttr) { |
70 addHTMLLengthToStyle(style, CSSPropertyMarginRight, value); | 70 addHTMLLengthToStyle(style, CSSPropertyMarginRight, value); |
71 addHTMLLengthToStyle(style, CSSPropertyMarginLeft, value); | 71 addHTMLLengthToStyle(style, CSSPropertyMarginLeft, value); |
72 } else if (name == marginheightAttr || name == topmarginAttr) { | 72 } else if (name == marginheightAttr || name == topmarginAttr) { |
73 addHTMLLengthToStyle(style, CSSPropertyMarginBottom, value); | 73 addHTMLLengthToStyle(style, CSSPropertyMarginBottom, value); |
74 addHTMLLengthToStyle(style, CSSPropertyMarginTop, value); | 74 addHTMLLengthToStyle(style, CSSPropertyMarginTop, value); |
75 } else if (name == bgcolorAttr) { | 75 } else if (name == bgcolorAttr) { |
76 addHTMLColorToStyle(style, CSSPropertyBackgroundColor, value); | 76 addHTMLColorToStyle(style, CSSPropertyBackgroundColor, value); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 } | 184 } |
185 | 185 |
186 bool HTMLBodyElement::supportsFocus() const | 186 bool HTMLBodyElement::supportsFocus() const |
187 { | 187 { |
188 // This override is needed because the inherited method bails if the parent
is editable. | 188 // This override is needed because the inherited method bails if the parent
is editable. |
189 // The <body> should be focusable even if <html> is editable. | 189 // The <body> should be focusable even if <html> is editable. |
190 return hasEditableStyle() || HTMLElement::supportsFocus(); | 190 return hasEditableStyle() || HTMLElement::supportsFocus(); |
191 } | 191 } |
192 | 192 |
193 } // namespace blink | 193 } // namespace blink |
OLD | NEW |