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

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

Issue 15864004: Move create() methods from StylePropertySet to MutableStylePropertySet. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 bool cellChanged = false; 409 bool cellChanged = false;
410 for (Node* child = firstChild(); child; child = child->nextSibling()) 410 for (Node* child = firstChild(); child; child = child->nextSibling())
411 cellChanged |= setTableCellsChanged(child); 411 cellChanged |= setTableCellsChanged(child);
412 if (cellChanged) 412 if (cellChanged)
413 setNeedsStyleRecalc(); 413 setNeedsStyleRecalc();
414 } 414 }
415 } 415 }
416 416
417 static StylePropertySet* leakBorderStyle(int value) 417 static StylePropertySet* leakBorderStyle(int value)
418 { 418 {
419 RefPtr<StylePropertySet> style = StylePropertySet::create(); 419 RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create();
420 style->setProperty(CSSPropertyBorderTopStyle, value); 420 style->setProperty(CSSPropertyBorderTopStyle, value);
421 style->setProperty(CSSPropertyBorderBottomStyle, value); 421 style->setProperty(CSSPropertyBorderBottomStyle, value);
422 style->setProperty(CSSPropertyBorderLeftStyle, value); 422 style->setProperty(CSSPropertyBorderLeftStyle, value);
423 style->setProperty(CSSPropertyBorderRightStyle, value); 423 style->setProperty(CSSPropertyBorderRightStyle, value);
424 return style.release().leakRef(); 424 return style.release().leakRef();
425 } 425 }
426 426
427 const StylePropertySet* HTMLTableElement::additionalPresentationAttributeStyle() 427 const StylePropertySet* HTMLTableElement::additionalPresentationAttributeStyle()
428 { 428 {
429 if (m_frameAttr) 429 if (m_frameAttr)
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 if (m_borderColorAttr) 465 if (m_borderColorAttr)
466 return SolidBorders; 466 return SolidBorders;
467 return InsetBorders; 467 return InsetBorders;
468 } 468 }
469 ASSERT_NOT_REACHED(); 469 ASSERT_NOT_REACHED();
470 return NoBorders; 470 return NoBorders;
471 } 471 }
472 472
473 PassRefPtr<StylePropertySet> HTMLTableElement::createSharedCellStyle() 473 PassRefPtr<StylePropertySet> HTMLTableElement::createSharedCellStyle()
474 { 474 {
475 RefPtr<StylePropertySet> style = StylePropertySet::create(); 475 RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create();
476 476
477 switch (cellBorders()) { 477 switch (cellBorders()) {
478 case SolidBordersColsOnly: 478 case SolidBordersColsOnly:
479 style->setProperty(CSSPropertyBorderLeftWidth, CSSValueThin); 479 style->setProperty(CSSPropertyBorderLeftWidth, CSSValueThin);
480 style->setProperty(CSSPropertyBorderRightWidth, CSSValueThin); 480 style->setProperty(CSSPropertyBorderRightWidth, CSSValueThin);
481 style->setProperty(CSSPropertyBorderLeftStyle, CSSValueSolid); 481 style->setProperty(CSSPropertyBorderLeftStyle, CSSValueSolid);
482 style->setProperty(CSSPropertyBorderRightStyle, CSSValueSolid); 482 style->setProperty(CSSPropertyBorderRightStyle, CSSValueSolid);
483 style->setProperty(CSSPropertyBorderColor, cssValuePool().createInherite dValue()); 483 style->setProperty(CSSPropertyBorderColor, cssValuePool().createInherite dValue());
484 break; 484 break;
485 case SolidBordersRowsOnly: 485 case SolidBordersRowsOnly:
(...skipping 26 matching lines...) Expand all
512 512
513 const StylePropertySet* HTMLTableElement::additionalCellStyle() 513 const StylePropertySet* HTMLTableElement::additionalCellStyle()
514 { 514 {
515 if (!m_sharedCellStyle) 515 if (!m_sharedCellStyle)
516 m_sharedCellStyle = createSharedCellStyle(); 516 m_sharedCellStyle = createSharedCellStyle();
517 return m_sharedCellStyle.get(); 517 return m_sharedCellStyle.get();
518 } 518 }
519 519
520 static StylePropertySet* leakGroupBorderStyle(int rows) 520 static StylePropertySet* leakGroupBorderStyle(int rows)
521 { 521 {
522 RefPtr<StylePropertySet> style = StylePropertySet::create(); 522 RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create();
523 if (rows) { 523 if (rows) {
524 style->setProperty(CSSPropertyBorderTopWidth, CSSValueThin); 524 style->setProperty(CSSPropertyBorderTopWidth, CSSValueThin);
525 style->setProperty(CSSPropertyBorderBottomWidth, CSSValueThin); 525 style->setProperty(CSSPropertyBorderBottomWidth, CSSValueThin);
526 style->setProperty(CSSPropertyBorderTopStyle, CSSValueSolid); 526 style->setProperty(CSSPropertyBorderTopStyle, CSSValueSolid);
527 style->setProperty(CSSPropertyBorderBottomStyle, CSSValueSolid); 527 style->setProperty(CSSPropertyBorderBottomStyle, CSSValueSolid);
528 } else { 528 } else {
529 style->setProperty(CSSPropertyBorderLeftWidth, CSSValueThin); 529 style->setProperty(CSSPropertyBorderLeftWidth, CSSValueThin);
530 style->setProperty(CSSPropertyBorderRightWidth, CSSValueThin); 530 style->setProperty(CSSPropertyBorderRightWidth, CSSValueThin);
531 style->setProperty(CSSPropertyBorderLeftStyle, CSSValueSolid); 531 style->setProperty(CSSPropertyBorderLeftStyle, CSSValueSolid);
532 style->setProperty(CSSPropertyBorderRightStyle, CSSValueSolid); 532 style->setProperty(CSSPropertyBorderRightStyle, CSSValueSolid);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 } 573 }
574 574
575 void HTMLTableElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) cons t 575 void HTMLTableElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) cons t
576 { 576 {
577 HTMLElement::addSubresourceAttributeURLs(urls); 577 HTMLElement::addSubresourceAttributeURLs(urls);
578 578
579 addSubresourceURL(urls, document()->completeURL(getAttribute(backgroundAttr) )); 579 addSubresourceURL(urls, document()->completeURL(getAttribute(backgroundAttr) ));
580 } 580 }
581 581
582 } 582 }
OLDNEW
« no previous file with comments | « Source/core/editing/EditorCommand.cpp ('k') | Source/core/html/canvas/CanvasRenderingContext2D.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698