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

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

Issue 1850413002: Improve DEFINE_STATIC_LOCAL()'s handling of Blink GCed objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address compilation failure Created 4 years, 8 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
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 const StylePropertySet* HTMLTableElement::additionalPresentationAttributeStyle() 404 const StylePropertySet* HTMLTableElement::additionalPresentationAttributeStyle()
405 { 405 {
406 if (m_frameAttr) 406 if (m_frameAttr)
407 return nullptr; 407 return nullptr;
408 408
409 if (!m_borderAttr && !m_borderColorAttr) { 409 if (!m_borderAttr && !m_borderColorAttr) {
410 // Setting the border to 'hidden' allows it to win over any border 410 // Setting the border to 'hidden' allows it to win over any border
411 // set on the table's cells during border-conflict resolution. 411 // set on the table's cells during border-conflict resolution.
412 if (m_rulesAttr != UnsetRules) { 412 if (m_rulesAttr != UnsetRules) {
413 DEFINE_STATIC_REF_WILL_BE_PERSISTENT(StylePropertySet, solidBorderSt yle, (createBorderStyle(CSSValueHidden))); 413 DEFINE_STATIC_LOCAL(StylePropertySet, solidBorderStyle, (createBorde rStyle(CSSValueHidden)));
414 return solidBorderStyle; 414 return &solidBorderStyle;
415 } 415 }
416 return nullptr; 416 return nullptr;
417 } 417 }
418 418
419 if (m_borderColorAttr) { 419 if (m_borderColorAttr) {
420 DEFINE_STATIC_REF_WILL_BE_PERSISTENT(StylePropertySet, solidBorderStyle, (createBorderStyle(CSSValueSolid))); 420 DEFINE_STATIC_LOCAL(StylePropertySet, solidBorderStyle, (createBorderSty le(CSSValueSolid)));
421 return solidBorderStyle; 421 return &solidBorderStyle;
422 } 422 }
423 DEFINE_STATIC_REF_WILL_BE_PERSISTENT(StylePropertySet, outsetBorderStyle, (c reateBorderStyle(CSSValueOutset))); 423 DEFINE_STATIC_LOCAL(StylePropertySet, outsetBorderStyle, (createBorderStyle( CSSValueOutset)));
424 return outsetBorderStyle; 424 return &outsetBorderStyle;
425 } 425 }
426 426
427 HTMLTableElement::CellBorders HTMLTableElement::getCellBorders() const 427 HTMLTableElement::CellBorders HTMLTableElement::getCellBorders() const
428 { 428 {
429 switch (m_rulesAttr) { 429 switch (m_rulesAttr) {
430 case NoneRules: 430 case NoneRules:
431 case GroupsRules: 431 case GroupsRules:
432 return NoBorders; 432 return NoBorders;
433 case AllRules: 433 case AllRules:
434 return SolidBorders; 434 return SolidBorders;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 } 510 }
511 return style.release(); 511 return style.release();
512 } 512 }
513 513
514 const StylePropertySet* HTMLTableElement::additionalGroupStyle(bool rows) 514 const StylePropertySet* HTMLTableElement::additionalGroupStyle(bool rows)
515 { 515 {
516 if (m_rulesAttr != GroupsRules) 516 if (m_rulesAttr != GroupsRules)
517 return nullptr; 517 return nullptr;
518 518
519 if (rows) { 519 if (rows) {
520 DEFINE_STATIC_REF_WILL_BE_PERSISTENT(StylePropertySet, rowBorderStyle, ( createGroupBorderStyle(true))); 520 DEFINE_STATIC_LOCAL(StylePropertySet, rowBorderStyle, (createGroupBorder Style(true)));
521 return rowBorderStyle; 521 return &rowBorderStyle;
522 } 522 }
523 DEFINE_STATIC_REF_WILL_BE_PERSISTENT(StylePropertySet, columnBorderStyle, (c reateGroupBorderStyle(false))); 523 DEFINE_STATIC_LOCAL(StylePropertySet, columnBorderStyle, (createGroupBorderS tyle(false)));
524 return columnBorderStyle; 524 return &columnBorderStyle;
525 } 525 }
526 526
527 bool HTMLTableElement::isURLAttribute(const Attribute& attribute) const 527 bool HTMLTableElement::isURLAttribute(const Attribute& attribute) const
528 { 528 {
529 return attribute.name() == backgroundAttr || HTMLElement::isURLAttribute(att ribute); 529 return attribute.name() == backgroundAttr || HTMLElement::isURLAttribute(att ribute);
530 } 530 }
531 531
532 bool HTMLTableElement::hasLegalLinkAttribute(const QualifiedName& name) const 532 bool HTMLTableElement::hasLegalLinkAttribute(const QualifiedName& name) const
533 { 533 {
534 return name == backgroundAttr || HTMLElement::hasLegalLinkAttribute(name); 534 return name == backgroundAttr || HTMLElement::hasLegalLinkAttribute(name);
(...skipping 24 matching lines...) Expand all
559 return getAttribute(summaryAttr); 559 return getAttribute(summaryAttr);
560 } 560 }
561 561
562 DEFINE_TRACE(HTMLTableElement) 562 DEFINE_TRACE(HTMLTableElement)
563 { 563 {
564 visitor->trace(m_sharedCellStyle); 564 visitor->trace(m_sharedCellStyle);
565 HTMLElement::trace(visitor); 565 HTMLElement::trace(visitor);
566 } 566 }
567 567
568 } // namespace blink 568 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLStyleElement.cpp ('k') | third_party/WebKit/Source/core/input/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698