Title: [155626] trunk/Source/WebCore
- Revision
- 155626
- Author
- zol...@webkit.org
- Date
- 2013-09-12 09:49:39 -0700 (Thu, 12 Sep 2013)
Log Message
[CSS Shapes] Turn shape's logicalwidth/height into a LayoutSize
https://bugs.webkit.org/show_bug.cgi?id=121187
Reviewed by David Hyatt.
No new tests, no behavior change.
* rendering/shapes/ShapeInfo.cpp:
(WebCore::::computedShape):
* rendering/shapes/ShapeInfo.h:
(WebCore::ShapeInfo::setShapeSize):
(WebCore::ShapeInfo::shapeContainingBlockHeight):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (155625 => 155626)
--- trunk/Source/WebCore/ChangeLog 2013-09-12 16:47:45 UTC (rev 155625)
+++ trunk/Source/WebCore/ChangeLog 2013-09-12 16:49:39 UTC (rev 155626)
@@ -1,3 +1,18 @@
+2013-09-12 Zoltan Horvath <zol...@webkit.org>
+
+ [CSS Shapes] Turn shape's logicalwidth/height into a LayoutSize
+ https://bugs.webkit.org/show_bug.cgi?id=121187
+
+ Reviewed by David Hyatt.
+
+ No new tests, no behavior change.
+
+ * rendering/shapes/ShapeInfo.cpp:
+ (WebCore::::computedShape):
+ * rendering/shapes/ShapeInfo.h:
+ (WebCore::ShapeInfo::setShapeSize):
+ (WebCore::ShapeInfo::shapeContainingBlockHeight):
+
2013-09-12 Darin Adler <da...@apple.com>
Move layering-violating code from Pasteboard::plainText into Editor (Mac only at first)
Modified: trunk/Source/WebCore/rendering/shapes/ShapeInfo.cpp (155625 => 155626)
--- trunk/Source/WebCore/rendering/shapes/ShapeInfo.cpp 2013-09-12 16:47:45 UTC (rev 155625)
+++ trunk/Source/WebCore/rendering/shapes/ShapeInfo.cpp 2013-09-12 16:49:39 UTC (rev 155626)
@@ -45,7 +45,6 @@
if (Shape* shape = m_shape.get())
return shape;
- const LayoutSize logicalBoxSize(m_shapeLogicalWidth, m_shapeLogicalHeight);
WritingMode writingMode = m_renderer->style()->writingMode();
Length margin = m_renderer->style()->shapeMargin();
Length padding = m_renderer->style()->shapePadding();
@@ -55,11 +54,11 @@
switch (shapeValue->type()) {
case ShapeValue::Shape:
ASSERT(shapeValue->shape());
- m_shape = Shape::createShape(shapeValue->shape(), logicalBoxSize, writingMode, margin, padding);
+ m_shape = Shape::createShape(shapeValue->shape(), m_shapeLogicalSize, writingMode, margin, padding);
break;
case ShapeValue::Image:
ASSERT(shapeValue->image());
- m_shape = Shape::createShape(shapeValue->image(), 0, logicalBoxSize, writingMode, margin, padding);
+ m_shape = Shape::createShape(shapeValue->image(), 0, m_shapeLogicalSize, writingMode, margin, padding);
break;
default:
ASSERT_NOT_REACHED();
Modified: trunk/Source/WebCore/rendering/shapes/ShapeInfo.h (155625 => 155626)
--- trunk/Source/WebCore/rendering/shapes/ShapeInfo.h 2013-09-12 16:47:45 UTC (rev 155625)
+++ trunk/Source/WebCore/rendering/shapes/ShapeInfo.h 2013-09-12 16:49:39 UTC (rev 155626)
@@ -72,16 +72,15 @@
void setShapeSize(LayoutUnit logicalWidth, LayoutUnit logicalHeight)
{
- if (m_renderer->style()->boxSizing() == CONTENT_BOX) {
- logicalWidth -= m_renderer->borderAndPaddingLogicalWidth();
- logicalHeight -= m_renderer->borderAndPaddingLogicalHeight();
- }
+ LayoutSize newLogicalSize(logicalWidth, logicalHeight);
- if (m_shapeLogicalWidth == logicalWidth && m_shapeLogicalHeight == logicalHeight)
+ if (m_renderer->style()->boxSizing() == CONTENT_BOX)
+ newLogicalSize -= LayoutSize(m_renderer->borderAndPaddingLogicalWidth(), m_renderer->borderAndPaddingLogicalHeight());
+
+ if (m_shapeLogicalSize == newLogicalSize)
return;
dirtyShapeSize();
- m_shapeLogicalWidth = logicalWidth;
- m_shapeLogicalHeight = logicalHeight;
+ m_shapeLogicalSize = newLogicalSize;
}
virtual bool computeSegmentsForLine(LayoutUnit lineTop, LayoutUnit lineHeight);
@@ -97,7 +96,7 @@
LayoutUnit logicalLineTop() const { return m_shapeLineTop + logicalTopOffset(); }
LayoutUnit logicalLineBottom() const { return m_shapeLineTop + m_lineHeight + logicalTopOffset(); }
- LayoutUnit shapeContainingBlockHeight() const { return (m_renderer->style()->boxSizing() == CONTENT_BOX) ? (m_shapeLogicalHeight + m_renderer->borderAndPaddingLogicalHeight()) : m_shapeLogicalHeight; }
+ LayoutUnit shapeContainingBlockHeight() const { return (m_renderer->style()->boxSizing() == CONTENT_BOX) ? (m_shapeLogicalSize.height() + m_renderer->borderAndPaddingLogicalHeight()) : m_shapeLogicalSize.height(); }
bool lineOverlapsShapeBounds() const { return logicalLineTop() < shapeLogicalBottom() && shapeLogicalTop() <= logicalLineBottom(); }
@@ -122,9 +121,7 @@
private:
mutable OwnPtr<Shape> m_shape;
-
- LayoutUnit m_shapeLogicalWidth;
- LayoutUnit m_shapeLogicalHeight;
+ LayoutSize m_shapeLogicalSize;
};
}
#endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes