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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
348 | 348 |
349 bool RenderStyle::inheritedDataShared(const RenderStyle* other) const | 349 bool RenderStyle::inheritedDataShared(const RenderStyle* other) const |
350 { | 350 { |
351 // This is a fast check that only looks if the data structures are shared. | 351 // This is a fast check that only looks if the data structures are shared. |
352 return inherited_flags == other->inherited_flags | 352 return inherited_flags == other->inherited_flags |
353 && inherited.get() == other->inherited.get() | 353 && inherited.get() == other->inherited.get() |
354 && m_svgStyle.get() == other->m_svgStyle.get() | 354 && m_svgStyle.get() == other->m_svgStyle.get() |
355 && rareInheritedData.get() == other->rareInheritedData.get(); | 355 && rareInheritedData.get() == other->rareInheritedData.get(); |
356 } | 356 } |
357 | 357 |
358 static bool dependenceOnContentHeightHasChanged(const LengthBox& a, const Length Box& b) | |
359 { | |
360 // If top or bottom become auto/non-auto then it means we either have to sol ve height based | |
361 // on the content or stop doing so (http://www.w3.org/TR/CSS2/visudet.html#a bs-non-replaced-height) | |
362 // - either way requires a layout. | |
363 if (a.top().isAuto() != b.top().isAuto() || a.bottom().isAuto() != b.bottom( ).isAuto()) | |
mstensho (USE GERRIT)
2015/02/02 10:00:47
Just "return blablabla", instead of "if (blablabla
rhogan
2015/02/02 19:22:49
We would still need to resolve top/bottom in compu
| |
364 return true; | |
365 return false; | |
366 } | |
367 | |
358 StyleDifference RenderStyle::visualInvalidationDiff(const RenderStyle& other) co nst | 368 StyleDifference RenderStyle::visualInvalidationDiff(const RenderStyle& other) co nst |
359 { | 369 { |
360 // Note, we use .get() on each DataRef below because DataRef::operator== wil l do a deep | 370 // Note, we use .get() on each DataRef below because DataRef::operator== wil l do a deep |
361 // compare, which is duplicate work when we're going to compare each propert y inside | 371 // compare, which is duplicate work when we're going to compare each propert y inside |
362 // this function anyway. | 372 // this function anyway. |
363 | 373 |
364 StyleDifference diff; | 374 StyleDifference diff; |
365 if (m_svgStyle.get() != other.m_svgStyle.get()) | 375 if (m_svgStyle.get() != other.m_svgStyle.get()) |
366 diff = m_svgStyle->diff(other.m_svgStyle.get()); | 376 diff = m_svgStyle->diff(other.m_svgStyle.get()); |
367 | 377 |
368 if ((!diff.needsFullLayout() || !diff.needsPaintInvalidation()) && diffNeeds FullLayoutAndPaintInvalidation(other)) { | 378 if ((!diff.needsFullLayout() || !diff.needsPaintInvalidation()) && diffNeeds FullLayoutAndPaintInvalidation(other)) { |
369 diff.setNeedsFullLayout(); | 379 diff.setNeedsFullLayout(); |
370 diff.setNeedsPaintInvalidationObject(); | 380 diff.setNeedsPaintInvalidationObject(); |
371 } | 381 } |
372 | 382 |
373 if (!diff.needsFullLayout() && diffNeedsFullLayout(other)) | 383 if (!diff.needsFullLayout() && diffNeedsFullLayout(other)) |
374 diff.setNeedsFullLayout(); | 384 diff.setNeedsFullLayout(); |
375 | 385 |
376 if (!diff.needsFullLayout() && surround->margin != other.surround->margin) { | 386 if (!diff.needsFullLayout() && surround->margin != other.surround->margin) { |
377 // Relative-positioned elements collapse their margins so need a full la yout. | 387 // Relative-positioned elements collapse their margins so need a full la yout. |
378 if (position() == AbsolutePosition || position() == FixedPosition) | 388 if (position() == AbsolutePosition || position() == FixedPosition) |
379 diff.setNeedsPositionedMovementLayout(); | 389 diff.setNeedsPositionedMovementLayout(); |
380 else | 390 else |
381 diff.setNeedsFullLayout(); | 391 diff.setNeedsFullLayout(); |
382 } | 392 } |
383 | 393 |
384 if (!diff.needsFullLayout() && position() != StaticPosition && surround->off set != other.surround->offset) { | 394 if (!diff.needsFullLayout() && position() != StaticPosition && surround->off set != other.surround->offset) { |
385 // Optimize for the case where a positioned layer is moving but not chan ging size. | 395 // Optimize for the case where a positioned layer is moving but not chan ging size. |
386 diff.setNeedsPositionedMovementLayout(); | 396 if (dependenceOnContentHeightHasChanged(surround->offset, other.surround ->offset)) |
397 diff.setNeedsFullLayout(); | |
398 else | |
399 diff.setNeedsPositionedMovementLayout(); | |
387 } | 400 } |
388 | 401 |
389 if (diffNeedsPaintInvalidationLayer(other)) | 402 if (diffNeedsPaintInvalidationLayer(other)) |
390 diff.setNeedsPaintInvalidationLayer(); | 403 diff.setNeedsPaintInvalidationLayer(); |
391 else if (diffNeedsPaintInvalidationObject(other)) | 404 else if (diffNeedsPaintInvalidationObject(other)) |
392 diff.setNeedsPaintInvalidationObject(); | 405 diff.setNeedsPaintInvalidationObject(); |
393 | 406 |
394 updatePropertySpecificDifferences(other, diff); | 407 updatePropertySpecificDifferences(other, diff); |
395 | 408 |
396 // Cursors are not checked, since they will be set appropriately in response to mouse events, | 409 // Cursors are not checked, since they will be set appropriately in response to mouse events, |
(...skipping 1260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1657 horizontal || includeLogicalRightEdge); | 1670 horizontal || includeLogicalRightEdge); |
1658 | 1671 |
1659 edges[BSLeft] = BorderEdge(borderLeftWidth(), | 1672 edges[BSLeft] = BorderEdge(borderLeftWidth(), |
1660 visitedDependentColor(CSSPropertyBorderLeftColor), | 1673 visitedDependentColor(CSSPropertyBorderLeftColor), |
1661 borderLeftStyle(), | 1674 borderLeftStyle(), |
1662 borderLeftIsTransparent(), | 1675 borderLeftIsTransparent(), |
1663 !horizontal || includeLogicalLeftEdge); | 1676 !horizontal || includeLogicalLeftEdge); |
1664 } | 1677 } |
1665 | 1678 |
1666 } // namespace blink | 1679 } // namespace blink |
OLD | NEW |