From e5c334a771b5f856c2d6b828d7a963902372305c Mon Sep 17 00:00:00 2001 From: "fred.wang@free.fr" Date: Tue, 28 Jun 2016 17:01:29 +0000 Subject: [PATCH] Phrasing content should be accepted in elements https://bugs.webkit.org/show_bug.cgi?id=130245 Patch by Frederic Wang on 2016-06-28 Reviewed by Brent Fulgham. Source/WebCore: After r202420, the RenderMathMLOperator element no longer messes with anonymous block and text nodes. Hence it is now safe to allow foreign content inside . We extend foreign-element-in-token.html to cover the mo case. * mathml/MathMLTextElement.cpp: (WebCore::MathMLTextElement::childShouldCreateRenderer): Remove the early return for so that it accepts phrasing content children. LayoutTests: * mathml/presentation/foreign-element-in-token.html: Copy test cases to check elements too. * mathml/presentation/foreign-element-in-token-expected.txt: Add the expectations for . git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202572 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 12 +++ .../foreign-element-in-token-expected.txt | 108 +++++++++++++++++++++ .../presentation/foreign-element-in-token.html | 53 ++++++++-- Source/WebCore/ChangeLog | 16 +++ Source/WebCore/mathml/MathMLTextElement.cpp | 3 +- 5 files changed, 182 insertions(+), 10 deletions(-) diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 6e6e433..5a451c5 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,15 @@ +2016-06-28 Frederic Wang + + Phrasing content should be accepted in elements + https://bugs.webkit.org/show_bug.cgi?id=130245 + + Reviewed by Brent Fulgham. + + * mathml/presentation/foreign-element-in-token.html: Copy test cases to + check elements too. + * mathml/presentation/foreign-element-in-token-expected.txt: Add the + expectations for . + 2016-06-28 Alexey Proskuryakov Sierra test expectation gardening. diff --git a/LayoutTests/mathml/presentation/foreign-element-in-token-expected.txt b/LayoutTests/mathml/presentation/foreign-element-in-token-expected.txt index f0e571c..3ed5cea 100644 --- a/LayoutTests/mathml/presentation/foreign-element-in-token-expected.txt +++ b/LayoutTests/mathml/presentation/foreign-element-in-token-expected.txt @@ -324,6 +324,114 @@ mtext var: mtext +a: +mo + +abbr: +mo + +b: +mo + +bdi: +mo + +bdo: +mo + +button: +mo + +cite: +mo + +code: +mo + +datalist: +mo + +del: +mo + +dfn: +mo + +em: +mo + +embed: +mo + +i: +mo + +img: +mo + +input: +mo + +ins: +mo + +kbd: +mo + +keygen: +mo + +label: +mo + +mark: +mo + +math: +mo + +object: +mo + +output: +mo + +q: +mo + +ruby: +mo + +s: +mo + +samp: +mo + +small: +mo + +span: +mo + +strong: +mo + +sub: +mo + +sup: +mo + +svg: +mo + +u: +mo + +var: +mo + Foreign non-phrasing content should not create renderers: p: diff --git a/LayoutTests/mathml/presentation/foreign-element-in-token.html b/LayoutTests/mathml/presentation/foreign-element-in-token.html index 2ab594e..8dda25b 100644 --- a/LayoutTests/mathml/presentation/foreign-element-in-token.html +++ b/LayoutTests/mathml/presentation/foreign-element-in-token.html @@ -126,16 +126,53 @@

u: mtext

var: mtext

+

a: mo

+

abbr: mo

+

b: mo

+

bdi: mo

+

bdo: mo

+

button:

+

cite: mo

+

code: mo

+

datalist: mo

+

del: mo

+

dfn: mo

+

em: mo

+

embed: mo

+

i: mo

+

img: mo

+

input: mo

+

ins: mo

+

kbd: mo

+

keygen: mo

+

label:

+

mark: mo

+

math: mo

+

object: mo

+

output: mo

+

q: mo

+

ruby: mo

+

s: mo

+

samp: mo

+

small: mo

+

span: mo

+

strong: mo

+

sub: mo

+

sup: mo

+

svg: mo

+

u: mo

+

var: mo

+

Foreign non-phrasing content should not create renderers:

-

p:

mi

mi

mn

-

div:
mi
mi
mn

-

h1:

mi

mi

mn

-

h2:

mi

mi

mn

-

h3:

mi

mi

mn

-

h4:

mi

mi

mn

-

h6:
mi
mi
mn

-

blockquote:
mi
mi
mn

+

p:

mi

mi

mn

mo

+

div:
mi
mi
mn
mo

+

h1:

mi

mi

mn

mo

+

h2:

mi

mi

mn

mo

+

h3:

mi

mi

mn

mo

+

h4:

mi

mi

mn

mo

+

h6:
mi
mi
mn
mo

+

blockquote:
mi
mi
mn
mo

diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index e2e6253..2bf82fa 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,19 @@ +2016-06-28 Frederic Wang + + Phrasing content should be accepted in elements + https://bugs.webkit.org/show_bug.cgi?id=130245 + + Reviewed by Brent Fulgham. + + After r202420, the RenderMathMLOperator element no longer messes with anonymous block and + text nodes. Hence it is now safe to allow foreign content inside . + + We extend foreign-element-in-token.html to cover the mo case. + + * mathml/MathMLTextElement.cpp: + (WebCore::MathMLTextElement::childShouldCreateRenderer): Remove the early return for so + that it accepts phrasing content children. + 2016-06-27 Anders Carlsson WebKit::WebPaymentCoordinator leak diff --git a/Source/WebCore/mathml/MathMLTextElement.cpp b/Source/WebCore/mathml/MathMLTextElement.cpp index c1dc4f7..8142b4c 100644 --- a/Source/WebCore/mathml/MathMLTextElement.cpp +++ b/Source/WebCore/mathml/MathMLTextElement.cpp @@ -94,8 +94,7 @@ bool MathMLTextElement::childShouldCreateRenderer(const Node& child) const if (hasTagName(MathMLNames::mspaceTag)) return false; - // FIXME: phrasing content should be accepted in elements too (https://bugs.webkit.org/show_bug.cgi?id=130245). - if (hasTagName(MathMLNames::annotationTag) || hasTagName(MathMLNames::moTag)) + if (hasTagName(MathMLNames::annotationTag)) return child.isTextNode(); // The HTML specification defines , , , and as insertion points. -- 1.8.3.1