Bug 153327

Summary: createElementFromSavedToken shouldn't have the code to create a non-HTML element
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: DOMAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, darin, esprehn+autocc, gyuyoung.kim, koivisto
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 150225    
Attachments:
Description Flags
Clenaup
none
Patch for landing
none
Patch for landing
none
Patch for landing
none
Patch for landing none

Description Ryosuke Niwa 2016-01-21 14:53:02 PST
HTMLConstructionSite::createElementFromSavedToken is only called on a stack item which in m_activeFormattingElements.
It shouldn't have the code to create a non-HTML element.
Comment 1 Ryosuke Niwa 2016-01-21 15:01:19 PST
Created attachment 269499 [details]
Clenaup
Comment 2 Chris Dumez 2016-01-21 16:35:35 PST
Comment on attachment 269499 [details]
Clenaup

View in context: https://bugs.webkit.org/attachment.cgi?id=269499&action=review

r=me with comments.

> Source/WebCore/html/parser/HTMLConstructionSite.cpp:623
> +    setAttributes(element.ptr(), token, m_parserContentPolicy);

Looks like setAttributes() should take a reference. It'd be nice to do it in this patch if the change is not too large.

> Source/WebCore/html/parser/HTMLConstructionSite.cpp:655
> +    return element.releaseNonNull();

HTMLElementFactory::createElement() actually returns a Ref<> so you should change the element variable type above and simply return element here.

> Source/WebCore/html/parser/HTMLConstructionSite.cpp:660
>      RefPtr<Element> element;

Should be dropped.
Comment 3 Ryosuke Niwa 2016-01-21 18:09:08 PST
Created attachment 269527 [details]
Patch for landing
Comment 4 WebKit Commit Bot 2016-01-21 18:10:18 PST
Comment on attachment 269527 [details]
Patch for landing

Rejecting attachment 269527 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-03', 'validate-changelog', '--check-oops', '--non-interactive', 269527, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

ChangeLog entry in Source/WebCore/ChangeLog contains OOPS!.

Full output: http://webkit-queues.webkit.org/results/723503
Comment 5 Ryosuke Niwa 2016-01-21 18:10:42 PST
Created attachment 269528 [details]
Patch for landing
Comment 6 WebKit Commit Bot 2016-01-21 18:11:33 PST
Comment on attachment 269528 [details]
Patch for landing

Rejecting attachment 269528 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'apply-attachment', '--no-update', '--non-interactive', 269528, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
WS/WebKit

Parsed 4 diffs from patch file(s).
patching file Source/WebCore/ChangeLog
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file Source/WebCore/ChangeLog.rej
patching file Source/WebCore/html/parser/HTMLConstructionSite.cpp
patching file Source/WebCore/html/parser/HTMLConstructionSite.h
patching file Source/WebCore/html/parser/HTMLTreeBuilder.cpp

Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Full output: http://webkit-queues.webkit.org/results/723509
Comment 7 Ryosuke Niwa 2016-01-21 18:14:29 PST
Created attachment 269529 [details]
Patch for landing
Comment 8 WebKit Commit Bot 2016-01-21 18:17:35 PST
Comment on attachment 269529 [details]
Patch for landing

Rejecting attachment 269529 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'build', '--no-clean', '--no-update', '--build-style=release', '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
.dia -c /Volumes/Data/EWS/WebKit/Source/WebCore/html/parser/TextDocumentParser.cpp -o /Volumes/Data/EWS/WebKit/WebKitBuild/WebCore.build/Release/WebCore.build/Objects-normal/x86_64/TextDocumentParser.o

** BUILD FAILED **


The following build commands failed:
	CompileC /Volumes/Data/EWS/WebKit/WebKitBuild/WebCore.build/Release/WebCore.build/Objects-normal/x86_64/HTMLConstructionSite.o html/parser/HTMLConstructionSite.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

Full output: http://webkit-queues.webkit.org/results/723533
Comment 9 Ryosuke Niwa 2016-01-21 18:58:51 PST
Created attachment 269539 [details]
Patch for landing
Comment 10 WebKit Commit Bot 2016-01-21 19:47:48 PST
Comment on attachment 269539 [details]
Patch for landing

Clearing flags on attachment: 269539

Committed r195438: <http://trac.webkit.org/changeset/195438>
Comment 11 WebKit Commit Bot 2016-01-21 19:47:54 PST
All reviewed patches have been landed.  Closing bug.