Create RenderRubyText for <rt> only when the parent renderer is a RenderRuby.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Apr 2015 02:16:52 +0000 (02:16 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Apr 2015 02:16:52 +0000 (02:16 +0000)
commitf1a2adee51ba754a11302f584367e66e3badcec5
tree8d45bb39a6a4c5208b5a132bcbed9e6dfaf92822
parent7e0d5adbca6192f598021e0e679085b81d3223cb
Create RenderRubyText for <rt> only when the parent renderer is a RenderRuby.
https://bugs.webkit.org/show_bug.cgi?id=144035
rdar://problem/20604467

Reviewed by Darin Adler.

This patch extends HTMLElement::createElementRenderer()
with the render tree insertion point so that we can create different type
of renderers based on the render tree context.

Source/WebCore:

Test: fast/ruby/ruby-rt-with-region-crash.html

* CMakeLists.txt:
* Modules/plugins/PluginReplacement.h:
* Modules/plugins/QuickTimePluginReplacement.h:
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::createElementRenderer):
* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::YouTubePluginReplacement::createElementRenderer):
* Modules/plugins/YouTubePluginReplacement.h:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* dom/Element.cpp:
(WebCore::Element::createElementRenderer):
* dom/Element.h:
* html/HTMLAppletElement.cpp:
(WebCore::HTMLAppletElement::createElementRenderer):
* html/HTMLAppletElement.h:
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::createElementRenderer):
* html/HTMLAttachmentElement.h:
* html/HTMLBRElement.cpp:
(WebCore::HTMLBRElement::createElementRenderer):
* html/HTMLBRElement.h:
* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::createElementRenderer):
* html/HTMLButtonElement.h:
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createElementRenderer):
* html/HTMLCanvasElement.h:
* html/HTMLDetailsElement.cpp:
(WebCore::HTMLDetailsElement::createElementRenderer):
* html/HTMLDetailsElement.h:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::createElementRenderer):
* html/HTMLElement.h:
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::createElementRenderer):
* html/HTMLFieldSetElement.h:
* html/HTMLFrameElement.cpp:
(WebCore::HTMLFrameElement::createElementRenderer):
* html/HTMLFrameElement.h:
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::createElementRenderer):
* html/HTMLFrameSetElement.h:
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::createElementRenderer):
* html/HTMLIFrameElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::createElementRenderer):
* html/HTMLImageElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::createElementRenderer):
* html/HTMLInputElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
* html/HTMLMediaElement.h:
* html/HTMLMeterElement.cpp:
(WebCore::HTMLMeterElement::createElementRenderer):
* html/HTMLMeterElement.h:
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::createElementRenderer):
* html/HTMLPlugInElement.h:
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::createElementRenderer):
* html/HTMLPlugInImageElement.h:
* html/HTMLProgressElement.cpp:
(WebCore::HTMLProgressElement::createElementRenderer):
* html/HTMLProgressElement.h:
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::createElementRenderer):
* html/HTMLSelectElement.h:
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::createElementRenderer):
* html/HTMLSummaryElement.h:
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::createElementRenderer):
* html/HTMLTextAreaElement.h:
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::createElementRenderer):
* html/HTMLVideoElement.h:
* html/HTMLWBRElement.cpp:
(WebCore::HTMLWBRElement::createElementRenderer):
* html/HTMLWBRElement.h:
* html/RubyElement.cpp:
(WebCore::RubyElement::createElementRenderer):
* html/RubyElement.h:
* html/RubyTextElement.cpp:
(WebCore::RubyTextElement::createElementRenderer):
* html/RubyTextElement.h:
* html/shadow/DetailsMarkerControl.cpp:
(WebCore::DetailsMarkerControl::createElementRenderer):
* html/shadow/DetailsMarkerControl.h:
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTimelineContainerElement::createElementRenderer):
(WebCore::MediaControlVolumeSliderContainerElement::createElementRenderer):
(WebCore::MediaControlTextTrackContainerElement::createElementRenderer):
* html/shadow/MediaControlElements.h:
* html/shadow/MeterShadowElement.cpp:
(WebCore::MeterInnerElement::createElementRenderer):
* html/shadow/MeterShadowElement.h:
* html/shadow/ProgressShadowElement.cpp:
(WebCore::ProgressInnerElement::createElementRenderer):
* html/shadow/ProgressShadowElement.h:
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::createElementRenderer):
(WebCore::SliderContainerElement::createElementRenderer):
* html/shadow/SliderThumbElement.h:
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerContainer::createElementRenderer):
(WebCore::TextControlInnerTextElement::createElementRenderer):
* html/shadow/TextControlInnerElements.h:
* html/shadow/mac/ImageControlsButtonElementMac.cpp:
(WebCore::ImageControlsButtonElementMac::createElementRenderer):
* html/shadow/mac/ImageControlsButtonElementMac.h:
* html/shadow/mac/ImageControlsRootElementMac.cpp:
(WebCore::ImageControlsRootElementMac::createElementRenderer):
* html/shadow/mac/ImageControlsRootElementMac.h:
* html/track/VTTCue.cpp:
(WebCore::VTTCueBox::createElementRenderer):
* html/track/VTTCue.h:
* mathml/MathMLInlineContainerElement.cpp:
(WebCore::MathMLInlineContainerElement::createElementRenderer):
* mathml/MathMLInlineContainerElement.h:
* mathml/MathMLMathElement.cpp:
(WebCore::MathMLMathElement::createElementRenderer):
* mathml/MathMLMathElement.h:
* mathml/MathMLMencloseElement.cpp:
(WebCore::MathMLMencloseElement::createElementRenderer):
* mathml/MathMLMencloseElement.h:
* mathml/MathMLSelectElement.cpp:
(WebCore::MathMLSelectElement::createElementRenderer):
* mathml/MathMLSelectElement.h:
* mathml/MathMLTextElement.cpp:
(WebCore::MathMLTextElement::createElementRenderer):
* mathml/MathMLTextElement.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::clone):
* rendering/RenderElement.cpp:
* rendering/RenderRuby.h:
(WebCore::isRuby):
* style/RenderTreePosition.cpp: Added.
(WebCore::RenderTreePosition::computeNextSibling):
(WebCore::RenderTreePosition::invalidateNextSibling):
(WebCore::RenderTreePosition::previousSiblingRenderer):
(WebCore::RenderTreePosition::nextSiblingRenderer):
(WebCore::RenderTreePosition::isRendererReparented):
* style/RenderTreePosition.h: Added.
(WebCore::RenderTreePosition::RenderTreePosition):
(WebCore::RenderTreePosition::parent):
(WebCore::RenderTreePosition::canInsert):
(WebCore::RenderTreePosition::insert):
* style/StyleResolveTree.cpp:
(WebCore::Style::createRendererIfNeeded):
(WebCore::Style::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
(WebCore::Style::textRendererIsNeeded):
(WebCore::Style::RenderTreePosition::parent): Deleted.
(WebCore::Style::isRendererReparented): Deleted.
(WebCore::Style::nextSiblingRenderer): Deleted.
(WebCore::Style::RenderTreePosition::RenderTreePosition): Deleted.
(WebCore::Style::RenderTreePosition::canInsert): Deleted.
(WebCore::Style::RenderTreePosition::insert): Deleted.
(WebCore::Style::RenderTreePosition::computeNextSibling): Deleted.
(WebCore::Style::RenderTreePosition::invalidateNextSibling): Deleted.
(WebCore::Style::previousSiblingRenderer): Deleted.
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::createElementRenderer):
* svg/SVGAElement.h:
* svg/SVGAltGlyphElement.cpp:
(WebCore::SVGAltGlyphElement::createElementRenderer):
* svg/SVGAltGlyphElement.h:
* svg/SVGCircleElement.cpp:
(WebCore::SVGCircleElement::createElementRenderer):
* svg/SVGCircleElement.h:
* svg/SVGClipPathElement.cpp:
(WebCore::SVGClipPathElement::createElementRenderer):
* svg/SVGClipPathElement.h:
* svg/SVGDefsElement.cpp:
(WebCore::SVGDefsElement::createElementRenderer):
* svg/SVGDefsElement.h:
* svg/SVGEllipseElement.cpp:
(WebCore::SVGEllipseElement::createElementRenderer):
* svg/SVGEllipseElement.h:
* svg/SVGFilterElement.cpp:
(WebCore::SVGFilterElement::createElementRenderer):
* svg/SVGFilterElement.h:
* svg/SVGFilterPrimitiveStandardAttributes.cpp:
(WebCore::SVGFilterPrimitiveStandardAttributes::createElementRenderer):
* svg/SVGFilterPrimitiveStandardAttributes.h:
* svg/SVGForeignObjectElement.cpp:
(WebCore::SVGForeignObjectElement::createElementRenderer):
* svg/SVGForeignObjectElement.h:
* svg/SVGGElement.cpp:
(WebCore::SVGGElement::createElementRenderer):
* svg/SVGGElement.h:
* svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::createElementRenderer):
* svg/SVGGraphicsElement.h:
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::createElementRenderer):
* svg/SVGImageElement.h:
* svg/SVGLinearGradientElement.cpp:
(WebCore::SVGLinearGradientElement::createElementRenderer):
* svg/SVGLinearGradientElement.h:
* svg/SVGMarkerElement.cpp:
(WebCore::SVGMarkerElement::createElementRenderer):
* svg/SVGMarkerElement.h:
* svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::createElementRenderer):
* svg/SVGMaskElement.h:
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::createElementRenderer):
* svg/SVGPathElement.h:
* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::createElementRenderer):
* svg/SVGPatternElement.h:
* svg/SVGRadialGradientElement.cpp:
(WebCore::SVGRadialGradientElement::createElementRenderer):
* svg/SVGRadialGradientElement.h:
* svg/SVGRectElement.cpp:
(WebCore::SVGRectElement::createElementRenderer):
* svg/SVGRectElement.h:
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::createElementRenderer):
* svg/SVGSVGElement.h:
* svg/SVGStopElement.cpp:
(WebCore::SVGStopElement::createElementRenderer):
* svg/SVGStopElement.h:
* svg/SVGSwitchElement.cpp:
(WebCore::SVGSwitchElement::createElementRenderer):
* svg/SVGSwitchElement.h:
* svg/SVGSymbolElement.cpp:
(WebCore::SVGSymbolElement::createElementRenderer):
* svg/SVGSymbolElement.h:
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::createElementRenderer):
* svg/SVGTRefElement.h:
* svg/SVGTSpanElement.cpp:
(WebCore::SVGTSpanElement::createElementRenderer):
* svg/SVGTSpanElement.h:
* svg/SVGTextElement.cpp:
(WebCore::SVGTextElement::createElementRenderer):
* svg/SVGTextElement.h:
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::createElementRenderer):
* svg/SVGTextPathElement.h:
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::createElementRenderer):
* svg/SVGUseElement.h:

