| 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 | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights |
| 4 * reserved. | 4 * reserved. |
| 5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 diff.setNeedsFullLayout(); | 549 diff.setNeedsFullLayout(); |
| 550 else | 550 else |
| 551 diff.setNeedsPositionedMovementLayout(); | 551 diff.setNeedsPositionedMovementLayout(); |
| 552 } | 552 } |
| 553 | 553 |
| 554 if (diffNeedsPaintInvalidationSubtree(other)) | 554 if (diffNeedsPaintInvalidationSubtree(other)) |
| 555 diff.setNeedsPaintInvalidationSubtree(); | 555 diff.setNeedsPaintInvalidationSubtree(); |
| 556 else if (diffNeedsPaintInvalidationObject(other)) | 556 else if (diffNeedsPaintInvalidationObject(other)) |
| 557 diff.setNeedsPaintInvalidationObject(); | 557 diff.setNeedsPaintInvalidationObject(); |
| 558 | 558 |
| 559 if (diffNeedsVisualRectUpdate(other)) |
| 560 diff.setNeedsVisualRectUpdate(); |
| 561 |
| 559 updatePropertySpecificDifferences(other, diff); | 562 updatePropertySpecificDifferences(other, diff); |
| 560 | 563 |
| 561 // The following condition needs to be at last, because it may depend on | 564 // The following condition needs to be at last, because it may depend on |
| 562 // conditions in diff computed above. | 565 // conditions in diff computed above. |
| 563 if (scrollAnchorDisablingPropertyChanged(other, diff)) | 566 if (scrollAnchorDisablingPropertyChanged(other, diff)) |
| 564 diff.setScrollAnchorDisablingPropertyChanged(); | 567 diff.setScrollAnchorDisablingPropertyChanged(); |
| 565 | 568 |
| 566 // Cursors are not checked, since they will be set appropriately in response | 569 // Cursors are not checked, since they will be set appropriately in response |
| 567 // to mouse events, so they don't need to cause any paint invalidation or | 570 // to mouse events, so they don't need to cause any paint invalidation or |
| 568 // layout. | 571 // layout. |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 990 for (const AtomicString& property : | 993 for (const AtomicString& property : |
| 991 *value->customInvalidationProperties()) { | 994 *value->customInvalidationProperties()) { |
| 992 if (!dataEquivalent(getVariable(property), other.getVariable(property))) | 995 if (!dataEquivalent(getVariable(property), other.getVariable(property))) |
| 993 return true; | 996 return true; |
| 994 } | 997 } |
| 995 } | 998 } |
| 996 | 999 |
| 997 return false; | 1000 return false; |
| 998 } | 1001 } |
| 999 | 1002 |
| 1003 // This doesn't include conditions needing layout or overflow recomputation |
| 1004 // which implies visual rect update. |
| 1005 bool ComputedStyle::diffNeedsVisualRectUpdate( |
| 1006 const ComputedStyle& other) const { |
| 1007 // Visual rect is empty if visibility is hidden. |
| 1008 if (visibility() != other.visibility()) |
| 1009 return true; |
| 1010 |
| 1011 // Need to update visual rect of the resizer. |
| 1012 if (resize() != other.resize()) |
| 1013 return true; |
| 1014 |
| 1015 return false; |
| 1016 } |
| 1017 |
| 1000 void ComputedStyle::updatePropertySpecificDifferences( | 1018 void ComputedStyle::updatePropertySpecificDifferences( |
| 1001 const ComputedStyle& other, | 1019 const ComputedStyle& other, |
| 1002 StyleDifference& diff) const { | 1020 StyleDifference& diff) const { |
| 1003 if (m_box->zIndex() != other.m_box->zIndex() || | 1021 if (m_box->zIndex() != other.m_box->zIndex() || |
| 1004 isStackingContext() != other.isStackingContext()) | 1022 isStackingContext() != other.isStackingContext()) |
| 1005 diff.setZIndexChanged(); | 1023 diff.setZIndexChanged(); |
| 1006 | 1024 |
| 1007 if (m_rareNonInheritedData.get() != other.m_rareNonInheritedData.get()) { | 1025 if (m_rareNonInheritedData.get() != other.m_rareNonInheritedData.get()) { |
| 1008 // It's possible for the old and new style transform data to be equivalent | 1026 // It's possible for the old and new style transform data to be equivalent |
| 1009 // while hasTransform() differs, as it checks a number of conditions aside | 1027 // while hasTransform() differs, as it checks a number of conditions aside |
| (...skipping 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2477 if (value < 0) | 2495 if (value < 0) |
| 2478 fvalue -= 0.5f; | 2496 fvalue -= 0.5f; |
| 2479 else | 2497 else |
| 2480 fvalue += 0.5f; | 2498 fvalue += 0.5f; |
| 2481 } | 2499 } |
| 2482 | 2500 |
| 2483 return roundForImpreciseConversion<int>(fvalue / zoomFactor); | 2501 return roundForImpreciseConversion<int>(fvalue / zoomFactor); |
| 2484 } | 2502 } |
| 2485 | 2503 |
| 2486 } // namespace blink | 2504 } // namespace blink |
| OLD | NEW |