Move render ruby initialization logic from RenderElement::createFor() to *::createEle...
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Apr 2015 20:52:47 +0000 (20:52 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Apr 2015 20:52:47 +0000 (20:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=144058

Reviewed by Darin Adler.

No change in functionality.

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLTagNames.in:
* html/RubyElement.cpp: Added.
(WebCore::RubyElement::RubyElement):
(WebCore::RubyElement::create):
(WebCore::RubyElement::createElementRenderer):
* html/RubyElement.h: Added.
* html/RubyTextElement.cpp: Added.
(WebCore::RubyTextElement::RubyTextElement):
(WebCore::RubyTextElement::create):
(WebCore::RubyTextElement::createElementRenderer):
* html/RubyTextElement.h: Added.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::createFor):

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

Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/html/HTMLTagNames.in
Source/WebCore/html/RubyElement.cpp [new file with mode: 0644]
Source/WebCore/html/RubyElement.h [new file with mode: 0644]
Source/WebCore/html/RubyTextElement.cpp [new file with mode: 0644]
Source/WebCore/html/RubyTextElement.h [new file with mode: 0644]
Source/WebCore/rendering/RenderElement.cpp

index 2d56daf..63602d0 100644 (file)
@@ -1688,6 +1688,8 @@ set(WebCore_SOURCES
     html/RangeInputType.cpp
     html/RelList.cpp
     html/ResetInputType.cpp
+    html/RubyElement.cpp
+    html/RubyTextElement.cpp
     html/SearchInputType.cpp
     html/StepRange.cpp
     html/SubmitInputType.cpp
index cc97e29..38be525 100644 (file)
@@ -1,3 +1,30 @@
+2015-04-22  Zalan Bujtas  <zalan@apple.com>
+
+        Move render ruby initialization logic from RenderElement::createFor() to *::createElementRenderer()
+        https://bugs.webkit.org/show_bug.cgi?id=144058
+
+        Reviewed by Darin Adler.
+
+        No change in functionality.
+
+        * CMakeLists.txt:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        * html/HTMLTagNames.in:
+        * html/RubyElement.cpp: Added.
+        (WebCore::RubyElement::RubyElement):
+        (WebCore::RubyElement::create):
+        (WebCore::RubyElement::createElementRenderer):
+        * html/RubyElement.h: Added.
+        * html/RubyTextElement.cpp: Added.
+        (WebCore::RubyTextElement::RubyTextElement):
+        (WebCore::RubyTextElement::create):
+        (WebCore::RubyTextElement::createElementRenderer):
+        * html/RubyTextElement.h: Added.
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::createFor):
+
 2015-04-22  Roger Fong  <roger_fong@apple.com>
 
         Show correct wireless play placard on iOS.
index 4f9fd96..c0b1b5e 100644 (file)
     <ClCompile Include="..\html\RangeInputType.cpp" />
     <ClCompile Include="..\html\RelList.cpp" />
     <ClCompile Include="..\html\ResetInputType.cpp" />
+    <ClCompile Include="..\html\RubyElement.cpp" />
+    <ClCompile Include="..\html\RubyTextElement.cpp" />
     <ClCompile Include="..\html\SearchInputType.cpp" />
     <ClCompile Include="..\html\StepRange.cpp" />
     <ClCompile Include="..\html\SubmitInputType.cpp" />
     <ClInclude Include="..\html\RangeInputType.h" />
     <ClInclude Include="..\html\RelList.h" />
     <ClInclude Include="..\html\ResetInputType.h" />
+    <ClInclude Include="..\html\RubyElement.h" />
+    <ClInclude Include="..\html\RubyTextElement.h" />
     <ClInclude Include="..\html\SearchInputType.h" />
     <ClInclude Include="..\html\StepRange.h" />
     <ClInclude Include="..\html\SubmitInputType.h" />
index 9147401..2a5dd96 100644 (file)
     <ClCompile Include="..\html\ResetInputType.cpp">
       <Filter>html</Filter>
     </ClCompile>
+    <ClCompile Include="..\html\RubyElement.cpp">
+      <Filter>html</Filter>
+    </ClCompile>
+    <ClCompile Include="..\html\RubyTextElement.cpp">
+      <Filter>html</Filter>
+    </ClCompile>
     <ClCompile Include="..\html\SearchInputType.cpp">
       <Filter>html</Filter>
     </ClCompile>
     <ClInclude Include="..\html\ResetInputType.h">
       <Filter>html</Filter>
     </ClInclude>
+    <ClInclude Include="..\html\RubyElement.h">
+      <Filter>html</Filter>
+    </ClInclude>
+    <ClInclude Include="..\html\RubyTextElement.h">
+      <Filter>html</Filter>
+    </ClInclude>
     <ClInclude Include="..\html\SearchInputType.h">
       <Filter>html</Filter>
     </ClInclude>
index 14dbd70..8f402bb 100644 (file)
                580371611A66F00A00BAF519 /* ClipRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5803715F1A66F00A00BAF519 /* ClipRect.cpp */; };
                580371621A66F00A00BAF519 /* ClipRect.h in Headers */ = {isa = PBXBuildFile; fileRef = 580371601A66F00A00BAF519 /* ClipRect.h */; settings = {ATTRIBUTES = (Private, ); }; };
                580371641A66F1D300BAF519 /* LayerFragment.h in Headers */ = {isa = PBXBuildFile; fileRef = 580371631A66F1D300BAF519 /* LayerFragment.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               5824ABA21AE81116009074B7 /* RubyElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5824ABA01AE81116009074B7 /* RubyElement.cpp */; };
