| OLD | NEW |
| 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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, un
signed& changedContextSensitiveProperties) const |
| 370 { | 370 { |
| 371 return StyleDifference(visualInvalidationDiffLegacy(other, changedContextSen
sitiveProperties)); | |
| 372 } | |
| 373 | |
| 374 StyleDifferenceLegacy RenderStyle::visualInvalidationDiffLegacy(const RenderStyl
e& other, unsigned& changedContextSensitiveProperties) const | |
| 375 { | |
| 376 changedContextSensitiveProperties = ContextSensitivePropertyNone; | 371 changedContextSensitiveProperties = ContextSensitivePropertyNone; |
| 377 | 372 |
| 378 // Note, we use .get() on each DataRef below because DataRef::operator== wil
l do a deep | 373 // Note, we use .get() on each DataRef below because DataRef::operator== wil
l do a deep |
| 379 // compare, which is duplicate work when we're going to compare each propert
y inside | 374 // compare, which is duplicate work when we're going to compare each propert
y inside |
| 380 // this function anyway. | 375 // this function anyway. |
| 381 | 376 |
| 382 StyleDifferenceLegacy svgChange = StyleDifferenceEqual; | 377 StyleDifference svgChange = StyleDifferenceEqual; |
| 383 if (m_svgStyle.get() != other.m_svgStyle.get()) { | 378 if (m_svgStyle.get() != other.m_svgStyle.get()) { |
| 384 svgChange = m_svgStyle->diff(other.m_svgStyle.get()); | 379 svgChange = m_svgStyle->diff(other.m_svgStyle.get()); |
| 385 if (svgChange == StyleDifferenceLayout) | 380 if (svgChange == StyleDifferenceLayout) |
| 386 return svgChange; | 381 return svgChange; |
| 387 } | 382 } |
| 388 | 383 |
| 389 if (m_box.get() != other.m_box.get()) { | 384 if (m_box.get() != other.m_box.get()) { |
| 390 if (m_box->width() != other.m_box->width() | 385 if (m_box->width() != other.m_box->width() |
| 391 || m_box->minWidth() != other.m_box->minWidth() | 386 || m_box->minWidth() != other.m_box->minWidth() |
| 392 || m_box->maxWidth() != other.m_box->maxWidth() | 387 || m_box->maxWidth() != other.m_box->maxWidth() |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 if ((position() == AbsolutePosition || position() == FixedPosition) | 586 if ((position() == AbsolutePosition || position() == FixedPosition) |
| 592 && positionedObjectMovedOnly(surround->offset, other.surround->offse
t, m_box->width()) | 587 && positionedObjectMovedOnly(surround->offset, other.surround->offse
t, m_box->width()) |
| 593 && repaintOnlyDiff(other, changedContextSensitiveProperties) == Styl
eDifferenceEqual) | 588 && repaintOnlyDiff(other, changedContextSensitiveProperties) == Styl
eDifferenceEqual) |
| 594 return StyleDifferenceLayoutPositionedMovementOnly; | 589 return StyleDifferenceLayoutPositionedMovementOnly; |
| 595 // FIXME: We would like to use SimplifiedLayout for relative positioning
, but we can't quite do that yet. | 590 // FIXME: We would like to use SimplifiedLayout for relative positioning
, but we can't quite do that yet. |
| 596 // We need to make sure SimplifiedLayout can operate correctly on Render
Inlines (we will need | 591 // We need to make sure SimplifiedLayout can operate correctly on Render
Inlines (we will need |
| 597 // to add a selfNeedsSimplifiedLayout bit in order to not get confused a
nd taint every line). | 592 // to add a selfNeedsSimplifiedLayout bit in order to not get confused a
nd taint every line). |
| 598 return StyleDifferenceLayout; | 593 return StyleDifferenceLayout; |
| 599 } | 594 } |
| 600 | 595 |
| 601 StyleDifferenceLegacy repaintDifference = repaintOnlyDiff(other, changedCont
extSensitiveProperties); | 596 StyleDifference repaintDifference = repaintOnlyDiff(other, changedContextSen
sitiveProperties); |
| 602 ASSERT(repaintDifference <= StyleDifferenceRepaintLayer); | 597 ASSERT(repaintDifference <= StyleDifferenceRepaintLayer); |
| 603 return repaintDifference; | 598 return repaintDifference; |
| 604 } | 599 } |
| 605 | 600 |
| 606 StyleDifferenceLegacy RenderStyle::repaintOnlyDiff(const RenderStyle& other, uns
igned& changedContextSensitiveProperties) const | 601 StyleDifference RenderStyle::repaintOnlyDiff(const RenderStyle& other, unsigned&
changedContextSensitiveProperties) const |
| 607 { | 602 { |
| 608 if (position() != StaticPosition && (m_box->zIndex() != other.m_box->zIndex(
) || m_box->hasAutoZIndex() != other.m_box->hasAutoZIndex() | 603 if (position() != StaticPosition && (m_box->zIndex() != other.m_box->zIndex(
) || m_box->hasAutoZIndex() != other.m_box->hasAutoZIndex() |
| 609 || visual->clip != other.visual->clip || visual->hasClip != other.visual
->hasClip)) | 604 || visual->clip != other.visual->clip || visual->hasClip != other.visual
->hasClip)) |
| 610 return StyleDifferenceRepaintLayer; | 605 return StyleDifferenceRepaintLayer; |
| 611 | 606 |
| 612 if (RuntimeEnabledFeatures::cssCompositingEnabled() && (rareNonInheritedData
->m_effectiveBlendMode != other.rareNonInheritedData->m_effectiveBlendMode | 607 if (RuntimeEnabledFeatures::cssCompositingEnabled() && (rareNonInheritedData
->m_effectiveBlendMode != other.rareNonInheritedData->m_effectiveBlendMode |
| 613 || rareNonInheritedData->m_isolation != other.rareNonInheritedData->m_is
olation)) | 608 || rareNonInheritedData->m_isolation != other.rareNonInheritedData->m_is
olation)) |
| 614 return StyleDifferenceRepaintLayer; | 609 return StyleDifferenceRepaintLayer; |
| 615 | 610 |
| 616 if (rareNonInheritedData->opacity != other.rareNonInheritedData->opacity) { | 611 if (rareNonInheritedData->opacity != other.rareNonInheritedData->opacity) { |
| (...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1647 // right | 1642 // right |
| 1648 radiiSum = radii.topRight().height() + radii.bottomRight().height(); | 1643 radiiSum = radii.topRight().height() + radii.bottomRight().height(); |
| 1649 if (radiiSum > rect.height()) | 1644 if (radiiSum > rect.height()) |
| 1650 factor = std::min(rect.height() / radiiSum, factor); | 1645 factor = std::min(rect.height() / radiiSum, factor); |
| 1651 | 1646 |
| 1652 ASSERT(factor <= 1); | 1647 ASSERT(factor <= 1); |
| 1653 return factor; | 1648 return factor; |
| 1654 } | 1649 } |
| 1655 | 1650 |
| 1656 } // namespace WebCore | 1651 } // namespace WebCore |
| OLD | NEW |