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