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

Side by Side Diff: Source/core/rendering/style/RenderStyle.cpp

Issue 561303002: Style changes to visual overflow do not require a layout (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 years, 2 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/rendering/style/BorderData.h ('k') | Source/core/rendering/style/StyleDifference.h » ('j') | 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) 1999 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 return true; 462 return true;
463 463
464 if (rareNonInheritedData->m_deprecatedFlexibleBox.get() != other.rareNon InheritedData->m_deprecatedFlexibleBox.get() 464 if (rareNonInheritedData->m_deprecatedFlexibleBox.get() != other.rareNon InheritedData->m_deprecatedFlexibleBox.get()
465 && *rareNonInheritedData->m_deprecatedFlexibleBox.get() != *other.ra reNonInheritedData->m_deprecatedFlexibleBox.get()) 465 && *rareNonInheritedData->m_deprecatedFlexibleBox.get() != *other.ra reNonInheritedData->m_deprecatedFlexibleBox.get())
466 return true; 466 return true;
467 467
468 if (rareNonInheritedData->m_flexibleBox.get() != other.rareNonInheritedD ata->m_flexibleBox.get() 468 if (rareNonInheritedData->m_flexibleBox.get() != other.rareNonInheritedD ata->m_flexibleBox.get()
469 && *rareNonInheritedData->m_flexibleBox.get() != *other.rareNonInher itedData->m_flexibleBox.get()) 469 && *rareNonInheritedData->m_flexibleBox.get() != *other.rareNonInher itedData->m_flexibleBox.get())
470 return true; 470 return true;
471 471
472 // FIXME: We should add an optimized form of layout that just recomputes visual overflow.
473 if (!rareNonInheritedData->shadowDataEquivalent(*other.rareNonInheritedD ata.get()))
474 return true;
475
476 if (!rareNonInheritedData->reflectionDataEquivalent(*other.rareNonInheri tedData.get())) 472 if (!rareNonInheritedData->reflectionDataEquivalent(*other.rareNonInheri tedData.get()))
477 return true; 473 return true;
478 474
479 if (rareNonInheritedData->m_multiCol.get() != other.rareNonInheritedData ->m_multiCol.get() 475 if (rareNonInheritedData->m_multiCol.get() != other.rareNonInheritedData ->m_multiCol.get()
480 && *rareNonInheritedData->m_multiCol.get() != *other.rareNonInherite dData->m_multiCol.get()) 476 && *rareNonInheritedData->m_multiCol.get() != *other.rareNonInherite dData->m_multiCol.get())
481 return true; 477 return true;
482 478
483 // If the counter directives change, trigger a relayout to re-calculate counter values and rebuild the counter node tree. 479 // If the counter directives change, trigger a relayout to re-calculate counter values and rebuild the counter node tree.
484 const CounterDirectiveMap* mapA = rareNonInheritedData->m_counterDirecti ves.get(); 480 const CounterDirectiveMap* mapA = rareNonInheritedData->m_counterDirecti ves.get();
485 const CounterDirectiveMap* mapB = other.rareNonInheritedData->m_counterD irectives.get(); 481 const CounterDirectiveMap* mapB = other.rareNonInheritedData->m_counterD irectives.get();
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 return true; 577 return true;
582 } else if (noninherited_flags.effectiveDisplay == LIST_ITEM) { 578 } else if (noninherited_flags.effectiveDisplay == LIST_ITEM) {
583 if (inherited_flags._list_style_type != other.inherited_flags._list_styl e_type 579 if (inherited_flags._list_style_type != other.inherited_flags._list_styl e_type
584 || inherited_flags._list_style_position != other.inherited_flags._li st_style_position) 580 || inherited_flags._list_style_position != other.inherited_flags._li st_style_position)
585 return true; 581 return true;
586 } 582 }
587 583
588 if ((visibility() == COLLAPSE) != (other.visibility() == COLLAPSE)) 584 if ((visibility() == COLLAPSE) != (other.visibility() == COLLAPSE))
589 return true; 585 return true;
590 586
591 if (!m_background->outline().visuallyEqual(other.m_background->outline())) {
592 // FIXME: We only really need to recompute the overflow but we don't hav e an optimized layout for it.
593 return true;
594 }
595
596 // Movement of non-static-positioned object is special cased in RenderStyle: :visualInvalidationDiff(). 587 // Movement of non-static-positioned object is special cased in RenderStyle: :visualInvalidationDiff().
597 588
598 return false; 589 return false;
599 } 590 }
600 591
601 bool RenderStyle::diffNeedsFullLayout(const RenderStyle& other) const 592 bool RenderStyle::diffNeedsFullLayout(const RenderStyle& other) const
602 { 593 {
603 if (m_box.get() != other.m_box.get()) { 594 if (m_box.get() != other.m_box.get()) {
604 if (m_box->width() != other.m_box->width() 595 if (m_box->width() != other.m_box->width()
605 || m_box->minWidth() != other.m_box->minWidth() 596 || m_box->minWidth() != other.m_box->minWidth()
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 if (rareNonInheritedData->m_mask != other.rareNonInheritedData->m_mask 640 if (rareNonInheritedData->m_mask != other.rareNonInheritedData->m_mask
650 || rareNonInheritedData->m_maskBoxImage != other.rareNonInheritedDat a->m_maskBoxImage) 641 || rareNonInheritedData->m_maskBoxImage != other.rareNonInheritedDat a->m_maskBoxImage)
651 return true; 642 return true;
652 } 643 }
653 644
654 return false; 645 return false;
655 } 646 }
656 647
657 bool RenderStyle::diffNeedsPaintInvalidationObject(const RenderStyle& other) con st 648 bool RenderStyle::diffNeedsPaintInvalidationObject(const RenderStyle& other) con st
658 { 649 {
650 if (!m_background->outline().visuallyEqual(other.m_background->outline()))
651 return true;
652
659 if (inherited_flags._visibility != other.inherited_flags._visibility 653 if (inherited_flags._visibility != other.inherited_flags._visibility
660 || inherited_flags.m_printColorAdjust != other.inherited_flags.m_printCo lorAdjust 654 || inherited_flags.m_printColorAdjust != other.inherited_flags.m_printCo lorAdjust
661 || inherited_flags._insideLink != other.inherited_flags._insideLink 655 || inherited_flags._insideLink != other.inherited_flags._insideLink
662 || !surround->border.visuallyEqual(other.surround->border) 656 || !surround->border.visuallyEqual(other.surround->border)
663 || !m_background->visuallyEqual(*other.m_background)) 657 || !m_background->visuallyEqual(*other.m_background))
664 return true; 658 return true;
665 659
666 if (rareInheritedData.get() != other.rareInheritedData.get()) { 660 if (rareInheritedData.get() != other.rareInheritedData.get()) {
667 if (rareInheritedData->userModify != other.rareInheritedData->userModify 661 if (rareInheritedData->userModify != other.rareInheritedData->userModify
668 || rareInheritedData->userSelect != other.rareInheritedData->userSel ect 662 || rareInheritedData->userSelect != other.rareInheritedData->userSel ect
669 || rareInheritedData->m_imageRendering != other.rareInheritedData->m _imageRendering) 663 || rareInheritedData->m_imageRendering != other.rareInheritedData->m _imageRendering)
670 return true; 664 return true;
671 } 665 }
672 666
673 if (rareNonInheritedData.get() != other.rareNonInheritedData.get()) { 667 if (rareNonInheritedData.get() != other.rareNonInheritedData.get()) {
674 if (rareNonInheritedData->userDrag != other.rareNonInheritedData->userDr ag 668 if (rareNonInheritedData->userDrag != other.rareNonInheritedData->userDr ag
675 || rareNonInheritedData->m_objectFit != other.rareNonInheritedData-> m_objectFit 669 || rareNonInheritedData->m_objectFit != other.rareNonInheritedData-> m_objectFit
676 || rareNonInheritedData->m_objectPosition != other.rareNonInheritedD ata->m_objectPosition 670 || rareNonInheritedData->m_objectPosition != other.rareNonInheritedD ata->m_objectPosition
671 || !rareNonInheritedData->shadowDataEquivalent(*other.rareNonInherit edData.get())
677 || !dataEquivalent(rareNonInheritedData->m_shapeOutside, other.rareN onInheritedData->m_shapeOutside) 672 || !dataEquivalent(rareNonInheritedData->m_shapeOutside, other.rareN onInheritedData->m_shapeOutside)
678 || !dataEquivalent(rareNonInheritedData->m_clipPath, other.rareNonIn heritedData->m_clipPath)) 673 || !dataEquivalent(rareNonInheritedData->m_clipPath, other.rareNonIn heritedData->m_clipPath))
679 return true; 674 return true;
680 } 675 }
681 676
682 return false; 677 return false;
683 } 678 }
684 679
685 void RenderStyle::updatePropertySpecificDifferences(const RenderStyle& other, St yleDifference& diff) const 680 void RenderStyle::updatePropertySpecificDifferences(const RenderStyle& other, St yleDifference& diff) const
686 { 681 {
687 // StyleAdjuster has ensured that zIndex is non-auto only if it's applicable . 682 // StyleAdjuster has ensured that zIndex is non-auto only if it's applicable .
688 if (m_box->zIndex() != other.m_box->zIndex() || m_box->hasAutoZIndex() != ot her.m_box->hasAutoZIndex()) 683 if (m_box->zIndex() != other.m_box->zIndex() || m_box->hasAutoZIndex() != ot her.m_box->hasAutoZIndex())
689 diff.setZIndexChanged(); 684 diff.setZIndexChanged();
690 685
691 if (rareNonInheritedData.get() != other.rareNonInheritedData.get()) { 686 if (rareNonInheritedData.get() != other.rareNonInheritedData.get()) {
692 if (!transformDataEquivalent(other)) 687 if (!transformDataEquivalent(other))
693 diff.setTransformChanged(); 688 diff.setTransformChanged();
694 689
695 if (rareNonInheritedData->opacity != other.rareNonInheritedData->opacity ) 690 if (rareNonInheritedData->opacity != other.rareNonInheritedData->opacity )
696 diff.setOpacityChanged(); 691 diff.setOpacityChanged();
697 692
698 if (rareNonInheritedData->m_filter != other.rareNonInheritedData->m_filt er) 693 if (rareNonInheritedData->m_filter != other.rareNonInheritedData->m_filt er)
699 diff.setFilterChanged(); 694 diff.setFilterChanged();
695
696 if (!rareNonInheritedData->shadowDataEquivalent(*other.rareNonInheritedD ata.get()))
697 diff.setVisualOverflowChanged();
700 } 698 }
701 699
700 if (!m_background->outline().visuallyEqual(other.m_background->outline()) || !surround->border.visualOverflowEqual(other.surround->border))
701 diff.setVisualOverflowChanged();
702
702 if (!diff.needsPaintInvalidation()) { 703 if (!diff.needsPaintInvalidation()) {
703 if (inherited->color != other.inherited->color 704 if (inherited->color != other.inherited->color
704 || inherited_flags.m_textUnderline != other.inherited_flags.m_textUn derline 705 || inherited_flags.m_textUnderline != other.inherited_flags.m_textUn derline
705 || visual->textDecoration != other.visual->textDecoration) { 706 || visual->textDecoration != other.visual->textDecoration) {
706 diff.setTextOrColorChanged(); 707 diff.setTextOrColorChanged();
707 } else if (rareNonInheritedData.get() != other.rareNonInheritedData.get( )) { 708 } else if (rareNonInheritedData.get() != other.rareNonInheritedData.get( )) {
708 if (rareNonInheritedData->m_textDecorationStyle != other.rareNonInhe ritedData->m_textDecorationStyle 709 if (rareNonInheritedData->m_textDecorationStyle != other.rareNonInhe ritedData->m_textDecorationStyle
709 || rareNonInheritedData->m_textDecorationColor != other.rareNonI nheritedData->m_textDecorationColor) 710 || rareNonInheritedData->m_textDecorationColor != other.rareNonI nheritedData->m_textDecorationColor)
710 diff.setTextOrColorChanged(); 711 diff.setTextOrColorChanged();
711 } else if (rareInheritedData.get() != other.rareInheritedData.get()) { 712 } else if (rareInheritedData.get() != other.rareInheritedData.get()) {
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after
1754 horizontal || includeLogicalRightEdge); 1755 horizontal || includeLogicalRightEdge);
1755 1756
1756 edges[BSLeft] = BorderEdge(borderLeftWidth(), 1757 edges[BSLeft] = BorderEdge(borderLeftWidth(),
1757 visitedDependentColor(CSSPropertyBorderLeftColor), 1758 visitedDependentColor(CSSPropertyBorderLeftColor),
1758 borderLeftStyle(), 1759 borderLeftStyle(),
1759 borderLeftIsTransparent(), 1760 borderLeftIsTransparent(),
1760 !horizontal || includeLogicalLeftEdge); 1761 !horizontal || includeLogicalLeftEdge);
1761 } 1762 }
1762 1763
1763 } // namespace blink 1764 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/style/BorderData.h ('k') | Source/core/rendering/style/StyleDifference.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698