Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Issue 2169433002: HTMLTreeBuilderSimulator: Element created inside HTMLIntegrationPoint should be HTMLElement

Created:
4 years, 5 months ago by kouhei (in TOK)
Modified:
4 years, 5 months ago
CC:
blink-reviews, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink, kinuko+watch
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

HTMLTreeBuilderSimulator: Element created inside HTMLIntegrationPoint should be HTMLElement Per the HTML spec, "If the adjusted current node is an HTML integration point and the token is a start tag" [1], we should "process the token according to the rules given in the section corresponding to the current insertion mode in HTML content", which should "insert an HTML element" [2]. [1] https://html.spec.whatwg.org/multipage/syntax.html#tree-construction [2] https://html.spec.whatwg.org/multipage/syntax.html#insert-an-html-element HTMLTreeBuilder already conforms to the spec. This CL fixes the HTMLTreeBuilderSimulator so that it would also respect the spec behaviour: The child element of HTMLIntegrationPoint element should be a HTML element, and the grand child element of HTMLIntegrationPoint element should also be a HTML element if the element doesn't start foreignContent. BUG=411226

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -8 lines) Patch
M third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulator.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulator.cpp View 1 chunk +4 lines, -2 lines 1 comment Download
M third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulatorTest.cpp View 1 chunk +41 lines, -5 lines 1 comment Download

Messages

Total messages: 12 (8 generated)
kouhei (in TOK)
4 years, 5 months ago (2016-07-20 08:39:15 UTC) #5
kouhei (in TOK)
I still think we should commit https://codereview.chromium.org/2151783002/ too, but this is an another bug uncovered ...
4 years, 5 months ago (2016-07-20 08:40:07 UTC) #6
kouhei (in TOK)
4 years, 5 months ago (2016-07-20 09:29:07 UTC) #10
dominicc (has gone to gerrit)
4 years, 5 months ago (2016-07-21 02:14:49 UTC) #12
Makes sense, but some questions inline.

https://codereview.chromium.org/2169433002/diff/1/third_party/WebKit/Source/c...
File third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulator.cpp
(right):

https://codereview.chromium.org/2169433002/diff/1/third_party/WebKit/Source/c...
third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulator.cpp:179:
m_stack.append(StateFlags {HTML, false});
Why don't we need a matching change to "pop" this?

Why would an <svg> element at a HTML integration point not flip the namespace
back to SVG?

Could you add some pointers to specs and some stress tests for this sort of
thing?

https://codereview.chromium.org/2169433002/diff/1/third_party/WebKit/Source/c...
File third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulatorTest.cpp
(right):

https://codereview.chromium.org/2169433002/diff/1/third_party/WebKit/Source/c...
third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulatorTest.cpp:59:
EXPECT_EQ(HTMLTokenizer::DataState, tokenizer->getState())
I'm mildly confused comparing the code of the assertion and the description.

Just going by the name of this test,
ChangeStateInForeignContentAtHTMLIntegrationPoint, having assertions about
states and foreign content seems natural here.

The assertion code seems to be about tokenizer states. How does that relate to
HTML namespaces? Can you write an assertion that gets more directly to the
namespace question? (Maybe have both state and namespace assertions?)

Powered by Google App Engine
This is Rietveld 408576698