Add InlineElementBox and stop instantiating InlineBox directly.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Nov 2013 10:26:56 +0000 (10:26 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Nov 2013 10:26:56 +0000 (10:26 +0000)
<https://webkit.org/b/123882>

Make the InlineBox constructors protected and add a new class
called InlineElementBox on top. This is somewhat analogous to the
split between RenderText and RenderElement, and allows us to make
renderer() return a far tighter RenderBoxModelObject& instead
of a RenderObject&.

Moved over attachLine(), deleteLine() and extractLine() to start
things off. More things will follow.

Reviewed by Antti Koivisto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158736 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/rendering/EllipsisBox.cpp
Source/WebCore/rendering/EllipsisBox.h
Source/WebCore/rendering/InlineBox.cpp
Source/WebCore/rendering/InlineBox.h
Source/WebCore/rendering/InlineElementBox.cpp [new file with mode: 0644]
Source/WebCore/rendering/InlineElementBox.h [new file with mode: 0644]
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderLineBreak.cpp

index 1d5e937..bb6b69d 100644 (file)
@@ -2081,6 +2081,7 @@ set(WebCore_SOURCES
     rendering/HitTestingTransformState.cpp
     rendering/ImageQualityController.cpp
     rendering/InlineBox.cpp
+    rendering/InlineElementBox.cpp
     rendering/InlineFlowBox.cpp
     rendering/InlineTextBox.cpp
     rendering/LayoutRepainter.cpp
index 948940b..afd2a26 100644 (file)
@@ -1,3 +1,19 @@
+2013-11-06  Andreas Kling  <akling@apple.com>
+
+        Add InlineElementBox and stop instantiating InlineBox directly.
+        <https://webkit.org/b/123882>
+
+        Make the InlineBox constructors protected and add a new class
+        called InlineElementBox on top. This is somewhat analogous to the
+        split between RenderText and RenderElement, and allows us to make
+        renderer() return a far tighter RenderBoxModelObject& instead
+        of a RenderObject&.
+
+        Moved over attachLine(), deleteLine() and extractLine() to start
+        things off. More things will follow.
+
+        Reviewed by Antti Koivisto.
+
 2013-11-06  Piotr Grad  <p.grad@samsung.com>
 
         Seek for video doesn't work when playback rate is negative
index daed00e..bbd8997 100644 (file)
@@ -4278,6 +4278,8 @@ webcore_sources += \
        Source/WebCore/rendering/ImageQualityController.h \
        Source/WebCore/rendering/InlineBox.cpp \
        Source/WebCore/rendering/InlineBox.h \
+       Source/WebCore/rendering/InlineElementBox.cpp \
+       Source/WebCore/rendering/InlineElementBox.h \
        Source/WebCore/rendering/InlineFlowBox.cpp \
        Source/WebCore/rendering/InlineFlowBox.h \
        Source/WebCore/rendering/InlineIterator.h \
index 295bb00..a5b8ac5 100644 (file)
@@ -1323,8 +1323,6 @@ __ZN7WebCore9HTMLNames9scriptTagE
 __ZN7WebCore9HTMLNames9selectTagE
 __ZN7WebCore9HTMLNames9styleAttrE
 __ZN7WebCore9HTMLNames9valueAttrE
-__ZN7WebCore9InlineBox10attachLineEv
-__ZN7WebCore9InlineBox11extractLineEv
 __ZN7WebCore9InlineBox11nodeAtPointERKNS_14HitTestRequestERNS_13HitTestResultERKNS_15HitTestLocationERKNS_11LayoutPointENS_10LayoutUnitESC_
 __ZN7WebCore9InlineBox14adjustPositionEff
 __ZN7WebCore9InlineBox14dirtyLineBoxesEv
index cf3abc2..09ce090 100644 (file)
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
     </ClCompile>
+    <ClCompile Include="..\rendering\InlineElementBox.cpp">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
+    </ClCompile>
     <ClCompile Include="..\rendering\InlineFlowBox.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
     <ClInclude Include="..\rendering\HitTestResult.h" />
     <ClInclude Include="..\rendering\ImageQualityController.h" />
     <ClInclude Include="..\rendering\InlineBox.h" />
+    <ClInclude Include="..\rendering\InlineElementBox.h" />
     <ClInclude Include="..\rendering\InlineFlowBox.h" />
     <ClInclude Include="..\rendering\InlineIterator.h" />
     <ClInclude Include="..\rendering\InlineTextBox.h" />
index 106ba82..5533489 100644 (file)
     <ClCompile Include="..\rendering\InlineBox.cpp">
       <Filter>rendering</Filter>
     </ClCompile>
+    <ClCompile Include="..\rendering\InlineElementBox.cpp">
+      <Filter>rendering</Filter>
+    </ClCompile>
     <ClCompile Include="..\rendering\InlineFlowBox.cpp">
       <Filter>rendering</Filter>
     </ClCompile>
     <ClInclude Include="..\rendering\InlineBox.h">
       <Filter>rendering</Filter>
     </ClInclude>
+    <ClInclude Include="..\rendering\InlineElementBox.h">
+      <Filter>rendering</Filter>
+    </ClInclude>
     <ClInclude Include="..\rendering\InlineFlowBox.h">
       <Filter>rendering</Filter>
     </ClInclude>
index 33674d3..8b795e1 100644 (file)
                B562DB6117D3CD660010AF96 /* SVGElementTypeHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = B562DB5F17D3CD560010AF96 /* SVGElementTypeHelpers.h */; settings = {ATTRIBUTES = (Private, ); }; };
                B56576E817DA94E200A56BDC /* DOMConstructorWithDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = B56576E717DA94E200A56BDC /* DOMConstructorWithDocument.h */; };
                B56579B51824D12A00E79F23 /* RenderChildIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = B56579B41824D12A00E79F23 /* RenderChildIterator.h */; };