+               5824ABA31AE81116009074B7 /* RubyElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 5824ABA11AE81116009074B7 /* RubyElement.h */; };
+               5824ABA61AE81384009074B7 /* RubyTextElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5824ABA41AE81384009074B7 /* RubyTextElement.cpp */; };
+               5824ABA71AE81384009074B7 /* RubyTextElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 5824ABA51AE81384009074B7 /* RubyTextElement.h */; };
                582CB0531A78A14B00AFFCC4 /* SimpleLineLayoutTextFragmentIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 582CB0521A78A14B00AFFCC4 /* SimpleLineLayoutTextFragmentIterator.h */; };
                582CB0551A78A2B200AFFCC4 /* SimpleLineLayoutTextFragmentIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 582CB0541A78A2B200AFFCC4 /* SimpleLineLayoutTextFragmentIterator.cpp */; };
                585D6DFC1A15355600FA4F12 /* SimpleLineLayoutResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 585D6DFB1A15355600FA4F12 /* SimpleLineLayoutResolver.cpp */; };
                5803715F1A66F00A00BAF519 /* ClipRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ClipRect.cpp; sourceTree = "<group>"; };
                580371601A66F00A00BAF519 /* ClipRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClipRect.h; sourceTree = "<group>"; };
                580371631A66F1D300BAF519 /* LayerFragment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayerFragment.h; sourceTree = "<group>"; };
+               5824ABA01AE81116009074B7 /* RubyElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RubyElement.cpp; sourceTree = "<group>"; };
+               5824ABA11AE81116009074B7 /* RubyElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RubyElement.h; sourceTree = "<group>"; };
+               5824ABA41AE81384009074B7 /* RubyTextElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RubyTextElement.cpp; sourceTree = "<group>"; };
+               5824ABA51AE81384009074B7 /* RubyTextElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RubyTextElement.h; sourceTree = "<group>"; };
                582CB0521A78A14B00AFFCC4 /* SimpleLineLayoutTextFragmentIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLineLayoutTextFragmentIterator.h; sourceTree = "<group>"; };
                582CB0541A78A2B200AFFCC4 /* SimpleLineLayoutTextFragmentIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleLineLayoutTextFragmentIterator.cpp; sourceTree = "<group>"; };
                585D6DFB1A15355600FA4F12 /* SimpleLineLayoutResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleLineLayoutResolver.cpp; sourceTree = "<group>"; };
                93EEC1EC09C2877700C515D1 /* html */ = {
                        isa = PBXGroup;
                        children = (
+                               5824ABA01AE81116009074B7 /* RubyElement.cpp */,
+                               5824ABA11AE81116009074B7 /* RubyElement.h */,
+                               5824ABA41AE81384009074B7 /* RubyTextElement.cpp */,
+                               5824ABA51AE81384009074B7 /* RubyTextElement.h */,
                                49484FAE102CF01E00187DD3 /* canvas */,
                                1A88A90117553CD7000C74F9 /* forms */,
                                97C1F5511228558800EDE616 /* parser */,
                                A83B79020CCAFF15000B0825 /* JSSVGFontFaceNameElement.h in Headers */,
                                A83B78FE0CCAFF15000B0825 /* JSSVGFontFaceSrcElement.h in Headers */,
                                A83B78FC0CCAFF15000B0825 /* JSSVGFontFaceUriElement.h in Headers */,
+                               5824ABA31AE81116009074B7 /* RubyElement.h in Headers */,
                                B2FA3D990AB75A6F000E5AC4 /* JSSVGForeignObjectElement.h in Headers */,
                                B2FA3D9B0AB75A6F000E5AC4 /* JSSVGGElement.h in Headers */,
                                724ED3321A3A8B2300F5F13C /* JSEXTBlendMinMax.h in Headers */,
                                83C1D436178D5AB500141E68 /* SVGPathSegMovetoRel.h in Headers */,
                                082DE42D1292621600D923DF /* SVGPathSegWithContext.h in Headers */,
                                84300BD8120C9AD40021954A /* SVGPathSource.h in Headers */,
+                               5824ABA71AE81384009074B7 /* RubyTextElement.h in Headers */,
                                8419D2BA120E0C7600141F8F /* SVGPathStringBuilder.h in Headers */,
                                84300BD6120C9AAC0021954A /* SVGPathStringSource.h in Headers */,
                                84C5B2FB1216DC810088B53A /* SVGPathTraversalStateBuilder.h in Headers */,
                                E51A81DF17298D7700BFCA61 /* JSPerformance.cpp in Sources */,
                                8A9A587011E84C36008ACFD1 /* JSPerformanceNavigation.cpp in Sources */,
                                0F43C85F189E15A600019AE2 /* JSPerformanceTiming.cpp in Sources */,
+                               5824ABA61AE81384009074B7 /* RubyTextElement.cpp in Sources */,
                                FDEA6246152102FC00479DF0 /* JSPeriodicWave.cpp in Sources */,
                                93B70D6B09EB0C7C009D8468 /* JSPluginElementFunctions.cpp in Sources */,
                                5189F01D10B37BD900F3C739 /* JSPopStateEvent.cpp in Sources */,
                                FD00D7A414A3F61900734011 /* SincResampler.cpp in Sources */,
                                51327D6111A33A2B004F9D65 /* SinkDocument.cpp in Sources */,
                                49E911CC0EF86D47009D0CAF /* SkewTransformOperation.cpp in Sources */,
+                               5824ABA21AE81116009074B7 /* RubyElement.cpp in Sources */,
                                4150F9F212B6E0E70008C860 /* SliderThumbElement.cpp in Sources */,
                                1C0939EA1A13E12900B788E5 /* CachedSVGFont.cpp in Sources */,
                                4B6FA6F70C39E4A100087011 /* SmartReplaceCF.cpp in Sources */,
index 0d0985d..91387b0 100644 (file)
@@ -103,9 +103,9 @@ progress interfaceName=HTMLProgressElement
 q interfaceName=HTMLQuoteElement
 rb interfaceName=HTMLElement
 rp interfaceName=HTMLElement
-rt interfaceName=HTMLElement
+rt interfaceName=RubyTextElement, JSInterfaceName=HTMLElement
 rtc interfaceName=HTMLElement
-ruby interfaceName=HTMLElement
+ruby interfaceName=RubyElement, JSInterfaceName=HTMLElement
 s interfaceName=HTMLElement
 samp interfaceName=HTMLElement
 script constructorNeedsCreatedByParser
diff --git a/Source/WebCore/html/RubyElement.cpp b/Source/WebCore/html/RubyElement.cpp
new file mode 100644 (file)
index 0000000..7a921ed
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2015 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 "RubyElement.h"
+
+#include "RenderRuby.h"
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+RubyElement::RubyElement(const QualifiedName& tagName, Document& document)
+    : HTMLElement(tagName, document)
+{
+    ASSERT(hasTagName(rubyTag));
+}
+
+Ref<RubyElement> RubyElement::create(const QualifiedName& tagName, Document& document)
+{
+    return adoptRef(*new RubyElement(tagName, document));
+}
+
+RenderPtr<RenderElement> RubyElement::createElementRenderer(Ref<RenderStyle>&& style)
+{
+    if (style->display() == INLINE)
+        return createRenderer<RenderRubyAsInline>(*this, WTF::move(style));
+    if (style->display() == BLOCK || style.get().display() == INLINE_BLOCK)
+        return createRenderer<RenderRubyAsBlock>(*this, WTF::move(style));
+    return HTMLElement::createElementRenderer(WTF::move(style));
+}
+
+}
diff --git a/Source/WebCore/html/RubyElement.h b/Source/WebCore/html/RubyElement.h
new file mode 100644 (file)
index 0000000..8bce5dc
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2015 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 RubyElement_h
+#define RubyElement_h
+
+#include "HTMLElement.h"
+
+namespace WebCore {
+
+class RubyElement final : public HTMLElement {
+public:
+    static Ref<RubyElement> create(const QualifiedName&, Document&);
+
+private:
+    RubyElement(const QualifiedName&, Document&);
+    virtual RenderPtr<RenderElement> createElementRenderer(Ref<RenderStyle>&&) override;
+};
+
+}
+
+#endif
diff --git a/Source/WebCore/html/RubyTextElement.cpp b/Source/WebCore/html/RubyTextElement.cpp
new file mode 100644 (file)
index 0000000..e6b2362
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2015 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 "RubyTextElement.h"
+
+#include "RenderRuby.h"
+#include "RenderRubyText.h"
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+RubyTextElement::RubyTextElement(const QualifiedName& tagName, Document& document)
+    : HTMLElement(tagName, document)
+{
+    ASSERT(hasTagName(rtTag));
+}
+
+Ref<RubyTextElement> RubyTextElement::create(const QualifiedName& tagName, Document& document)
+{
+    return adoptRef(*new RubyTextElement(tagName, document));
+}
+
+RenderPtr<RenderElement> RubyTextElement::createElementRenderer(Ref<RenderStyle>&& style)
+{
+    // Treat <rt> as ruby text ONLY if the parent is ruby.
+    if (parentElement() && isRuby(parentElement()->renderer()))
+        return createRenderer<RenderRubyText>(*this, WTF::move(style));
+    return HTMLElement::createElementRenderer(WTF::move(style));
+}
+
+}
diff --git a/Source/WebCore/html/RubyTextElement.h b/Source/WebCore/html/RubyTextElement.h
new file mode 100644 (file)
index 0000000..0ac5a0c
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2015 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 RubyTextElement_h
+#define RubyTextElement_h
+
+#include "HTMLElement.h"
+
+namespace WebCore {
+
+class RubyTextElement final : public HTMLElement {
+public:
+    static Ref<RubyTextElement> create(const QualifiedName&, Document&);
+
+private:
+    RubyTextElement(const QualifiedName&, Document&);
+    virtual RenderPtr<RenderElement> createElementRenderer(Ref<RenderStyle>&&) override;
+};
+
+}
+
+#endif
index 7af96e1..08f7e15 100644 (file)
@@ -158,15 +158,6 @@ RenderPtr<RenderElement> RenderElement::createFor(Element& element, Ref<RenderSt
         return WTF::move(image);
     }
 
-    if (element.hasTagName(HTMLNames::rubyTag)) {
-        if (style.get().display() == INLINE)
-            return createRenderer<RenderRubyAsInline>(element, WTF::move(style));
-        if (style.get().display() == BLOCK || style.get().display() == INLINE_BLOCK)
-            return createRenderer<RenderRubyAsBlock>(element, WTF::move(style));
-    }
-    // treat <rt> as ruby text ONLY if the parent is ruby.
-    if (element.hasTagName(HTMLNames::rtTag) && element.parentElement() && isRuby(element.parentElement()->renderer()))
-        return createRenderer<RenderRubyText>(element, WTF::move(style));
     switch (style.get().display()) {
     case NONE:
         return nullptr;