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