LayoutTests:

* fast/ruby/ruby-rt-with-region-crash-expected.txt: Added.
* fast/ruby/ruby-rt-with-region-crash.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183160 268f45cc-cd09-0410-ab3c-d52691b4dbfc
155 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/ruby/ruby-rt-with-region-crash-expected.txt [new file with mode: 0644]
LayoutTests/fast/ruby/ruby-rt-with-region-crash.html [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/plugins/PluginReplacement.h
Source/WebCore/Modules/plugins/QuickTimePluginReplacement.h
Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm
Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp
Source/WebCore/Modules/plugins/YouTubePluginReplacement.h
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/html/HTMLAppletElement.cpp
Source/WebCore/html/HTMLAppletElement.h
Source/WebCore/html/HTMLAttachmentElement.cpp
Source/WebCore/html/HTMLAttachmentElement.h
Source/WebCore/html/HTMLBRElement.cpp
Source/WebCore/html/HTMLBRElement.h
Source/WebCore/html/HTMLButtonElement.cpp
Source/WebCore/html/HTMLButtonElement.h
Source/WebCore/html/HTMLCanvasElement.cpp
Source/WebCore/html/HTMLCanvasElement.h
Source/WebCore/html/HTMLDetailsElement.cpp
Source/WebCore/html/HTMLDetailsElement.h
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLElement.h
Source/WebCore/html/HTMLFieldSetElement.cpp
Source/WebCore/html/HTMLFieldSetElement.h
Source/WebCore/html/HTMLFrameElement.cpp
Source/WebCore/html/HTMLFrameElement.h
Source/WebCore/html/HTMLFrameSetElement.cpp
Source/WebCore/html/HTMLFrameSetElement.h
Source/WebCore/html/HTMLIFrameElement.cpp
Source/WebCore/html/HTMLIFrameElement.h
Source/WebCore/html/HTMLImageElement.cpp
Source/WebCore/html/HTMLImageElement.h
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLInputElement.h
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/HTMLMeterElement.cpp
Source/WebCore/html/HTMLMeterElement.h
Source/WebCore/html/HTMLPlugInElement.cpp
Source/WebCore/html/HTMLPlugInElement.h
Source/WebCore/html/HTMLPlugInImageElement.cpp
Source/WebCore/html/HTMLPlugInImageElement.h
Source/WebCore/html/HTMLProgressElement.cpp
Source/WebCore/html/HTMLProgressElement.h
Source/WebCore/html/HTMLSelectElement.cpp
Source/WebCore/html/HTMLSelectElement.h
Source/WebCore/html/HTMLSummaryElement.cpp
Source/WebCore/html/HTMLSummaryElement.h
Source/WebCore/html/HTMLTextAreaElement.cpp
Source/WebCore/html/HTMLTextAreaElement.h
Source/WebCore/html/HTMLVideoElement.cpp
Source/WebCore/html/HTMLVideoElement.h
Source/WebCore/html/HTMLWBRElement.cpp
Source/WebCore/html/HTMLWBRElement.h
Source/WebCore/html/RubyElement.cpp
Source/WebCore/html/RubyElement.h
Source/WebCore/html/RubyTextElement.cpp
Source/WebCore/html/RubyTextElement.h
Source/WebCore/html/shadow/DetailsMarkerControl.cpp
Source/WebCore/html/shadow/DetailsMarkerControl.h
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebCore/html/shadow/MediaControlElements.h
Source/WebCore/html/shadow/MeterShadowElement.cpp
Source/WebCore/html/shadow/MeterShadowElement.h
Source/WebCore/html/shadow/ProgressShadowElement.cpp
Source/WebCore/html/shadow/ProgressShadowElement.h
Source/WebCore/html/shadow/SliderThumbElement.cpp
Source/WebCore/html/shadow/SliderThumbElement.h
Source/WebCore/html/shadow/TextControlInnerElements.cpp
Source/WebCore/html/shadow/TextControlInnerElements.h
Source/WebCore/html/shadow/mac/ImageControlsButtonElementMac.cpp
Source/WebCore/html/shadow/mac/ImageControlsButtonElementMac.h
Source/WebCore/html/shadow/mac/ImageControlsRootElementMac.cpp
Source/WebCore/html/shadow/mac/ImageControlsRootElementMac.h
Source/WebCore/html/track/VTTCue.cpp
Source/WebCore/html/track/VTTCue.h
Source/WebCore/mathml/MathMLInlineContainerElement.cpp
Source/WebCore/mathml/MathMLInlineContainerElement.h
Source/WebCore/mathml/MathMLMathElement.cpp
Source/WebCore/mathml/MathMLMathElement.h
Source/WebCore/mathml/MathMLMencloseElement.cpp
Source/WebCore/mathml/MathMLMencloseElement.h
Source/WebCore/mathml/MathMLSelectElement.cpp
Source/WebCore/mathml/MathMLSelectElement.h
Source/WebCore/mathml/MathMLTextElement.cpp
Source/WebCore/mathml/MathMLTextElement.h
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderRuby.h
Source/WebCore/style/RenderTreePosition.cpp [new file with mode: 0644]
Source/WebCore/style/RenderTreePosition.h [new file with mode: 0644]
Source/WebCore/style/StyleResolveTree.cpp
Source/WebCore/svg/SVGAElement.cpp
Source/WebCore/svg/SVGAElement.h
Source/WebCore/svg/SVGAltGlyphElement.cpp
Source/WebCore/svg/SVGAltGlyphElement.h
Source/WebCore/svg/SVGCircleElement.cpp
Source/WebCore/svg/SVGCircleElement.h
Source/WebCore/svg/SVGClipPathElement.cpp
Source/WebCore/svg/SVGClipPathElement.h
Source/WebCore/svg/SVGDefsElement.cpp
Source/WebCore/svg/SVGDefsElement.h
Source/WebCore/svg/SVGEllipseElement.cpp
Source/WebCore/svg/SVGEllipseElement.h
Source/WebCore/svg/SVGFilterElement.cpp
Source/WebCore/svg/SVGFilterElement.h
Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp
Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
Source/WebCore/svg/SVGForeignObjectElement.cpp
Source/WebCore/svg/SVGForeignObjectElement.h
Source/WebCore/svg/SVGGElement.cpp
Source/WebCore/svg/SVGGElement.h
Source/WebCore/svg/SVGGraphicsElement.cpp
Source/WebCore/svg/SVGGraphicsElement.h
Source/WebCore/svg/SVGImageElement.cpp
Source/WebCore/svg/SVGImageElement.h
Source/WebCore/svg/SVGLinearGradientElement.cpp
Source/WebCore/svg/SVGLinearGradientElement.h
Source/WebCore/svg/SVGMarkerElement.cpp
Source/WebCore/svg/SVGMarkerElement.h
Source/WebCore/svg/SVGMaskElement.cpp
Source/WebCore/svg/SVGMaskElement.h
Source/WebCore/svg/SVGPathElement.cpp
Source/WebCore/svg/SVGPathElement.h
Source/WebCore/svg/SVGPatternElement.cpp
Source/WebCore/svg/SVGPatternElement.h
Source/WebCore/svg/SVGRadialGradientElement.cpp
Source/WebCore/svg/SVGRadialGradientElement.h
Source/WebCore/svg/SVGRectElement.cpp
Source/WebCore/svg/SVGRectElement.h
Source/WebCore/svg/SVGSVGElement.cpp
Source/WebCore/svg/SVGSVGElement.h
Source/WebCore/svg/SVGStopElement.cpp
Source/WebCore/svg/SVGStopElement.h
Source/WebCore/svg/SVGSwitchElement.cpp
Source/WebCore/svg/SVGSwitchElement.h
Source/WebCore/svg/SVGSymbolElement.cpp
Source/WebCore/svg/SVGSymbolElement.h
Source/WebCore/svg/SVGTRefElement.cpp
Source/WebCore/svg/SVGTRefElement.h
Source/WebCore/svg/SVGTSpanElement.cpp
Source/WebCore/svg/SVGTSpanElement.h
Source/WebCore/svg/SVGTextElement.cpp
Source/WebCore/svg/SVGTextElement.h
Source/WebCore/svg/SVGTextPathElement.cpp
Source/WebCore/svg/SVGTextPathElement.h
Source/WebCore/svg/SVGUseElement.cpp
Source/WebCore/svg/SVGUseElement.h