Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(499)

Side by Side Diff: Source/core/html/HTMLTableElement.cpp

Issue 273843003: [Oilpan]: Make StylePropertySet fully garbage collected. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 #if ENABLE(OILPAN)
540 DEFINE_STATIC_LOCAL(Persistent<StylePropertySet>, rowBorderStyle, (creat eGroupBorderStyle(true)));
haraken 2014/05/08 11:43:45 Can you use DEFINE_STATIC_REF_WILL_BE_PERSISTENT?
wibling-chromium 2014/05/08 12:38:55 Done.
541 #else
539 DEFINE_STATIC_REF(StylePropertySet, rowBorderStyle, (createGroupBorderSt yle(true))); 542 DEFINE_STATIC_REF(StylePropertySet, rowBorderStyle, (createGroupBorderSt yle(true)));
543 #endif
540 return rowBorderStyle; 544 return rowBorderStyle;
541 } 545 }
546 #if ENABLE(OILPAN)
547 DEFINE_STATIC_LOCAL(Persistent<StylePropertySet>, columnBorderStyle, (create GroupBorderStyle(false)));
haraken 2014/05/08 11:43:45 Ditto.
wibling-chromium 2014/05/08 12:38:55 Done.
548 #else
542 DEFINE_STATIC_REF(StylePropertySet, columnBorderStyle, (createGroupBorderSty le(false))); 549 DEFINE_STATIC_REF(StylePropertySet, columnBorderStyle, (createGroupBorderSty le(false)));
550 #endif
543 return columnBorderStyle; 551 return columnBorderStyle;
544 } 552 }
545 553
546 bool HTMLTableElement::isURLAttribute(const Attribute& attribute) const 554 bool HTMLTableElement::isURLAttribute(const Attribute& attribute) const
547 { 555 {
548 return attribute.name() == backgroundAttr || HTMLElement::isURLAttribute(att ribute); 556 return attribute.name() == backgroundAttr || HTMLElement::isURLAttribute(att ribute);
549 } 557 }
550 558
551 bool HTMLTableElement::hasLegalLinkAttribute(const QualifiedName& name) const 559 bool HTMLTableElement::hasLegalLinkAttribute(const QualifiedName& name) const
552 { 560 {
(...skipping 25 matching lines...) Expand all
578 return getAttribute(summaryAttr); 586 return getAttribute(summaryAttr);
579 } 587 }
580 588
581 void HTMLTableElement::trace(Visitor* visitor) 589 void HTMLTableElement::trace(Visitor* visitor)
582 { 590 {
583 visitor->trace(m_sharedCellStyle); 591 visitor->trace(m_sharedCellStyle);
584 HTMLElement::trace(visitor); 592 HTMLElement::trace(visitor);
585 } 593 }
586 594
587 } 595 }
OLDNEW
« Source/core/dom/PresentationAttributeStyle.cpp ('K') | « Source/core/editing/EditingStyle.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698