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

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

Issue 236203020: Separate repaint and layout requirements of StyleDifference (Step 1) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase; Renaming of some methods and small changes in StyleDifference Created 6 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 | Annotate | Revision Log
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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 if (width.isIntrinsicOrAuto() 359 if (width.isIntrinsicOrAuto()
360 && ((!a.left().isIntrinsicOrAuto() && a.left() != b.left()) 360 && ((!a.left().isIntrinsicOrAuto() && a.left() != b.left())
361 || (!a.right().isIntrinsicOrAuto() && a.right() != b.right()))) 361 || (!a.right().isIntrinsicOrAuto() && a.right() != b.right())))
362 return false; 362 return false;
363 363
364 // One of the units is fixed or percent in both directions and stayed 364 // One of the units is fixed or percent in both directions and stayed
365 // that way in the new style. Therefore all we are doing is moving. 365 // that way in the new style. Therefore all we are doing is moving.
366 return true; 366 return true;
367 } 367 }
368 368
369 StyleDifference RenderStyle::visualInvalidationDiff(const RenderStyle& other, un signed& changedContextSensitiveProperties) const 369 StyleDifference RenderStyle::visualInvalidationDiff(const RenderStyle& other) co nst
370 {
371 unsigned context = ContextSensitivePropertyNone;
372 StyleDifferenceLegacy diff = visualInvalidationDiffLegacy(other, context);
373 return StyleDifference(diff, context);
374 }
375
376 StyleDifferenceLegacy RenderStyle::visualInvalidationDiffLegacy(const RenderStyl e& other, unsigned& changedContextSensitiveProperties) const
370 { 377 {
371 changedContextSensitiveProperties = ContextSensitivePropertyNone; 378 changedContextSensitiveProperties = ContextSensitivePropertyNone;
372 379
373 // Note, we use .get() on each DataRef below because DataRef::operator== wil l do a deep 380 // Note, we use .get() on each DataRef below because DataRef::operator== wil l do a deep
374 // compare, which is duplicate work when we're going to compare each propert y inside 381 // compare, which is duplicate work when we're going to compare each propert y inside
375 // this function anyway. 382 // this function anyway.
376 383
377 StyleDifference svgChange = StyleDifferenceEqual; 384 StyleDifferenceLegacy svgChange = StyleDifferenceEqual;
378 if (m_svgStyle.get() != other.m_svgStyle.get()) { 385 if (m_svgStyle.get() != other.m_svgStyle.get()) {
379 svgChange = m_svgStyle->diff(other.m_svgStyle.get()); 386 svgChange = m_svgStyle->diff(other.m_svgStyle.get());
380 if (svgChange == StyleDifferenceLayout) 387 if (svgChange == StyleDifferenceLayout)
381 return svgChange; 388 return svgChange;
382 } 389 }
383 390
384 if (m_box.get() != other.m_box.get()) { 391 if (m_box.get() != other.m_box.get()) {
385 if (m_box->width() != other.m_box->width() 392 if (m_box->width() != other.m_box->width()
386 || m_box->minWidth() != other.m_box->minWidth() 393 || m_box->minWidth() != other.m_box->minWidth()
387 || m_box->maxWidth() != other.m_box->maxWidth() 394 || m_box->maxWidth() != other.m_box->maxWidth()
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 if ((position() == AbsolutePosition || position() == FixedPosition) 593 if ((position() == AbsolutePosition || position() == FixedPosition)
587 && positionedObjectMovedOnly(surround->offset, other.surround->offse t, m_box->width()) 594 && positionedObjectMovedOnly(surround->offset, other.surround->offse t, m_box->width())
588 && repaintOnlyDiff(other, changedContextSensitiveProperties) == Styl eDifferenceEqual) 595 && repaintOnlyDiff(other, changedContextSensitiveProperties) == Styl eDifferenceEqual)
589 return StyleDifferenceLayoutPositionedMovementOnly; 596 return StyleDifferenceLayoutPositionedMovementOnly;
590 // FIXME: We would like to use SimplifiedLayout for relative positioning , but we can't quite do that yet. 597 // FIXME: We would like to use SimplifiedLayout for relative positioning , but we can't quite do that yet.
591 // We need to make sure SimplifiedLayout can operate correctly on Render Inlines (we will need 598 // We need to make sure SimplifiedLayout can operate correctly on Render Inlines (we will need
592 // to add a selfNeedsSimplifiedLayout bit in order to not get confused a nd taint every line). 599 // to add a selfNeedsSimplifiedLayout bit in order to not get confused a nd taint every line).
593 return StyleDifferenceLayout; 600 return StyleDifferenceLayout;
594 } 601 }
595 602
596 StyleDifference repaintDifference = repaintOnlyDiff(other, changedContextSen sitiveProperties); 603 StyleDifferenceLegacy repaintDifference = repaintOnlyDiff(other, changedCont extSensitiveProperties);
597 ASSERT(repaintDifference <= StyleDifferenceRepaintLayer); 604 ASSERT(repaintDifference <= StyleDifferenceRepaintLayer);
598 return repaintDifference; 605 return repaintDifference;
599 } 606 }
600 607
601 StyleDifference RenderStyle::repaintOnlyDiff(const RenderStyle& other, unsigned& changedContextSensitiveProperties) const 608 StyleDifferenceLegacy RenderStyle::repaintOnlyDiff(const RenderStyle& other, uns igned& changedContextSensitiveProperties) const
602 { 609 {
603 if (position() != StaticPosition && (m_box->zIndex() != other.m_box->zIndex( ) || m_box->hasAutoZIndex() != other.m_box->hasAutoZIndex() 610 if (position() != StaticPosition && (m_box->zIndex() != other.m_box->zIndex( ) || m_box->hasAutoZIndex() != other.m_box->hasAutoZIndex()
604 || visual->clip != other.visual->clip || visual->hasClip != other.visual ->hasClip)) 611 || visual->clip != other.visual->clip || visual->hasClip != other.visual ->hasClip))
605 return StyleDifferenceRepaintLayer; 612 return StyleDifferenceRepaintLayer;
606 613
607 if (RuntimeEnabledFeatures::cssCompositingEnabled() && (rareNonInheritedData ->m_effectiveBlendMode != other.rareNonInheritedData->m_effectiveBlendMode 614 if (RuntimeEnabledFeatures::cssCompositingEnabled() && (rareNonInheritedData ->m_effectiveBlendMode != other.rareNonInheritedData->m_effectiveBlendMode
608 || rareNonInheritedData->m_isolation != other.rareNonInheritedData->m_is olation)) 615 || rareNonInheritedData->m_isolation != other.rareNonInheritedData->m_is olation))
609 return StyleDifferenceRepaintLayer; 616 return StyleDifferenceRepaintLayer;
610 617
611 if (rareNonInheritedData->opacity != other.rareNonInheritedData->opacity) { 618 if (rareNonInheritedData->opacity != other.rareNonInheritedData->opacity) {
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1642 // right 1649 // right
1643 radiiSum = radii.topRight().height() + radii.bottomRight().height(); 1650 radiiSum = radii.topRight().height() + radii.bottomRight().height();
1644 if (radiiSum > rect.height()) 1651 if (radiiSum > rect.height())
1645 factor = std::min(rect.height() / radiiSum, factor); 1652 factor = std::min(rect.height() / radiiSum, factor);
1646 1653
1647 ASSERT(factor <= 1); 1654 ASSERT(factor <= 1);
1648 return factor; 1655 return factor;
1649 } 1656 }
1650 1657
1651 } // namespace WebCore 1658 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698