Diff
Modified: trunk/Source/WebCore/ChangeLog (159037 => 159038)
--- trunk/Source/WebCore/ChangeLog 2013-11-11 04:58:46 UTC (rev 159037)
+++ trunk/Source/WebCore/ChangeLog 2013-11-11 06:20:36 UTC (rev 159038)
@@ -1,3 +1,16 @@
+2013-11-10 Andreas Kling <[email protected]>
+
+ Shrink RenderInline.
+ <https://webkit.org/b/124134>
+
+ Move the "always create line boxes" bit from RenderInline up to
+ RenderElement. I didn't do this earlier because there were no bits
+ free on RenderObject but thanks to RenderElement we now have tons!
+
+ 540 kB progression on HTML5 spec at <http://whatwg.org/c>
+
+ Reviewed by Anders Carlsson.
+
2013-11-10 Sam Weinig <[email protected]>
Make childShouldCreateRenderer() take a Node reference
Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (159037 => 159038)
--- trunk/Source/WebCore/rendering/RenderElement.cpp 2013-11-11 04:58:46 UTC (rev 159037)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp 2013-11-11 06:20:36 UTC (rev 159038)
@@ -71,6 +71,7 @@
, m_baseTypeFlags(baseTypeFlags)
, m_ancestorLineBoxDirty(false)
, m_hasInitializedStyle(false)
+ , m_renderInlineAlwaysCreatesLineBoxes(false)
, m_firstChild(nullptr)
, m_lastChild(nullptr)
, m_style(std::move(style))
@@ -82,6 +83,7 @@
, m_baseTypeFlags(baseTypeFlags)
, m_ancestorLineBoxDirty(false)
, m_hasInitializedStyle(false)
+ , m_renderInlineAlwaysCreatesLineBoxes(false)
, m_firstChild(nullptr)
, m_lastChild(nullptr)
, m_style(std::move(style))
Modified: trunk/Source/WebCore/rendering/RenderElement.h (159037 => 159038)
--- trunk/Source/WebCore/rendering/RenderElement.h 2013-11-11 04:58:46 UTC (rev 159037)
+++ trunk/Source/WebCore/rendering/RenderElement.h 2013-11-11 06:20:36 UTC (rev 159038)
@@ -141,6 +141,9 @@
virtual void willBeRemovedFromTree() OVERRIDE;
virtual void willBeDestroyed() OVERRIDE;
+ void setRenderInlineAlwaysCreatesLineBoxes(bool b) { m_renderInlineAlwaysCreatesLineBoxes = b; }
+ bool renderInlineAlwaysCreatesLineBoxes() const { return m_renderInlineAlwaysCreatesLineBoxes; }
+
private:
void node() const WTF_DELETED_FUNCTION;
void nonPseudoNode() const WTF_DELETED_FUNCTION;
@@ -167,6 +170,9 @@
bool m_ancestorLineBoxDirty : 1;
bool m_hasInitializedStyle : 1;
+ // Specific to RenderInline.
+ bool m_renderInlineAlwaysCreatesLineBoxes : 1;
+
RenderObject* m_firstChild;
RenderObject* m_lastChild;
Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (159037 => 159038)
--- trunk/Source/WebCore/rendering/RenderInline.cpp 2013-11-11 04:58:46 UTC (rev 159037)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp 2013-11-11 06:20:36 UTC (rev 159038)
@@ -51,14 +51,12 @@
RenderInline::RenderInline(Element& element, PassRef<RenderStyle> style)
: RenderBoxModelObject(element, std::move(style), RenderInlineFlag)
- , m_alwaysCreateLineBoxes(false)
{
setChildrenInline(true);
}
RenderInline::RenderInline(Document& document, PassRef<RenderStyle> style)
: RenderBoxModelObject(document, std::move(style), RenderInlineFlag)
- , m_alwaysCreateLineBoxes(false)
{
setChildrenInline(true);
}
@@ -192,13 +190,13 @@
updateStyleOfAnonymousBlockContinuations(toRenderBlock(block), &newStyle, oldStyle);
}
- if (!m_alwaysCreateLineBoxes) {
+ if (!alwaysCreateLineBoxes()) {
bool alwaysCreateLineBoxes = hasSelfPaintingLayer() || hasBoxDecorations() || newStyle.hasPadding() || newStyle.hasMargin() || hasOutline();
if (oldStyle && alwaysCreateLineBoxes) {
dirtyLineBoxes(false);
setNeedsLayout();
}
- m_alwaysCreateLineBoxes = alwaysCreateLineBoxes;
+ setRenderInlineAlwaysCreatesLineBoxes(alwaysCreateLineBoxes);
}
}
@@ -206,7 +204,7 @@
{
// Once we have been tainted once, just assume it will happen again. This way effects like hover highlighting that change the
// background color will only cause a layout on the first rollover.
- if (m_alwaysCreateLineBoxes)
+ if (alwaysCreateLineBoxes())
return;
RenderStyle* parentStyle = &parent()->style();
@@ -233,7 +231,7 @@
if (alwaysCreateLineBoxes) {
if (!fullLayout)
dirtyLineBoxes(false);
- m_alwaysCreateLineBoxes = true;
+ setAlwaysCreateLineBoxes();
}
}
Modified: trunk/Source/WebCore/rendering/RenderInline.h (159037 => 159038)
--- trunk/Source/WebCore/rendering/RenderInline.h 2013-11-11 04:58:46 UTC (rev 159037)
+++ trunk/Source/WebCore/rendering/RenderInline.h 2013-11-11 06:20:36 UTC (rev 159038)
@@ -81,8 +81,8 @@
using RenderBoxModelObject::continuation;
using RenderBoxModelObject::setContinuation;
- bool alwaysCreateLineBoxes() const { return m_alwaysCreateLineBoxes; }
- void setAlwaysCreateLineBoxes() { m_alwaysCreateLineBoxes = true; }
+ bool alwaysCreateLineBoxes() const { return renderInlineAlwaysCreatesLineBoxes(); }
+ void setAlwaysCreateLineBoxes() { setRenderInlineAlwaysCreatesLineBoxes(true); }
void updateAlwaysCreateLineBoxes(bool fullLayout);
virtual LayoutRect localCaretRect(InlineBox*, int, LayoutUnit* extraWidthToEndOfLine) OVERRIDE FINAL;
@@ -172,8 +172,6 @@
RenderBoxModelObject* continuationBefore(RenderObject* beforeChild);
RenderLineBoxList m_lineBoxes; // All of the line boxes created for this inline flow. For example, <i>Hello<br>world.</i> will have two <i> line boxes.
-
- bool m_alwaysCreateLineBoxes : 1;
};
RENDER_OBJECT_TYPE_CASTS(RenderInline, isRenderInline())