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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 if (name == backgroundAttr || name == marginwidthAttr || name == leftmarginA
ttr || name == marginheightAttr || name == topmarginAttr || name == bgcolorAttr
|| name == textAttr || name == bgpropertiesAttr) | 61 if (name == backgroundAttr || name == marginwidthAttr || name == leftmarginA
ttr || name == marginheightAttr || name == topmarginAttr || name == bgcolorAttr
|| name == textAttr || name == bgpropertiesAttr) |
62 return true; | 62 return true; |
63 return HTMLElement::isPresentationAttribute(name); | 63 return HTMLElement::isPresentationAttribute(name); |
64 } | 64 } |
65 | 65 |
66 void HTMLBodyElement::collectStyleForPresentationAttribute(const QualifiedName&
name, const AtomicString& value, MutableStylePropertySet* style) | 66 void HTMLBodyElement::collectStyleForPresentationAttribute(const QualifiedName&
name, const AtomicString& value, MutableStylePropertySet* style) |
67 { | 67 { |
68 if (name == backgroundAttr) { | 68 if (name == backgroundAttr) { |
69 String url = stripLeadingAndTrailingHTMLSpaces(value); | 69 String url = stripLeadingAndTrailingHTMLSpaces(value); |
70 if (!url.isEmpty()) { | 70 if (!url.isEmpty()) { |
71 RefPtr<CSSImageValue> imageValue = CSSImageValue::create(document().
completeURL(url)); | 71 RefPtr<CSSImageValue> imageValue = CSSImageValue::create(treeScope()
.completeURL(url)); |
72 imageValue->setInitiator(localName()); | 72 imageValue->setInitiator(localName()); |
73 style->setProperty(CSSProperty(CSSPropertyBackgroundImage, imageValu
e.release())); | 73 style->setProperty(CSSProperty(CSSPropertyBackgroundImage, imageValu
e.release())); |
74 } | 74 } |
75 } else if (name == marginwidthAttr || name == leftmarginAttr) { | 75 } else if (name == marginwidthAttr || name == leftmarginAttr) { |
76 addHTMLLengthToStyle(style, CSSPropertyMarginRight, value); | 76 addHTMLLengthToStyle(style, CSSPropertyMarginRight, value); |
77 addHTMLLengthToStyle(style, CSSPropertyMarginLeft, value); | 77 addHTMLLengthToStyle(style, CSSPropertyMarginLeft, value); |
78 } else if (name == marginheightAttr || name == topmarginAttr) { | 78 } else if (name == marginheightAttr || name == topmarginAttr) { |
79 addHTMLLengthToStyle(style, CSSPropertyMarginBottom, value); | 79 addHTMLLengthToStyle(style, CSSPropertyMarginBottom, value); |
80 addHTMLLengthToStyle(style, CSSPropertyMarginTop, value); | 80 addHTMLLengthToStyle(style, CSSPropertyMarginTop, value); |
81 } else if (name == bgcolorAttr) { | 81 } else if (name == bgcolorAttr) { |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 int HTMLBodyElement::scrollWidth() | 280 int HTMLBodyElement::scrollWidth() |
281 { | 281 { |
282 // Update the document's layout. | 282 // Update the document's layout. |
283 Document& document = this->document(); | 283 Document& document = this->document(); |
284 document.updateLayoutIgnorePendingStylesheets(); | 284 document.updateLayoutIgnorePendingStylesheets(); |
285 FrameView* view = document.view(); | 285 FrameView* view = document.view(); |
286 return view ? adjustForZoom(view->contentsWidth(), &document) : 0; | 286 return view ? adjustForZoom(view->contentsWidth(), &document) : 0; |
287 } | 287 } |
288 | 288 |
289 } // namespace WebCore | 289 } // namespace WebCore |
OLD | NEW |