+               B57CB52D182A3EED0079A647 /* InlineElementBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B57CB52C182A3EED0079A647 /* InlineElementBox.cpp */; };
+               B57CB52E182A3EFC0079A647 /* InlineElementBox.h in Headers */ = {isa = PBXBuildFile; fileRef = B57CB52B182A37F60079A647 /* InlineElementBox.h */; };
                B58CEB6911913607002A6790 /* JSDatabaseSync.h in Headers */ = {isa = PBXBuildFile; fileRef = B58CEB6711913607002A6790 /* JSDatabaseSync.h */; };
                B58CEB6A11913607002A6790 /* JSDatabaseSync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B58CEB6811913607002A6790 /* JSDatabaseSync.cpp */; };
                B58CEB6D1191361C002A6790 /* JSSQLTransactionSync.h in Headers */ = {isa = PBXBuildFile; fileRef = B58CEB6B1191361C002A6790 /* JSSQLTransactionSync.h */; };
                B56576E417DA599F00A56BDC /* JSMainThreadExecStateInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMainThreadExecStateInstrumentation.h; sourceTree = "<group>"; };
                B56576E717DA94E200A56BDC /* DOMConstructorWithDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMConstructorWithDocument.h; sourceTree = "<group>"; };
                B56579B41824D12A00E79F23 /* RenderChildIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderChildIterator.h; sourceTree = "<group>"; };
+               B57CB52B182A37F60079A647 /* InlineElementBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineElementBox.h; sourceTree = "<group>"; };
+               B57CB52C182A3EED0079A647 /* InlineElementBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InlineElementBox.cpp; sourceTree = "<group>"; };
                B58CEB6711913607002A6790 /* JSDatabaseSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDatabaseSync.h; sourceTree = "<group>"; };
                B58CEB6811913607002A6790 /* JSDatabaseSync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDatabaseSync.cpp; sourceTree = "<group>"; };
                B58CEB6B1191361C002A6790 /* JSSQLTransactionSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLTransactionSync.h; sourceTree = "<group>"; };
                                B51A2F3E17D7D3A40072517A /* ImageQualityController.h */,
                                A8CFF5DF0A155A05000A4234 /* InlineBox.cpp */,
                                A8CFF5DE0A155A05000A4234 /* InlineBox.h */,
