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

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

Powered by Google App Engine
This is Rietveld 408576698