Title: [183129] trunk/Source/WebCore
Revision
183129
Author
[email protected]
Date
2015-04-22 13:52:47 -0700 (Wed, 22 Apr 2015)

Log Message

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):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (183128 => 183129)


--- trunk/Source/WebCore/CMakeLists.txt	2015-04-22 20:44:32 UTC (rev 183128)
+++ trunk/Source/WebCore/CMakeLists.txt	2015-04-22 20:52:47 UTC (rev 183129)
@@ -1688,6 +1688,8 @@
     html/RangeInputType.cpp
     html/RelList.cpp
     html/ResetInputType.cpp
+    html/RubyElement.cpp
+    html/RubyTextElement.cpp
     html/SearchInputType.cpp
     html/StepRange.cpp
     html/SubmitInputType.cpp

Modified: trunk/Source/WebCore/ChangeLog (183128 => 183129)


--- trunk/Source/WebCore/ChangeLog	2015-04-22 20:44:32 UTC (rev 183128)
+++ trunk/Source/WebCore/ChangeLog	2015-04-22 20:52:47 UTC (rev 183129)
@@ -1,3 +1,30 @@
+2015-04-22  Zalan Bujtas  <[email protected]>
+
+        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  <[email protected]>
 
         Show correct wireless play placard on iOS.

Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (183128 => 183129)


--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj	2015-04-22 20:44:32 UTC (rev 183128)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj	2015-04-22 20:52:47 UTC (rev 183129)
@@ -16244,6 +16244,8 @@
     <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" />
@@ -21278,6 +21280,8 @@
     <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" />

Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (183128 => 183129)


--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters	2015-04-22 20:44:32 UTC (rev 183128)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters	2015-04-22 20:52:47 UTC (rev 183129)
@@ -4008,6 +4008,12 @@
     <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>
@@ -11172,6 +11178,12 @@
     <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>

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (183128 => 183129)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2015-04-22 20:44:32 UTC (rev 183128)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2015-04-22 20:52:47 UTC (rev 183129)
@@ -2117,6 +2117,10 @@
 		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 */; };
@@ -9328,6 +9332,10 @@
 		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>"; };
@@ -17909,6 +17917,10 @@
 		93EEC1EC09C2877700C515D1 /* html */ = {
 			isa = PBXGroup;
 			children = (
+				5824ABA01AE81116009074B7 /* RubyElement.cpp */,
+				5824ABA11AE81116009074B7 /* RubyElement.h */,
+				5824ABA41AE81384009074B7 /* RubyTextElement.cpp */,
+				5824ABA51AE81384009074B7 /* RubyTextElement.h */,
 				49484FAE102CF01E00187DD3 /* canvas */,
 				1A88A90117553CD7000C74F9 /* forms */,
 				97C1F5511228558800EDE616 /* parser */,
@@ -25473,6 +25485,7 @@
 				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 */,
@@ -26706,6 +26719,7 @@
 				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 */,
@@ -28892,6 +28906,7 @@
 				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 */,
@@ -29827,6 +29842,7 @@
 				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 */,

Modified: trunk/Source/WebCore/html/HTMLTagNames.in (183128 => 183129)


--- trunk/Source/WebCore/html/HTMLTagNames.in	2015-04-22 20:44:32 UTC (rev 183128)
+++ trunk/Source/WebCore/html/HTMLTagNames.in	2015-04-22 20:52:47 UTC (rev 183129)
@@ -103,9 +103,9 @@
 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

Added: trunk/Source/WebCore/html/RubyElement.cpp (0 => 183129)


--- trunk/Source/WebCore/html/RubyElement.cpp	                        (rev 0)
+++ trunk/Source/WebCore/html/RubyElement.cpp	2015-04-22 20:52:47 UTC (rev 183129)
@@ -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));
+}
+
+}

Added: trunk/Source/WebCore/html/RubyElement.h (0 => 183129)


--- trunk/Source/WebCore/html/RubyElement.h	                        (rev 0)
+++ trunk/Source/WebCore/html/RubyElement.h	2015-04-22 20:52:47 UTC (rev 183129)
@@ -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

Added: trunk/Source/WebCore/html/RubyTextElement.cpp (0 => 183129)


--- trunk/Source/WebCore/html/RubyTextElement.cpp	                        (rev 0)
+++ trunk/Source/WebCore/html/RubyTextElement.cpp	2015-04-22 20:52:47 UTC (rev 183129)
@@ -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));
+}
+
+}

Added: trunk/Source/WebCore/html/RubyTextElement.h (0 => 183129)


--- trunk/Source/WebCore/html/RubyTextElement.h	                        (rev 0)
+++ trunk/Source/WebCore/html/RubyTextElement.h	2015-04-22 20:52:47 UTC (rev 183129)
@@ -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

Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (183128 => 183129)


--- trunk/Source/WebCore/rendering/RenderElement.cpp	2015-04-22 20:44:32 UTC (rev 183128)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp	2015-04-22 20:52:47 UTC (rev 183129)
@@ -158,15 +158,6 @@
         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;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to