+                               B57CB52C182A3EED0079A647 /* InlineElementBox.cpp */,
+                               B57CB52B182A37F60079A647 /* InlineElementBox.h */,
                                A8CFF5DD0A155A05000A4234 /* InlineFlowBox.cpp */,
                                A8CFF5DC0A155A05000A4234 /* InlineFlowBox.h */,
                                BCE789151120D6080060ECE5 /* InlineIterator.h */,
                                B2227A970D00BF220071B782 /* SVGPreserveAspectRatio.h in Headers */,
                                088A0E0A126EF1DB00978F7A /* SVGProperty.h in Headers */,
                                081DD49C13BA1A6000DC7627 /* SVGPropertyInfo.h in Headers */,
+                               B57CB52E182A3EFC0079A647 /* InlineElementBox.h in Headers */,
                                088A0E0B126EF1DB00978F7A /* SVGPropertyTearOff.h in Headers */,
                                088A0E0C126EF1DB00978F7A /* SVGPropertyTraits.h in Headers */,
                                B2227A9A0D00BF220071B782 /* SVGRadialGradientElement.h in Headers */,
                                F5973DE115CFB2030027F804 /* LocaleMac.mm in Sources */,
                                7633A72713D8B33A008501B6 /* LocaleToScriptMappingDefault.cpp in Sources */,
                                C046E1AC1208A9FE00BA2CF7 /* LocalizedStrings.cpp in Sources */,
+                               B57CB52D182A3EED0079A647 /* InlineElementBox.cpp in Sources */,
                                BC25B52A131C6D3900180E10 /* LocalizedStringsMac.cpp in Sources */,
                                BCE1C41C0D982981003B02F2 /* Location.cpp in Sources */,
                                078E090817D14CEE00420AA1 /* RTCDTMFToneChangeEvent.cpp in Sources */,
