| 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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 // ### | 403 // ### |
| 404 } else | 404 } else |
| 405 HTMLElement::parseAttribute(name, value); | 405 HTMLElement::parseAttribute(name, value); |
| 406 | 406 |
| 407 if (bordersBefore != cellBorders() || oldPadding != m_padding) { | 407 if (bordersBefore != cellBorders() || oldPadding != m_padding) { |
| 408 m_sharedCellStyle = nullptr; | 408 m_sharedCellStyle = nullptr; |
| 409 setNeedsTableStyleRecalc(); | 409 setNeedsTableStyleRecalc(); |
| 410 } | 410 } |
| 411 } | 411 } |
| 412 | 412 |
| 413 static PassRefPtr<StylePropertySet> createBorderStyle(CSSValueID value) | 413 static PassRefPtrWillBeRawPtr<StylePropertySet> createBorderStyle(CSSValueID val
ue) |
| 414 { | 414 { |
| 415 RefPtrWillBeRawPtr<MutableStylePropertySet> style = MutableStylePropertySet:
:create(); | 415 RefPtrWillBeRawPtr<MutableStylePropertySet> style = MutableStylePropertySet:
:create(); |
| 416 style->setProperty(CSSPropertyBorderTopStyle, value); | 416 style->setProperty(CSSPropertyBorderTopStyle, value); |
| 417 style->setProperty(CSSPropertyBorderBottomStyle, value); | 417 style->setProperty(CSSPropertyBorderBottomStyle, value); |
| 418 style->setProperty(CSSPropertyBorderLeftStyle, value); | 418 style->setProperty(CSSPropertyBorderLeftStyle, value); |
| 419 style->setProperty(CSSPropertyBorderRightStyle, value); | 419 style->setProperty(CSSPropertyBorderRightStyle, value); |
| 420 return style.release(); | 420 return style.release(); |
| 421 } | 421 } |
| 422 | 422 |
| 423 const StylePropertySet* HTMLTableElement::additionalPresentationAttributeStyle() | 423 const StylePropertySet* HTMLTableElement::additionalPresentationAttributeStyle() |
| 424 { | 424 { |
| 425 if (m_frameAttr) | 425 if (m_frameAttr) |
| 426 return 0; | 426 return 0; |
| 427 | 427 |
| 428 if (!m_borderAttr && !m_borderColorAttr) { | 428 if (!m_borderAttr && !m_borderColorAttr) { |
| 429 // Setting the border to 'hidden' allows it to win over any border | 429 // Setting the border to 'hidden' allows it to win over any border |
| 430 // set on the table's cells during border-conflict resolution. | 430 // set on the table's cells during border-conflict resolution. |
| 431 if (m_rulesAttr != UnsetRules) { | 431 if (m_rulesAttr != UnsetRules) { |
| 432 DEFINE_STATIC_REF(StylePropertySet, solidBorderStyle, (createBorderS
tyle(CSSValueHidden))); | 432 DEFINE_STATIC_REF_WILL_BE_PERSISTENT(StylePropertySet, solidBorderSt
yle, (createBorderStyle(CSSValueHidden))); |
| 433 return solidBorderStyle; | 433 return solidBorderStyle; |
| 434 } | 434 } |
| 435 return 0; | 435 return 0; |
| 436 } | 436 } |
| 437 | 437 |
| 438 if (m_borderColorAttr) { | 438 if (m_borderColorAttr) { |
| 439 DEFINE_STATIC_REF(StylePropertySet, solidBorderStyle, (createBorderStyle
(CSSValueSolid))); | 439 DEFINE_STATIC_REF_WILL_BE_PERSISTENT(StylePropertySet, solidBorderStyle,
(createBorderStyle(CSSValueSolid))); |
| 440 return solidBorderStyle; | 440 return solidBorderStyle; |
| 441 } | 441 } |
| 442 DEFINE_STATIC_REF(StylePropertySet, outsetBorderStyle, (createBorderStyle(CS
SValueOutset))); | 442 DEFINE_STATIC_REF_WILL_BE_PERSISTENT(StylePropertySet, outsetBorderStyle, (c
reateBorderStyle(CSSValueOutset))); |
| 443 return outsetBorderStyle; | 443 return outsetBorderStyle; |
| 444 } | 444 } |
| 445 | 445 |
| 446 HTMLTableElement::CellBorders HTMLTableElement::cellBorders() const | 446 HTMLTableElement::CellBorders HTMLTableElement::cellBorders() const |
| 447 { | 447 { |
| 448 switch (m_rulesAttr) { | 448 switch (m_rulesAttr) { |
| 449 case NoneRules: | 449 case NoneRules: |
| 450 case GroupsRules: | 450 case GroupsRules: |
| 451 return NoBorders; | 451 return NoBorders; |
| 452 case AllRules: | 452 case AllRules: |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 } | 529 } |
| 530 return style.release(); | 530 return style.release(); |
| 531 } | 531 } |
| 532 | 532 |
| 533 const StylePropertySet* HTMLTableElement::additionalGroupStyle(bool rows) | 533 const StylePropertySet* HTMLTableElement::additionalGroupStyle(bool rows) |
| 534 { | 534 { |
| 535 if (m_rulesAttr != GroupsRules) | 535 if (m_rulesAttr != GroupsRules) |
| 536 return 0; | 536 return 0; |
| 537 | 537 |
| 538 if (rows) { | 538 if (rows) { |
| 539 DEFINE_STATIC_REF(StylePropertySet, rowBorderStyle, (createGroupBorderSt
yle(true))); | 539 DEFINE_STATIC_REF_WILL_BE_PERSISTENT(StylePropertySet, rowBorderStyle, (
createGroupBorderStyle(true))); |
| 540 return rowBorderStyle; | 540 return rowBorderStyle; |
| 541 } | 541 } |
| 542 DEFINE_STATIC_REF(StylePropertySet, columnBorderStyle, (createGroupBorderSty
le(false))); | 542 DEFINE_STATIC_REF_WILL_BE_PERSISTENT(StylePropertySet, columnBorderStyle, (c
reateGroupBorderStyle(false))); |
| 543 return columnBorderStyle; | 543 return columnBorderStyle; |
| 544 } | 544 } |
| 545 | 545 |
| 546 bool HTMLTableElement::isURLAttribute(const Attribute& attribute) const | 546 bool HTMLTableElement::isURLAttribute(const Attribute& attribute) const |
| 547 { | 547 { |
| 548 return attribute.name() == backgroundAttr || HTMLElement::isURLAttribute(att
ribute); | 548 return attribute.name() == backgroundAttr || HTMLElement::isURLAttribute(att
ribute); |
| 549 } | 549 } |
| 550 | 550 |
| 551 bool HTMLTableElement::hasLegalLinkAttribute(const QualifiedName& name) const | 551 bool HTMLTableElement::hasLegalLinkAttribute(const QualifiedName& name) const |
| 552 { | 552 { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 578 return getAttribute(summaryAttr); | 578 return getAttribute(summaryAttr); |
| 579 } | 579 } |
| 580 | 580 |
| 581 void HTMLTableElement::trace(Visitor* visitor) | 581 void HTMLTableElement::trace(Visitor* visitor) |
| 582 { | 582 { |
| 583 visitor->trace(m_sharedCellStyle); | 583 visitor->trace(m_sharedCellStyle); |
| 584 HTMLElement::trace(visitor); | 584 HTMLElement::trace(visitor); |
| 585 } | 585 } |
| 586 | 586 |
| 587 } | 587 } |
| OLD | NEW |