[webkit-reviews] review granted: [Bug 123949] Hoist <template> to head when found between </head> and <body> for consistency with <script> : [Attachment 217404] Tweaked the change log a little

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 20 16:47:51 PST 2013


Antti Koivisto <koivisto at iki.fi> has granted Ryosuke Niwa <rniwa at webkit.org>'s
request for review:
Bug 123949: Hoist <template> to head when found between </head> and <body> for
consistency with <script>
https://bugs.webkit.org/show_bug.cgi?id=123949

Attachment 217404: Tweaked the change log a little
https://bugs.webkit.org/attachment.cgi?id=217404&action=review

------- Additional Comments from Antti Koivisto <koivisto at iki.fi>
View in context: https://bugs.webkit.org/attachment.cgi?id=217404&action=review


> Source/WebCore/html/parser/HTMLTreeBuilder.cpp:1644
> +#if ENABLE(TEMPLATE_ELEMENT)
> +	       if (isParsingFragment())
> +#else
> +	       ASSERT(isParsingFragment());
> +#endif
> +		   item =
HTMLStackItem::create(m_fragmentContext.contextElement(),
HTMLStackItem::ItemForContextElement);

This is somewhat ugly. It is nicer to do something like this:

#if ENABLE(TEMPLATE_ELEMENT)
bool shouldCreateItem = isParsingFragment();
#else
ASSERT(isParsingFragment());
bool shouldCreateItem = true;
#endif
if (shouldCreateItem) ...


More information about the webkit-reviews mailing list