| OLD | NEW |
| 1 /** | 1 /** |
| 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) | 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) |
| 3 * (C) 1997 Torben Weis (weis@kde.org) | 3 * (C) 1997 Torben Weis (weis@kde.org) |
| 4 * (C) 1998 Waldo Bastian (bastian@kde.org) | 4 * (C) 1998 Waldo Bastian (bastian@kde.org) |
| 5 * (C) 1999 Lars Knoll (knoll@kde.org) | 5 * (C) 1999 Lars Knoll (knoll@kde.org) |
| 6 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 6 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 7 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc. | 7 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 #include "core/html/HTMLTablePartElement.h" | 25 #include "core/html/HTMLTablePartElement.h" |
| 26 | 26 |
| 27 #include "core/CSSPropertyNames.h" | 27 #include "core/CSSPropertyNames.h" |
| 28 #include "core/CSSValueKeywords.h" | 28 #include "core/CSSValueKeywords.h" |
| 29 #include "core/HTMLNames.h" | 29 #include "core/HTMLNames.h" |
| 30 #include "core/css/CSSImageValue.h" | 30 #include "core/css/CSSImageValue.h" |
| 31 #include "core/css/StylePropertySet.h" | 31 #include "core/css/StylePropertySet.h" |
| 32 #include "core/dom/Document.h" | 32 #include "core/dom/Document.h" |
| 33 #include "core/dom/shadow/FlatTreeTraversal.h" | 33 #include "core/dom/shadow/FlatTreeTraversal.h" |
| 34 #include "core/frame/UseCounter.h" |
| 34 #include "core/html/HTMLTableElement.h" | 35 #include "core/html/HTMLTableElement.h" |
| 35 #include "core/html/parser/HTMLParserIdioms.h" | 36 #include "core/html/parser/HTMLParserIdioms.h" |
| 36 #include "platform/weborigin/Referrer.h" | 37 #include "platform/weborigin/Referrer.h" |
| 37 | 38 |
| 38 namespace blink { | 39 namespace blink { |
| 39 | 40 |
| 40 using namespace HTMLNames; | 41 using namespace HTMLNames; |
| 41 | 42 |
| 42 bool HTMLTablePartElement::isPresentationAttribute( | 43 bool HTMLTablePartElement::isPresentationAttribute( |
| 43 const QualifiedName& name) const { | 44 const QualifiedName& name) const { |
| 44 if (name == bgcolorAttr || name == backgroundAttr || name == valignAttr || | 45 if (name == bgcolorAttr || name == backgroundAttr || name == valignAttr || |
| 45 name == alignAttr || name == heightAttr) | 46 name == alignAttr || name == heightAttr) |
| 46 return true; | 47 return true; |
| 47 return HTMLElement::isPresentationAttribute(name); | 48 return HTMLElement::isPresentationAttribute(name); |
| 48 } | 49 } |
| 49 | 50 |
| 50 void HTMLTablePartElement::collectStyleForPresentationAttribute( | 51 void HTMLTablePartElement::collectStyleForPresentationAttribute( |
| 51 const QualifiedName& name, | 52 const QualifiedName& name, |
| 52 const AtomicString& value, | 53 const AtomicString& value, |
| 53 MutableStylePropertySet* style) { | 54 MutableStylePropertySet* style) { |
| 54 if (name == bgcolorAttr) { | 55 if (name == bgcolorAttr) { |
| 55 addHTMLColorToStyle(style, CSSPropertyBackgroundColor, value); | 56 addHTMLColorToStyle(style, CSSPropertyBackgroundColor, value); |
| 56 } else if (name == backgroundAttr) { | 57 } else if (name == backgroundAttr) { |
| 57 String url = stripLeadingAndTrailingHTMLSpaces(value); | 58 String url = stripLeadingAndTrailingHTMLSpaces(value); |
| 58 if (!url.isEmpty()) { | 59 if (!url.isEmpty()) { |
| 60 UseCounter::count( |
| 61 document(), |
| 62 UseCounter::HTMLTableElementPresentationAttributeBackground); |
| 59 CSSImageValue* imageValue = | 63 CSSImageValue* imageValue = |
| 60 CSSImageValue::create(url, document().completeURL(url)); | 64 CSSImageValue::create(url, document().completeURL(url)); |
| 61 imageValue->setReferrer(Referrer(document().outgoingReferrer(), | 65 imageValue->setReferrer(Referrer(document().outgoingReferrer(), |
| 62 document().getReferrerPolicy())); | 66 document().getReferrerPolicy())); |
| 63 style->setProperty(CSSProperty(CSSPropertyBackgroundImage, *imageValue)); | 67 style->setProperty(CSSProperty(CSSPropertyBackgroundImage, *imageValue)); |
| 64 } | 68 } |
| 65 } else if (name == valignAttr) { | 69 } else if (name == valignAttr) { |
| 66 if (equalIgnoringCase(value, "top")) | 70 if (equalIgnoringCase(value, "top")) |
| 67 addPropertyToPresentationAttributeStyle(style, CSSPropertyVerticalAlign, | 71 addPropertyToPresentationAttributeStyle(style, CSSPropertyVerticalAlign, |
| 68 CSSValueTop); | 72 CSSValueTop); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 } | 108 } |
| 105 | 109 |
| 106 HTMLTableElement* HTMLTablePartElement::findParentTable() const { | 110 HTMLTableElement* HTMLTablePartElement::findParentTable() const { |
| 107 ContainerNode* parent = FlatTreeTraversal::parent(*this); | 111 ContainerNode* parent = FlatTreeTraversal::parent(*this); |
| 108 while (parent && !isHTMLTableElement(*parent)) | 112 while (parent && !isHTMLTableElement(*parent)) |
| 109 parent = FlatTreeTraversal::parent(*parent); | 113 parent = FlatTreeTraversal::parent(*parent); |
| 110 return toHTMLTableElement(parent); | 114 return toHTMLTableElement(parent); |
| 111 } | 115 } |
| 112 | 116 |
| 113 } // namespace blink | 117 } // namespace blink |
| OLD | NEW |