index 4e34317..b9ce00a 100644 (file)
@@ -32,7 +32,7 @@
 namespace WebCore {
 
 EllipsisBox::EllipsisBox(RenderBlockFlow& renderer, const AtomicString& ellipsisStr, InlineFlowBox* parent, int width, int height, int y, bool firstLine, bool isVertical, InlineBox* markupBox)
-    : InlineBox(renderer, FloatPoint(0, y), width, firstLine, true, false, false, isVertical, 0, 0, parent)
+    : InlineElementBox(renderer, FloatPoint(0, y), width, firstLine, true, false, false, isVertical, 0, 0, parent)
     , m_shouldPaintMarkupBox(markupBox)
     , m_height(height)
     , m_str(ellipsisStr)
index 8fc5ef4..70bf90b 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef EllipsisBox_h
 #define EllipsisBox_h
 
-#include "InlineBox.h"
+#include "InlineElementBox.h"
 #include "RenderBlockFlow.h"
 
 namespace WebCore {
@@ -28,7 +28,7 @@ namespace WebCore {
 class HitTestRequest;
 class HitTestResult;
 
-class EllipsisBox FINAL : public InlineBox {
+class EllipsisBox FINAL : public InlineElementBox {
 public:
     EllipsisBox(RenderBlockFlow&, const AtomicString& ellipsisStr, InlineFlowBox* parent, int width, int height, int y, bool firstLine, bool isVertical, InlineBox* markupBox);
     virtual void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom);
index e1f18de..164060a 100644 (file)
@@ -156,35 +156,6 @@ void InlineBox::dirtyLineBoxes()
         curr->markDirty();
 }
 
-void InlineBox::deleteLine()
-{
-    if (!m_bitfields.extracted()) {
-        if (m_renderer.isBox())
-            toRenderBox(renderer()).setInlineBoxWrapper(0);
-        else if (renderer().isLineBreak())
-            toRenderLineBreak(renderer()).setInlineBoxWrapper(0);
-    }
-    delete this;
-}
-
-void InlineBox::extractLine()
-{
-    m_bitfields.setExtracted(true);
-    if (m_renderer.isBox())
-        toRenderBox(renderer()).setInlineBoxWrapper(0);
-    else if (renderer().isLineBreak())
-        toRenderLineBreak(renderer()).setInlineBoxWrapper(0);
-}
-
-void InlineBox::attachLine()
-{
-    m_bitfields.setExtracted(false);
-    if (m_renderer.isBox())
-        toRenderBox(renderer()).setInlineBoxWrapper(this);
-    else if (renderer().isLineBreak())
-        toRenderLineBreak(renderer()).setInlineBoxWrapper(this);
-}
-
 void InlineBox::adjustPosition(float dx, float dy)
 {
     m_topLeft.move(dx, dy);
index 04d2b2e..58bf629 100644 (file)
@@ -34,38 +34,11 @@ class RootInlineBox;
 // some RenderObject (i.e., it represents a portion of that RenderObject).
 class InlineBox {
 public:
-    explicit InlineBox(RenderObject& renderer)
-        : m_next(0)
-        , m_prev(0)
-        , m_parent(0)
-        , m_renderer(renderer)
-        , m_logicalWidth(0)
-#if !ASSERT_DISABLED
-        , m_hasBadParent(false)
-#endif
-    {
-    }
-
-    InlineBox(RenderObject& renderer, FloatPoint topLeft, float logicalWidth, bool firstLine, bool constructed,
-              bool dirty, bool extracted, bool isHorizontal, InlineBox* next, InlineBox* prev, InlineFlowBox* parent)
-        : m_next(next)
-        , m_prev(prev)
-        , m_parent(parent)
-        , m_renderer(renderer)
-        , m_topLeft(topLeft)
-        , m_logicalWidth(logicalWidth)
-        , m_bitfields(firstLine, constructed, dirty, extracted, isHorizontal)
-#if !ASSERT_DISABLED
-        , m_hasBadParent(false)
-#endif
-    {
-    }
-
     virtual ~InlineBox();
 
-    virtual void deleteLine();
-    virtual void extractLine();
-    virtual void attachLine();
+    virtual void deleteLine() = 0;
+    virtual void extractLine() = 0;
+    virtual void attachLine() = 0;
 
     virtual bool isLineBreak() const { return renderer().isLineBreak(); }
 
@@ -169,7 +142,7 @@ public:
     InlineBox* nextLeafChildIgnoringLineBreak() const;
     InlineBox* prevLeafChildIgnoringLineBreak() const;
 
-    // FIXME: There should be a subclass that returns RenderElement. Plain InlineBox shouldn't be instantiated.
+    // FIXME: Hide this once all callers are using tighter types.
     RenderObject& renderer() const { return m_renderer; }
 
     InlineFlowBox* parent() const
@@ -387,6 +360,33 @@ private:
     InlineBoxBitfields m_bitfields;
 
 protected:
+    explicit InlineBox(RenderObject& renderer)
+        : m_next(nullptr)
+        , m_prev(nullptr)
+        , m_parent(nullptr)
+        , m_renderer(renderer)
+        , m_logicalWidth(0)
+#if !ASSERT_DISABLED
+        , m_hasBadParent(false)
+#endif
+    {
+    }
+
+    InlineBox(RenderObject& renderer, FloatPoint topLeft, float logicalWidth, bool firstLine, bool constructed,
+              bool dirty, bool extracted, bool isHorizontal, InlineBox* next, InlineBox* prev, InlineFlowBox* parent)
+        : m_next(next)
+        , m_prev(prev)
+        , m_parent(parent)
+        , m_renderer(renderer)
+        , m_topLeft(topLeft)
+        , m_logicalWidth(logicalWidth)
+        , m_bitfields(firstLine, constructed, dirty, extracted, isHorizontal)
+#if !ASSERT_DISABLED
+        , m_hasBadParent(false)
+#endif
+    {
+    }
+
     // For RootInlineBox
     bool endsWithBreak() const { return m_bitfields.endsWithBreak(); }
     void setEndsWithBreak(bool endsWithBreak) { m_bitfields.setEndsWithBreak(endsWithBreak); }
diff --git a/Source/WebCore/rendering/InlineElementBox.cpp b/Source/WebCore/rendering/InlineElementBox.cpp
new file mode 100644 (file)
index 0000000..8eb2264
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "InlineElementBox.h"
+
+#include "RenderBox.h"
+#include "RenderLineBreak.h"
+
+namespace WebCore {
+
+void InlineElementBox::deleteLine()
+{
+    if (!extracted()) {
+        if (renderer().isBox())
+            toRenderBox(renderer()).setInlineBoxWrapper(nullptr);
+        else if (renderer().isLineBreak())
+            toRenderLineBreak(renderer()).setInlineBoxWrapper(nullptr);
+    }
+    delete this;
+}
+
+void InlineElementBox::extractLine()
+{
+    setExtracted(true);
+    if (renderer().isBox())
+        toRenderBox(renderer()).setInlineBoxWrapper(nullptr);
+    else if (renderer().isLineBreak())
+        toRenderLineBreak(renderer()).setInlineBoxWrapper(nullptr);
+}
+
+void InlineElementBox::attachLine()
+{
+    setExtracted(false);
+    if (renderer().isBox())
+        toRenderBox(renderer()).setInlineBoxWrapper(this);
+    else if (renderer().isLineBreak())
+        toRenderLineBreak(renderer()).setInlineBoxWrapper(this);
+}
+
+}
\ No newline at end of file
diff --git a/Source/WebCore/rendering/InlineElementBox.h b/Source/WebCore/rendering/InlineElementBox.h
new file mode 100644 (file)
index 0000000..ffde4ab
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef InlineElementBox_h
+#define InlineElementBox_h
+
+#include "InlineBox.h"
+
+namespace WebCore {
+
+class InlineElementBox : public InlineBox {
+public:
+    explicit InlineElementBox(RenderBoxModelObject& renderer)
+        : InlineBox(renderer)
+    {
+    }
+
+    InlineElementBox(RenderObject& renderer, FloatPoint topLeft, float logicalWidth, bool firstLine, bool constructed, bool dirty, bool extracted, bool isHorizontal, InlineBox* next, InlineBox* prev, InlineFlowBox* parent)
+        : InlineBox(renderer, topLeft, logicalWidth, firstLine, constructed, dirty, extracted, isHorizontal, next, prev, parent)
+    {
+    }
+
+    RenderBoxModelObject& renderer() const { return toRenderBoxModelObject(InlineBox::renderer()); }
+
+    virtual void deleteLine() OVERRIDE;
+    virtual void extractLine() OVERRIDE;
+    virtual void attachLine() OVERRIDE;
+};
+
+}
+
+#endif // InlineElementBox_h
index 8d5d9d3..8ba9eae 100644 (file)
@@ -38,6 +38,7 @@
 #include "HTMLNames.h"
 #include "HTMLTextAreaElement.h"
 #include "HitTestResult.h"
+#include "InlineElementBox.h"
 #include "Page.h"
 #include "PaintInfo.h"
 #include "RenderBoxRegionInfo.h"
@@ -1941,7 +1942,7 @@ LayoutSize RenderBox::offsetFromContainer(RenderObject* o, const LayoutPoint& po
 
 std::unique_ptr<InlineBox> RenderBox::createInlineBox()
 {
-    return std::make_unique<InlineBox>(*this);
+    return std::make_unique<InlineElementBox>(*this);
 }
 
 void RenderBox::dirtyLineBoxes(bool fullLayout)
index 49238b5..c2289c9 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "Document.h"
 #include "HTMLElement.h"
+#include "InlineElementBox.h"
 #include "RenderBlock.h"
 #include "RootInlineBox.h"
 #include "VisiblePosition.h"
@@ -69,7 +70,7 @@ int RenderLineBreak::baselinePosition(FontBaseline baselineType, bool firstLine,
 
 std::unique_ptr<InlineBox> RenderLineBreak::createInlineBox()
 {
-    return std::make_unique<InlineBox>(*this);
+    return std::make_unique<InlineElementBox>(*this);
 }
 
 void RenderLineBreak::setInlineBoxWrapper(InlineBox* inlineBox)