Changeset 159618 in webkit
- Timestamp:
- Nov 21, 2013 5:43:34 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r159610 r159618 1 2013-11-21 Ryosuke Niwa <rniwa@webkit.org> 2 3 HTML parser should not associate elements inside templates with forms 4 https://bugs.webkit.org/show_bug.cgi?id=117779 5 6 Reviewed by Antti Koivisto. 7 8 * fast/dom/HTMLTemplateElement/no-form-association-expected.txt: Added. 9 * fast/dom/HTMLTemplateElement/no-form-association.html: Added. 10 1 11 2013-11-20 Ryosuke Niwa <rniwa@webkit.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r159615 r159618 1 2013-11-21 Ryosuke Niwa <rniwa@webkit.org> 2 3 HTML parser should not associate elements inside templates with forms 4 https://bugs.webkit.org/show_bug.cgi?id=117779 5 6 Reviewed by Antti Koivisto. 7 8 Merge https://chromium.googlesource.com/chromium/blink/+/45aadf7ee7ee010327eb692066cf013315ef3ed7 9 10 When parsing <form><template><input>, the previous behavior was to associate the <input> with the <form>, 11 even though they're not in the same tree (or even the same document). 12 13 This patch changes that by checking, prior to creating a form control element, whether the element to be 14 created lives in a document with a browsing context. 15 16 We don't update m_form as needed to faithfully match the HTML5 specification's form element pointer 17 http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#form-element-pointer 18 and its algorithm for creating and inserting nodes: 19 http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construction.html#creating-and-inserting-nodes 20 21 While this leaves isindex's reference to form element pointer stale: 22 http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construction.html#isindex 23 The HTML5 specification matches the behaviors of Chrome and Firefox so we leave it as is. 24 25 Test: fast/dom/HTMLTemplateElement/no-form-association.html 26 27 * html/parser/HTMLConstructionSite.cpp: 28 (WebCore::HTMLConstructionSite::createHTMLElement): 29 1 30 2013-11-21 Carlos Garcia Campos <cgarcia@igalia.com> 2 31 -
trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp
r158650 r159618 544 544 // have to pass the current form element. We should rework form association 545 545 // to occur after construction to allow better code sharing here. 546 RefPtr<Element> element = HTMLElementFactory::createElement(tagName, ownerDocumentForCurrentNode(), form(), true); 546 // http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construction.html#create-an-element-for-the-token 547 Document& ownerDocument = ownerDocumentForCurrentNode(); 548 bool openElementsContainTemplateElement = !ownerDocument.frame(); 549 RefPtr<Element> element = HTMLElementFactory::createElement(tagName, ownerDocument, openElementsContainTemplateElement ? nullptr : form(), true); 547 550 setAttributes(element.get(), token, m_parserContentPolicy); 548 551 ASSERT(element->isHTMLElement());
Note: See TracChangeset
for help on using the changeset viewer.