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, 2008, 2010, 2011 Apple Inc. All rights
reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010, 2011 Apple Inc. All rights
reserved. |
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 26 matching lines...) Expand all Loading... |
37 #include "core/dom/ElementTraversal.h" | 37 #include "core/dom/ElementTraversal.h" |
38 #include "core/dom/ExceptionCode.h" | 38 #include "core/dom/ExceptionCode.h" |
39 #include "core/frame/UseCounter.h" | 39 #include "core/frame/UseCounter.h" |
40 #include "core/html/HTMLTableCaptionElement.h" | 40 #include "core/html/HTMLTableCaptionElement.h" |
41 #include "core/html/HTMLTableCellElement.h" | 41 #include "core/html/HTMLTableCellElement.h" |
42 #include "core/html/HTMLTableRowElement.h" | 42 #include "core/html/HTMLTableRowElement.h" |
43 #include "core/html/HTMLTableRowsCollection.h" | 43 #include "core/html/HTMLTableRowsCollection.h" |
44 #include "core/html/HTMLTableSectionElement.h" | 44 #include "core/html/HTMLTableSectionElement.h" |
45 #include "core/html/parser/HTMLParserIdioms.h" | 45 #include "core/html/parser/HTMLParserIdioms.h" |
46 #include "core/rendering/RenderTable.h" | 46 #include "core/rendering/RenderTable.h" |
| 47 #include "platform/weborigin/Referrer.h" |
47 #include "wtf/StdLibExtras.h" | 48 #include "wtf/StdLibExtras.h" |
48 | 49 |
49 namespace WebCore { | 50 namespace WebCore { |
50 | 51 |
51 using namespace HTMLNames; | 52 using namespace HTMLNames; |
52 | 53 |
53 HTMLTableElement::HTMLTableElement(Document& document) | 54 HTMLTableElement::HTMLTableElement(Document& document) |
54 : HTMLElement(tableTag, document) | 55 : HTMLElement(tableTag, document) |
55 , m_borderAttr(false) | 56 , m_borderAttr(false) |
56 , m_borderColorAttr(false) | 57 , m_borderColorAttr(false) |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 addHTMLLengthToStyle(style, CSSPropertyHeight, value); | 305 addHTMLLengthToStyle(style, CSSPropertyHeight, value); |
305 else if (name == borderAttr) | 306 else if (name == borderAttr) |
306 addPropertyToPresentationAttributeStyle(style, CSSPropertyBorderWidth, p
arseBorderWidthAttribute(value), CSSPrimitiveValue::CSS_PX); | 307 addPropertyToPresentationAttributeStyle(style, CSSPropertyBorderWidth, p
arseBorderWidthAttribute(value), CSSPrimitiveValue::CSS_PX); |
307 else if (name == bordercolorAttr) { | 308 else if (name == bordercolorAttr) { |
308 if (!value.isEmpty()) | 309 if (!value.isEmpty()) |
309 addHTMLColorToStyle(style, CSSPropertyBorderColor, value); | 310 addHTMLColorToStyle(style, CSSPropertyBorderColor, value); |
310 } else if (name == bgcolorAttr) | 311 } else if (name == bgcolorAttr) |
311 addHTMLColorToStyle(style, CSSPropertyBackgroundColor, value); | 312 addHTMLColorToStyle(style, CSSPropertyBackgroundColor, value); |
312 else if (name == backgroundAttr) { | 313 else if (name == backgroundAttr) { |
313 String url = stripLeadingAndTrailingHTMLSpaces(value); | 314 String url = stripLeadingAndTrailingHTMLSpaces(value); |
314 if (!url.isEmpty()) | 315 if (!url.isEmpty()) { |
315 style->setProperty(CSSProperty(CSSPropertyBackgroundImage, CSSImageV
alue::create(url, document().completeURL(url)))); | 316 RefPtrWillBeRawPtr<CSSImageValue> imageValue = CSSImageValue::create
(url, document().completeURL(url)); |
| 317 imageValue->setReferrer(Referrer(document().outgoingReferrer(), docu
ment().referrerPolicy())); |
| 318 style->setProperty(CSSProperty(CSSPropertyBackgroundImage, imageValu
e.release())); |
| 319 } |
316 } else if (name == valignAttr) { | 320 } else if (name == valignAttr) { |
317 if (!value.isEmpty()) | 321 if (!value.isEmpty()) |
318 addPropertyToPresentationAttributeStyle(style, CSSPropertyVerticalAl
ign, value); | 322 addPropertyToPresentationAttributeStyle(style, CSSPropertyVerticalAl
ign, value); |
319 } else if (name == cellspacingAttr) { | 323 } else if (name == cellspacingAttr) { |
320 if (!value.isEmpty()) | 324 if (!value.isEmpty()) |
321 addHTMLLengthToStyle(style, CSSPropertyBorderSpacing, value); | 325 addHTMLLengthToStyle(style, CSSPropertyBorderSpacing, value); |
322 } else if (name == vspaceAttr) { | 326 } else if (name == vspaceAttr) { |
323 UseCounter::count(document(), UseCounter::HTMLTableElementVspace); | 327 UseCounter::count(document(), UseCounter::HTMLTableElementVspace); |
324 addHTMLLengthToStyle(style, CSSPropertyMarginTop, value); | 328 addHTMLLengthToStyle(style, CSSPropertyMarginTop, value); |
325 addHTMLLengthToStyle(style, CSSPropertyMarginBottom, value); | 329 addHTMLLengthToStyle(style, CSSPropertyMarginBottom, value); |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 return getAttribute(summaryAttr); | 579 return getAttribute(summaryAttr); |
576 } | 580 } |
577 | 581 |
578 void HTMLTableElement::trace(Visitor* visitor) | 582 void HTMLTableElement::trace(Visitor* visitor) |
579 { | 583 { |
580 visitor->trace(m_sharedCellStyle); | 584 visitor->trace(m_sharedCellStyle); |
581 HTMLElement::trace(visitor); | 585 HTMLElement::trace(visitor); |
582 } | 586 } |
583 | 587 |
584 } | 588 } |
OLD | NEW |