| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 { | 67 { |
| 68 } | 68 } |
| 69 | 69 |
| 70 DEFINE_NODE_FACTORY(HTMLTableElement) | 70 DEFINE_NODE_FACTORY(HTMLTableElement) |
| 71 | 71 |
| 72 HTMLTableCaptionElement* HTMLTableElement::caption() const | 72 HTMLTableCaptionElement* HTMLTableElement::caption() const |
| 73 { | 73 { |
| 74 return Traversal<HTMLTableCaptionElement>::firstChild(*this); | 74 return Traversal<HTMLTableCaptionElement>::firstChild(*this); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void HTMLTableElement::setCaption(PassRefPtrWillBeRawPtr<HTMLTableCaptionElement
> newCaption, ExceptionState& exceptionState) | 77 void HTMLTableElement::setCaption(RawPtr<HTMLTableCaptionElement> newCaption, Ex
ceptionState& exceptionState) |
| 78 { | 78 { |
| 79 deleteCaption(); | 79 deleteCaption(); |
| 80 insertBefore(newCaption, firstChild(), exceptionState); | 80 insertBefore(newCaption, firstChild(), exceptionState); |
| 81 } | 81 } |
| 82 | 82 |
| 83 HTMLTableSectionElement* HTMLTableElement::tHead() const | 83 HTMLTableSectionElement* HTMLTableElement::tHead() const |
| 84 { | 84 { |
| 85 return toHTMLTableSectionElement(Traversal<HTMLElement>::firstChild(*this, H
asHTMLTagName(theadTag))); | 85 return toHTMLTableSectionElement(Traversal<HTMLElement>::firstChild(*this, H
asHTMLTagName(theadTag))); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void HTMLTableElement::setTHead(PassRefPtrWillBeRawPtr<HTMLTableSectionElement>
newHead, ExceptionState& exceptionState) | 88 void HTMLTableElement::setTHead(RawPtr<HTMLTableSectionElement> newHead, Excepti
onState& exceptionState) |
| 89 { | 89 { |
| 90 deleteTHead(); | 90 deleteTHead(); |
| 91 | 91 |
| 92 HTMLElement* child; | 92 HTMLElement* child; |
| 93 for (child = Traversal<HTMLElement>::firstChild(*this); child; child = Trave
rsal<HTMLElement>::nextSibling(*child)) { | 93 for (child = Traversal<HTMLElement>::firstChild(*this); child; child = Trave
rsal<HTMLElement>::nextSibling(*child)) { |
| 94 if (!child->hasTagName(captionTag) && !child->hasTagName(colgroupTag)) | 94 if (!child->hasTagName(captionTag) && !child->hasTagName(colgroupTag)) |
| 95 break; | 95 break; |
| 96 } | 96 } |
| 97 | 97 |
| 98 insertBefore(newHead, child, exceptionState); | 98 insertBefore(newHead, child, exceptionState); |
| 99 } | 99 } |
| 100 | 100 |
| 101 HTMLTableSectionElement* HTMLTableElement::tFoot() const | 101 HTMLTableSectionElement* HTMLTableElement::tFoot() const |
| 102 { | 102 { |
| 103 return toHTMLTableSectionElement(Traversal<HTMLElement>::firstChild(*this, H
asHTMLTagName(tfootTag))); | 103 return toHTMLTableSectionElement(Traversal<HTMLElement>::firstChild(*this, H
asHTMLTagName(tfootTag))); |
| 104 } | 104 } |
| 105 | 105 |
| 106 void HTMLTableElement::setTFoot(PassRefPtrWillBeRawPtr<HTMLTableSectionElement>
newFoot, ExceptionState& exceptionState) | 106 void HTMLTableElement::setTFoot(RawPtr<HTMLTableSectionElement> newFoot, Excepti
onState& exceptionState) |
| 107 { | 107 { |
| 108 deleteTFoot(); | 108 deleteTFoot(); |
| 109 | 109 |
| 110 HTMLElement* child; | 110 HTMLElement* child; |
| 111 for (child = Traversal<HTMLElement>::firstChild(*this); child; child = Trave
rsal<HTMLElement>::nextSibling(*child)) { | 111 for (child = Traversal<HTMLElement>::firstChild(*this); child; child = Trave
rsal<HTMLElement>::nextSibling(*child)) { |
| 112 if (!child->hasTagName(captionTag) && !child->hasTagName(colgroupTag) &&
!child->hasTagName(theadTag)) | 112 if (!child->hasTagName(captionTag) && !child->hasTagName(colgroupTag) &&
!child->hasTagName(theadTag)) |
| 113 break; | 113 break; |
| 114 } | 114 } |
| 115 | 115 |
| 116 insertBefore(newFoot, child, exceptionState); | 116 insertBefore(newFoot, child, exceptionState); |
| 117 } | 117 } |
| 118 | 118 |
| 119 PassRefPtrWillBeRawPtr<HTMLTableSectionElement> HTMLTableElement::createTHead() | 119 RawPtr<HTMLTableSectionElement> HTMLTableElement::createTHead() |
| 120 { | 120 { |
| 121 if (HTMLTableSectionElement* existingHead = tHead()) | 121 if (HTMLTableSectionElement* existingHead = tHead()) |
| 122 return existingHead; | 122 return existingHead; |
| 123 RefPtrWillBeRawPtr<HTMLTableSectionElement> head = HTMLTableSectionElement::
create(theadTag, document()); | 123 RawPtr<HTMLTableSectionElement> head = HTMLTableSectionElement::create(thead
Tag, document()); |
| 124 setTHead(head, IGNORE_EXCEPTION); | 124 setTHead(head, IGNORE_EXCEPTION); |
| 125 return head.release(); | 125 return head.release(); |
| 126 } | 126 } |
| 127 | 127 |
| 128 void HTMLTableElement::deleteTHead() | 128 void HTMLTableElement::deleteTHead() |
| 129 { | 129 { |
| 130 removeChild(tHead(), IGNORE_EXCEPTION); | 130 removeChild(tHead(), IGNORE_EXCEPTION); |
| 131 } | 131 } |
| 132 | 132 |
| 133 PassRefPtrWillBeRawPtr<HTMLTableSectionElement> HTMLTableElement::createTFoot() | 133 RawPtr<HTMLTableSectionElement> HTMLTableElement::createTFoot() |
| 134 { | 134 { |
| 135 if (HTMLTableSectionElement* existingFoot = tFoot()) | 135 if (HTMLTableSectionElement* existingFoot = tFoot()) |
| 136 return existingFoot; | 136 return existingFoot; |
| 137 RefPtrWillBeRawPtr<HTMLTableSectionElement> foot = HTMLTableSectionElement::
create(tfootTag, document()); | 137 RawPtr<HTMLTableSectionElement> foot = HTMLTableSectionElement::create(tfoot
Tag, document()); |
| 138 setTFoot(foot, IGNORE_EXCEPTION); | 138 setTFoot(foot, IGNORE_EXCEPTION); |
| 139 return foot.release(); | 139 return foot.release(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 void HTMLTableElement::deleteTFoot() | 142 void HTMLTableElement::deleteTFoot() |
| 143 { | 143 { |
| 144 removeChild(tFoot(), IGNORE_EXCEPTION); | 144 removeChild(tFoot(), IGNORE_EXCEPTION); |
| 145 } | 145 } |
| 146 | 146 |
| 147 PassRefPtrWillBeRawPtr<HTMLTableSectionElement> HTMLTableElement::createTBody() | 147 RawPtr<HTMLTableSectionElement> HTMLTableElement::createTBody() |
| 148 { | 148 { |
| 149 RefPtrWillBeRawPtr<HTMLTableSectionElement> body = HTMLTableSectionElement::
create(tbodyTag, document()); | 149 RawPtr<HTMLTableSectionElement> body = HTMLTableSectionElement::create(tbody
Tag, document()); |
| 150 Node* referenceElement = lastBody() ? lastBody()->nextSibling() : 0; | 150 Node* referenceElement = lastBody() ? lastBody()->nextSibling() : 0; |
| 151 | 151 |
| 152 insertBefore(body, referenceElement); | 152 insertBefore(body, referenceElement); |
| 153 return body.release(); | 153 return body.release(); |
| 154 } | 154 } |
| 155 | 155 |
| 156 PassRefPtrWillBeRawPtr<HTMLTableCaptionElement> HTMLTableElement::createCaption(
) | 156 RawPtr<HTMLTableCaptionElement> HTMLTableElement::createCaption() |
| 157 { | 157 { |
| 158 if (HTMLTableCaptionElement* existingCaption = caption()) | 158 if (HTMLTableCaptionElement* existingCaption = caption()) |
| 159 return existingCaption; | 159 return existingCaption; |
| 160 RefPtrWillBeRawPtr<HTMLTableCaptionElement> caption = HTMLTableCaptionElemen
t::create(document()); | 160 RawPtr<HTMLTableCaptionElement> caption = HTMLTableCaptionElement::create(do
cument()); |
| 161 setCaption(caption, IGNORE_EXCEPTION); | 161 setCaption(caption, IGNORE_EXCEPTION); |
| 162 return caption.release(); | 162 return caption.release(); |
| 163 } | 163 } |
| 164 | 164 |
| 165 void HTMLTableElement::deleteCaption() | 165 void HTMLTableElement::deleteCaption() |
| 166 { | 166 { |
| 167 removeChild(caption(), IGNORE_EXCEPTION); | 167 removeChild(caption(), IGNORE_EXCEPTION); |
| 168 } | 168 } |
| 169 | 169 |
| 170 HTMLTableSectionElement* HTMLTableElement::lastBody() const | 170 HTMLTableSectionElement* HTMLTableElement::lastBody() const |
| 171 { | 171 { |
| 172 return toHTMLTableSectionElement(Traversal<HTMLElement>::lastChild(*this, Ha
sHTMLTagName(tbodyTag))); | 172 return toHTMLTableSectionElement(Traversal<HTMLElement>::lastChild(*this, Ha
sHTMLTagName(tbodyTag))); |
| 173 } | 173 } |
| 174 | 174 |
| 175 PassRefPtrWillBeRawPtr<HTMLTableRowElement> HTMLTableElement::insertRow(int inde
x, ExceptionState& exceptionState) | 175 RawPtr<HTMLTableRowElement> HTMLTableElement::insertRow(int index, ExceptionStat
e& exceptionState) |
| 176 { | 176 { |
| 177 if (index < -1) { | 177 if (index < -1) { |
| 178 exceptionState.throwDOMException(IndexSizeError, "The index provided ("
+ String::number(index) + ") is less than -1."); | 178 exceptionState.throwDOMException(IndexSizeError, "The index provided ("
+ String::number(index) + ") is less than -1."); |
| 179 return nullptr; | 179 return nullptr; |
| 180 } | 180 } |
| 181 | 181 |
| 182 RefPtrWillBeRawPtr<Node> protectFromMutationEvents(this); | 182 RawPtr<Node> protectFromMutationEvents(this); |
| 183 | 183 |
| 184 RefPtrWillBeRawPtr<HTMLTableRowElement> lastRow = nullptr; | 184 RawPtr<HTMLTableRowElement> lastRow = nullptr; |
| 185 RefPtrWillBeRawPtr<HTMLTableRowElement> row = nullptr; | 185 RawPtr<HTMLTableRowElement> row = nullptr; |
| 186 if (index == -1) { | 186 if (index == -1) { |
| 187 lastRow = HTMLTableRowsCollection::lastRow(*this); | 187 lastRow = HTMLTableRowsCollection::lastRow(*this); |
| 188 } else { | 188 } else { |
| 189 for (int i = 0; i <= index; ++i) { | 189 for (int i = 0; i <= index; ++i) { |
| 190 row = HTMLTableRowsCollection::rowAfter(*this, lastRow.get()); | 190 row = HTMLTableRowsCollection::rowAfter(*this, lastRow.get()); |
| 191 if (!row) { | 191 if (!row) { |
| 192 if (i != index) { | 192 if (i != index) { |
| 193 exceptionState.throwDOMException(IndexSizeError, "The index
provided (" + String::number(index) + ") is greater than the number of rows in t
he table (" + String::number(i) + ")."); | 193 exceptionState.throwDOMException(IndexSizeError, "The index
provided (" + String::number(index) + ") is greater than the number of rows in t
he table (" + String::number(i) + ")."); |
| 194 return nullptr; | 194 return nullptr; |
| 195 } | 195 } |
| 196 break; | 196 break; |
| 197 } | 197 } |
| 198 lastRow = row; | 198 lastRow = row; |
| 199 } | 199 } |
| 200 } | 200 } |
| 201 | 201 |
| 202 RefPtrWillBeRawPtr<ContainerNode> parent; | 202 RawPtr<ContainerNode> parent; |
| 203 if (lastRow) { | 203 if (lastRow) { |
| 204 parent = row ? row->parentNode() : lastRow->parentNode(); | 204 parent = row ? row->parentNode() : lastRow->parentNode(); |
| 205 } else { | 205 } else { |
| 206 parent = lastBody(); | 206 parent = lastBody(); |
| 207 if (!parent) { | 207 if (!parent) { |
| 208 RefPtrWillBeRawPtr<HTMLTableSectionElement> newBody = HTMLTableSecti
onElement::create(tbodyTag, document()); | 208 RawPtr<HTMLTableSectionElement> newBody = HTMLTableSectionElement::c
reate(tbodyTag, document()); |
| 209 RefPtrWillBeRawPtr<HTMLTableRowElement> newRow = HTMLTableRowElement
::create(document()); | 209 RawPtr<HTMLTableRowElement> newRow = HTMLTableRowElement::create(doc
ument()); |
| 210 newBody->appendChild(newRow, exceptionState); | 210 newBody->appendChild(newRow, exceptionState); |
| 211 appendChild(newBody.release(), exceptionState); | 211 appendChild(newBody.release(), exceptionState); |
| 212 return newRow.release(); | 212 return newRow.release(); |
| 213 } | 213 } |
| 214 } | 214 } |
| 215 | 215 |
| 216 RefPtrWillBeRawPtr<HTMLTableRowElement> newRow = HTMLTableRowElement::create
(document()); | 216 RawPtr<HTMLTableRowElement> newRow = HTMLTableRowElement::create(document())
; |
| 217 parent->insertBefore(newRow, row.get(), exceptionState); | 217 parent->insertBefore(newRow, row.get(), exceptionState); |
| 218 return newRow.release(); | 218 return newRow.release(); |
| 219 } | 219 } |
| 220 | 220 |
| 221 void HTMLTableElement::deleteRow(int index, ExceptionState& exceptionState) | 221 void HTMLTableElement::deleteRow(int index, ExceptionState& exceptionState) |
| 222 { | 222 { |
| 223 if (index < -1) { | 223 if (index < -1) { |
| 224 exceptionState.throwDOMException(IndexSizeError, "The index provided ("
+ String::number(index) + ") is less than -1."); | 224 exceptionState.throwDOMException(IndexSizeError, "The index provided ("
+ String::number(index) + ") is less than -1."); |
| 225 return; | 225 return; |
| 226 } | 226 } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 } else if (name == borderAttr) { | 290 } else if (name == borderAttr) { |
| 291 addPropertyToPresentationAttributeStyle(style, CSSPropertyBorderWidth, p
arseBorderWidthAttribute(value), CSSPrimitiveValue::UnitType::Pixels); | 291 addPropertyToPresentationAttributeStyle(style, CSSPropertyBorderWidth, p
arseBorderWidthAttribute(value), CSSPrimitiveValue::UnitType::Pixels); |
| 292 } else if (name == bordercolorAttr) { | 292 } else if (name == bordercolorAttr) { |
| 293 if (!value.isEmpty()) | 293 if (!value.isEmpty()) |
| 294 addHTMLColorToStyle(style, CSSPropertyBorderColor, value); | 294 addHTMLColorToStyle(style, CSSPropertyBorderColor, value); |
| 295 } else if (name == bgcolorAttr) { | 295 } else if (name == bgcolorAttr) { |
| 296 addHTMLColorToStyle(style, CSSPropertyBackgroundColor, value); | 296 addHTMLColorToStyle(style, CSSPropertyBackgroundColor, value); |
| 297 } else if (name == backgroundAttr) { | 297 } else if (name == backgroundAttr) { |
| 298 String url = stripLeadingAndTrailingHTMLSpaces(value); | 298 String url = stripLeadingAndTrailingHTMLSpaces(value); |
| 299 if (!url.isEmpty()) { | 299 if (!url.isEmpty()) { |
| 300 RefPtrWillBeRawPtr<CSSImageValue> imageValue = CSSImageValue::create
(url, document().completeURL(url)); | 300 RawPtr<CSSImageValue> imageValue = CSSImageValue::create(url, docume
nt().completeURL(url)); |
| 301 imageValue->setReferrer(Referrer(document().outgoingReferrer(), docu
ment().referrerPolicy())); | 301 imageValue->setReferrer(Referrer(document().outgoingReferrer(), docu
ment().referrerPolicy())); |
| 302 style->setProperty(CSSProperty(CSSPropertyBackgroundImage, imageValu
e.release())); | 302 style->setProperty(CSSProperty(CSSPropertyBackgroundImage, imageValu
e.release())); |
| 303 } | 303 } |
| 304 } else if (name == valignAttr) { | 304 } else if (name == valignAttr) { |
| 305 if (!value.isEmpty()) | 305 if (!value.isEmpty()) |
| 306 addPropertyToPresentationAttributeStyle(style, CSSPropertyVerticalAl
ign, value); | 306 addPropertyToPresentationAttributeStyle(style, CSSPropertyVerticalAl
ign, value); |
| 307 } else if (name == cellspacingAttr) { | 307 } else if (name == cellspacingAttr) { |
| 308 if (!value.isEmpty()) | 308 if (!value.isEmpty()) |
| 309 addHTMLLengthToStyle(style, CSSPropertyBorderSpacing, value); | 309 addHTMLLengthToStyle(style, CSSPropertyBorderSpacing, value); |
| 310 } else if (name == alignAttr) { | 310 } else if (name == alignAttr) { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 } else { | 383 } else { |
| 384 HTMLElement::parseAttribute(name, oldValue, value); | 384 HTMLElement::parseAttribute(name, oldValue, value); |
| 385 } | 385 } |
| 386 | 386 |
| 387 if (bordersBefore != cellBorders() || oldPadding != m_padding) { | 387 if (bordersBefore != cellBorders() || oldPadding != m_padding) { |
| 388 m_sharedCellStyle = nullptr; | 388 m_sharedCellStyle = nullptr; |
| 389 setNeedsTableStyleRecalc(); | 389 setNeedsTableStyleRecalc(); |
| 390 } | 390 } |
| 391 } | 391 } |
| 392 | 392 |
| 393 static PassRefPtrWillBeRawPtr<StylePropertySet> createBorderStyle(CSSValueID val
ue) | 393 static RawPtr<StylePropertySet> createBorderStyle(CSSValueID value) |
| 394 { | 394 { |
| 395 RefPtrWillBeRawPtr<MutableStylePropertySet> style = MutableStylePropertySet:
:create(HTMLQuirksMode); | 395 RawPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(HTML
QuirksMode); |
| 396 style->setProperty(CSSPropertyBorderTopStyle, value); | 396 style->setProperty(CSSPropertyBorderTopStyle, value); |
| 397 style->setProperty(CSSPropertyBorderBottomStyle, value); | 397 style->setProperty(CSSPropertyBorderBottomStyle, value); |
| 398 style->setProperty(CSSPropertyBorderLeftStyle, value); | 398 style->setProperty(CSSPropertyBorderLeftStyle, value); |
| 399 style->setProperty(CSSPropertyBorderRightStyle, value); | 399 style->setProperty(CSSPropertyBorderRightStyle, value); |
| 400 return style.release(); | 400 return style.release(); |
| 401 } | 401 } |
| 402 | 402 |
| 403 const StylePropertySet* HTMLTableElement::additionalPresentationAttributeStyle() | 403 const StylePropertySet* HTMLTableElement::additionalPresentationAttributeStyle() |
| 404 { | 404 { |
| 405 if (m_frameAttr) | 405 if (m_frameAttr) |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 if (!m_borderAttr) | 439 if (!m_borderAttr) |
| 440 return NoBorders; | 440 return NoBorders; |
| 441 if (m_borderColorAttr) | 441 if (m_borderColorAttr) |
| 442 return SolidBorders; | 442 return SolidBorders; |
| 443 return InsetBorders; | 443 return InsetBorders; |
| 444 } | 444 } |
| 445 ASSERT_NOT_REACHED(); | 445 ASSERT_NOT_REACHED(); |
| 446 return NoBorders; | 446 return NoBorders; |
| 447 } | 447 } |
| 448 | 448 |
| 449 PassRefPtrWillBeRawPtr<StylePropertySet> HTMLTableElement::createSharedCellStyle
() | 449 RawPtr<StylePropertySet> HTMLTableElement::createSharedCellStyle() |
| 450 { | 450 { |
| 451 RefPtrWillBeRawPtr<MutableStylePropertySet> style = MutableStylePropertySet:
:create(HTMLQuirksMode); | 451 RawPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(HTML
QuirksMode); |
| 452 | 452 |
| 453 switch (cellBorders()) { | 453 switch (cellBorders()) { |
| 454 case SolidBordersColsOnly: | 454 case SolidBordersColsOnly: |
| 455 style->setProperty(CSSPropertyBorderLeftWidth, CSSValueThin); | 455 style->setProperty(CSSPropertyBorderLeftWidth, CSSValueThin); |
| 456 style->setProperty(CSSPropertyBorderRightWidth, CSSValueThin); | 456 style->setProperty(CSSPropertyBorderRightWidth, CSSValueThin); |
| 457 style->setProperty(CSSPropertyBorderLeftStyle, CSSValueSolid); | 457 style->setProperty(CSSPropertyBorderLeftStyle, CSSValueSolid); |
| 458 style->setProperty(CSSPropertyBorderRightStyle, CSSValueSolid); | 458 style->setProperty(CSSPropertyBorderRightStyle, CSSValueSolid); |
| 459 style->setProperty(CSSPropertyBorderColor, cssValuePool().createInherite
dValue()); | 459 style->setProperty(CSSPropertyBorderColor, cssValuePool().createInherite
dValue()); |
| 460 break; | 460 break; |
| 461 case SolidBordersRowsOnly: | 461 case SolidBordersRowsOnly: |
| (...skipping 24 matching lines...) Expand all Loading... |
| 486 return style.release(); | 486 return style.release(); |
| 487 } | 487 } |
| 488 | 488 |
| 489 const StylePropertySet* HTMLTableElement::additionalCellStyle() | 489 const StylePropertySet* HTMLTableElement::additionalCellStyle() |
| 490 { | 490 { |
| 491 if (!m_sharedCellStyle) | 491 if (!m_sharedCellStyle) |
| 492 m_sharedCellStyle = createSharedCellStyle(); | 492 m_sharedCellStyle = createSharedCellStyle(); |
| 493 return m_sharedCellStyle.get(); | 493 return m_sharedCellStyle.get(); |
| 494 } | 494 } |
| 495 | 495 |
| 496 static PassRefPtrWillBeRawPtr<StylePropertySet> createGroupBorderStyle(int rows) | 496 static RawPtr<StylePropertySet> createGroupBorderStyle(int rows) |
| 497 { | 497 { |
| 498 RefPtrWillBeRawPtr<MutableStylePropertySet> style = MutableStylePropertySet:
:create(HTMLQuirksMode); | 498 RawPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(HTML
QuirksMode); |
| 499 if (rows) { | 499 if (rows) { |
| 500 style->setProperty(CSSPropertyBorderTopWidth, CSSValueThin); | 500 style->setProperty(CSSPropertyBorderTopWidth, CSSValueThin); |
| 501 style->setProperty(CSSPropertyBorderBottomWidth, CSSValueThin); | 501 style->setProperty(CSSPropertyBorderBottomWidth, CSSValueThin); |
| 502 style->setProperty(CSSPropertyBorderTopStyle, CSSValueSolid); | 502 style->setProperty(CSSPropertyBorderTopStyle, CSSValueSolid); |
| 503 style->setProperty(CSSPropertyBorderBottomStyle, CSSValueSolid); | 503 style->setProperty(CSSPropertyBorderBottomStyle, CSSValueSolid); |
| 504 } else { | 504 } else { |
| 505 style->setProperty(CSSPropertyBorderLeftWidth, CSSValueThin); | 505 style->setProperty(CSSPropertyBorderLeftWidth, CSSValueThin); |
| 506 style->setProperty(CSSPropertyBorderRightWidth, CSSValueThin); | 506 style->setProperty(CSSPropertyBorderRightWidth, CSSValueThin); |
| 507 style->setProperty(CSSPropertyBorderLeftStyle, CSSValueSolid); | 507 style->setProperty(CSSPropertyBorderLeftStyle, CSSValueSolid); |
| 508 style->setProperty(CSSPropertyBorderRightStyle, CSSValueSolid); | 508 style->setProperty(CSSPropertyBorderRightStyle, CSSValueSolid); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 531 bool HTMLTableElement::hasLegalLinkAttribute(const QualifiedName& name) const | 531 bool HTMLTableElement::hasLegalLinkAttribute(const QualifiedName& name) const |
| 532 { | 532 { |
| 533 return name == backgroundAttr || HTMLElement::hasLegalLinkAttribute(name); | 533 return name == backgroundAttr || HTMLElement::hasLegalLinkAttribute(name); |
| 534 } | 534 } |
| 535 | 535 |
| 536 const QualifiedName& HTMLTableElement::subResourceAttributeName() const | 536 const QualifiedName& HTMLTableElement::subResourceAttributeName() const |
| 537 { | 537 { |
| 538 return backgroundAttr; | 538 return backgroundAttr; |
| 539 } | 539 } |
| 540 | 540 |
| 541 PassRefPtrWillBeRawPtr<HTMLTableRowsCollection> HTMLTableElement::rows() | 541 RawPtr<HTMLTableRowsCollection> HTMLTableElement::rows() |
| 542 { | 542 { |
| 543 return ensureCachedCollection<HTMLTableRowsCollection>(TableRows); | 543 return ensureCachedCollection<HTMLTableRowsCollection>(TableRows); |
| 544 } | 544 } |
| 545 | 545 |
| 546 PassRefPtrWillBeRawPtr<HTMLCollection> HTMLTableElement::tBodies() | 546 RawPtr<HTMLCollection> HTMLTableElement::tBodies() |
| 547 { | 547 { |
| 548 return ensureCachedCollection<HTMLCollection>(TableTBodies); | 548 return ensureCachedCollection<HTMLCollection>(TableTBodies); |
| 549 } | 549 } |
| 550 | 550 |
| 551 const AtomicString& HTMLTableElement::rules() const | 551 const AtomicString& HTMLTableElement::rules() const |
| 552 { | 552 { |
| 553 return getAttribute(rulesAttr); | 553 return getAttribute(rulesAttr); |
| 554 } | 554 } |
| 555 | 555 |
| 556 const AtomicString& HTMLTableElement::summary() const | 556 const AtomicString& HTMLTableElement::summary() const |
| 557 { | 557 { |
| 558 return getAttribute(summaryAttr); | 558 return getAttribute(summaryAttr); |
| 559 } | 559 } |
| 560 | 560 |
| 561 DEFINE_TRACE(HTMLTableElement) | 561 DEFINE_TRACE(HTMLTableElement) |
| 562 { | 562 { |
| 563 visitor->trace(m_sharedCellStyle); | 563 visitor->trace(m_sharedCellStyle); |
| 564 HTMLElement::trace(visitor); | 564 HTMLElement::trace(visitor); |
| 565 } | 565 } |
| 566 | 566 |
| 567 } // namespace blink | 567 } // namespace blink |
| OLD | NEW |