<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>120297</bug_id>
          
          <creation_ts>2013-08-26 03:33:02 -0700</creation_ts>
          <short_desc>Need to check if some HTML child elements are HTMLUnknownElement</short_desc>
          <delta_ts>2013-10-05 08:00:33 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>120584</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Gyuyoung Kim">gyuyoung.kim</reporter>
          <assigned_to name="Darin Adler">darin</assigned_to>
          <cc>cdumez</cc>
    
    <cc>commit-queue</cc>
    
    <cc>darin</cc>
    
    <cc>esprehn+autocc</cc>
    
    <cc>ggaren</cc>
    
    <cc>gyuyoung.kim</cc>
    
    <cc>kangil.han</cc>
    
    <cc>kling</cc>
    
    <cc>rniwa</cc>
    
    <cc>xqhuang.webkit</cc>
    
    <cc>zan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>920949</commentid>
    <comment_count>0</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2013-08-26 03:33:02 -0700</bug_when>
    <thetext>As mentioned in https://bugs.webkit.org/show_bug.cgi?id=119951#c13, HTMLUnknownElement can own specific tag(e.g. audiotag, videoTag and so on) though it isn&apos;t correct element class. In this case, isHTMLXXXElement() returns &quot;true&quot; though it is HTMLUnknowElement.


PassRefPtr&lt;HTMLElement&gt; HTMLElementFactory::createHTMLElement(const QualifiedName&amp; qName, Document* document, HTMLFormElement* formElement, bool createdByParser)
{
    if (!document)
        return 0;

#if ENABLE(CUSTOM_ELEMENTS)
    if (document-&gt;registry()) {
        if (RefPtr&lt;CustomElementConstructor&gt; constructor = document-&gt;registry()-&gt;find(nullQName(), qName)) {
            RefPtr&lt;Element&gt; element = constructor-&gt;createElement();
            ASSERT(element-&gt;isHTMLElement());
            return static_pointer_cast&lt;HTMLElement&gt;(element.release());
        }
    }
#endif

    if (!gFunctionMap)
        createFunctionMap();
    if (ConstructorFunction function = gFunctionMap-&gt;get(qName.localName().impl())) {
        if (PassRefPtr&lt;HTMLElement&gt; element = function(qName, document, formElement, createdByParser))
            return element;
    }

    return HTMLUnknownElement::create(qName, document);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>920953</commentid>
    <comment_count>1</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2013-08-26 03:36:13 -0700</bug_when>
    <thetext>I wonder if we can add &quot;unknownTag&quot; for HTMLUnknownElement. Does anyone know if we can add it ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>920966</commentid>
    <comment_count>2</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2013-08-26 04:42:24 -0700</bug_when>
    <thetext>I was later thinking of simply checking that, for the problematic elements, the HTMLElement is not a HTMLUnknownElement:

inline bool isHTMLAudioElement(Node* node)
{
    return node-&gt;hasTagName(HTMLNames::audioTag) &amp;&amp; !toHTMLElement(node)-&gt;isHTMLUnknownElement();
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>920975</commentid>
    <comment_count>3</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2013-08-26 05:21:25 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; I was later thinking of simply checking that, for the problematic elements, the HTMLElement is not a HTMLUnknownElement:
&gt; 
&gt; inline bool isHTMLAudioElement(Node* node)
&gt; {
&gt;     return node-&gt;hasTagName(HTMLNames::audioTag) &amp;&amp; !toHTMLElement(node)-&gt;isHTMLUnknownElement();
&gt; }

Yes, I also think we can fix this issue by using it. However, it that case, we may need to add additional condition to many isHTMLXXXElement() functions. If we can&apos;t add unknownTag, it would be alternative solution. :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>920998</commentid>
    <comment_count>4</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2013-08-26 06:33:58 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; I was later thinking of simply checking that, for the problematic elements, the HTMLElement is not a HTMLUnknownElement:
&gt; &gt; 
&gt; &gt; inline bool isHTMLAudioElement(Node* node)
&gt; &gt; {
&gt; &gt;     return node-&gt;hasTagName(HTMLNames::audioTag) &amp;&amp; !toHTMLElement(node)-&gt;isHTMLUnknownElement();
&gt; &gt; }
&gt; 
&gt; Yes, I also think we can fix this issue by using it. However, it that case, we may need to add additional condition to many isHTMLXXXElement() functions. If we can&apos;t add unknownTag, it would be alternative solution. :)

It looks we can&apos;t add &quot;unknown&quot; attribute because it should own a tag which is defined in a page. Even if we define new &quot;unknown&quot; attribute, we make a new attribute without spec definition. So, I think we can fix this issue using adding additional condition to isHTMLXXXElement() functions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921007</commentid>
    <comment_count>5</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2013-08-26 06:50:04 -0700</bug_when>
    <thetext>The methods that need changing are not that many - only the ones that cast to an element of which the constructor in HTMLElementFactory can return 0.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921010</commentid>
    <comment_count>6</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2013-08-26 07:04:06 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; The methods that need changing are not that many - only the ones that cast to an element of which the constructor in HTMLElementFactory can return 0.

Yes, right. Even three HTMLElement classes only have isHTMLXXXElement() functions.

 - HTMLSourceElement.h
 - HTMLTrackElement.h
 - HTMLContentElement.h

I don&apos;t think we need to add isHTMLXXXElement() to other &quot;return 0&quot; classes which don&apos;t have the isHTMLXXXElement() in order to fix this problem at the moment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921018</commentid>
    <comment_count>7</comment_count>
      <attachid>209654</attachid>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2013-08-26 07:35:28 -0700</bug_when>
    <thetext>Created attachment 209654
Patch without test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921019</commentid>
    <comment_count>8</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2013-08-26 07:36:19 -0700</bug_when>
    <thetext>Let me try to add a test tomorrow.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921021</commentid>
    <comment_count>9</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2013-08-26 07:50:52 -0700</bug_when>
    <thetext>I&apos;ve posted one test case (for the audio element) back in bug #119951.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921024</commentid>
    <comment_count>10</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2013-08-26 08:04:10 -0700</bug_when>
    <thetext>(In reply to comment #9)
&gt; I&apos;ve posted one test case (for the audio element) back in bug #119951.

If you don&apos;t mind, can I use it ? I will add your name to ChangeLog as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921031</commentid>
    <comment_count>11</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2013-08-26 08:31:17 -0700</bug_when>
    <thetext>(In reply to comment #10)
&gt; (In reply to comment #9)
&gt; &gt; I&apos;ve posted one test case (for the audio element) back in bug #119951.
&gt; 
&gt; If you don&apos;t mind, can I use it ? I will add your name to ChangeLog as well.

Sure.

Test cases for other elements (source, track) should work pretty much the same. I haven&apos;t looked into how the crash with HTMLContentElement could be produced.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921040</commentid>
    <comment_count>12</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2013-08-26 09:29:40 -0700</bug_when>
    <thetext>There are 1305 uses of hasTagName() in WebKit. Are all of them wrong, since they might accidentally be true for an HTMLUnknownElement? What patch introduced this behavior?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921041</commentid>
    <comment_count>13</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2013-08-26 09:31:45 -0700</bug_when>
    <thetext>Patching this in just one or two places is probably the wrong solution, since it doesn&apos;t address the fundamental problem that any line of code that tests for tag name might allow an HTMLUnknownElement through.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921044</commentid>
    <comment_count>14</comment_count>
      <attachid>209654</attachid>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2013-08-26 09:43:47 -0700</bug_when>
    <thetext>Comment on attachment 209654
Patch without test case

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

&gt; Source/WebCore/html/HTMLSourceElement.h:-67
&gt; -    return element-&gt;hasTagName(HTMLNames::sourceTag);

We can only get an HTMLUnknownElement for sourceTag if VIDEO is disabled at compile time. Why not simply do:
#if (VIDEO)
    return element-&gt;hasTagName(HTMLNames::sourceTag)
#else
    UNUSED_PARAM(element);
    return false;
#endif

&gt; Source/WebCore/html/HTMLTrackElement.h:102
&gt; +    return node-&gt;hasTagName(HTMLNames::trackTag) &amp;&amp; !toHTMLElement(node)-&gt;isHTMLUnknownElement();

Ditto with VIDEO_TRACK flag

&gt; Source/WebCore/html/HTMLTrackElement.h:107
&gt; +    return element-&gt;hasTagName(HTMLNames::trackTag) &amp;&amp; !toHTMLElement(element)-&gt;isHTMLUnknownElement();

Ditto</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921050</commentid>
    <comment_count>15</comment_count>
      <attachid>209654</attachid>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2013-08-26 09:58:41 -0700</bug_when>
    <thetext>Comment on attachment 209654
Patch without test case

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

&gt;&gt; Source/WebCore/html/HTMLSourceElement.h:-67
&gt;&gt; -    return element-&gt;hasTagName(HTMLNames::sourceTag);
&gt; 
&gt; We can only get an HTMLUnknownElement for sourceTag if VIDEO is disabled at compile time. Why not simply do:
&gt; #if (VIDEO)
&gt;     return element-&gt;hasTagName(HTMLNames::sourceTag)
&gt; #else
&gt;     UNUSED_PARAM(element);
&gt;     return false;
&gt; #endif

BTW, this looks like a good reason to generate those isXXXElement functions. It is bug prone otherwise.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921289</commentid>
    <comment_count>16</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2013-08-26 18:57:17 -0700</bug_when>
    <thetext>(In reply to comment #13)
&gt; Patching this in just one or two places is probably the wrong solution, since it doesn&apos;t address the fundamental problem that any line of code that tests for tag name might allow an HTMLUnknownElement through.

I wanted to solve this issue by fixing root cause. So, I thought that HTMLUnknownElement() needs to have own tag name in order to do fix it. However, it looks it is spec violation. In this case, problem is that HTMLUnknownElement can have valid element. (It only can have audioTag, sourceTag, trackTag, videoTag, contentElement and dialogTag.)

Then, how about setting qName as null as below ?, or do you think we can define new tag for this case ?

if (ConstructorFunction function = gFunctionMap-&gt;get(qName.localName().impl())) {
    if (PassRefPtr&lt;HTMLElement&gt; element = function(qName, document, formElement, createdByParser))
        return element;
    else
        qName = 0 or new tag;
}

return HTMLUnknownElement::create(qName, document);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921292</commentid>
    <comment_count>17</comment_count>
      <attachid>209654</attachid>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2013-08-26 19:05:04 -0700</bug_when>
    <thetext>Comment on attachment 209654
Patch without test case

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

&gt;&gt;&gt; Source/WebCore/html/HTMLSourceElement.h:-67
&gt;&gt;&gt; -    return element-&gt;hasTagName(HTMLNames::sourceTag);
&gt;&gt; 
&gt;&gt; We can only get an HTMLUnknownElement for sourceTag if VIDEO is disabled at compile time. Why not simply do:
&gt;&gt; #if (VIDEO)
&gt;&gt;     return element-&gt;hasTagName(HTMLNames::sourceTag)
&gt;&gt; #else
&gt;&gt;     UNUSED_PARAM(element);
&gt;&gt;     return false;
&gt;&gt; #endif
&gt; 
&gt; BTW, this looks like a good reason to generate those isXXXElement functions. It is bug prone otherwise.

We need to consider HTMLElementFactory return 0 with a tag. However, it looks some ctor functions can return 0 when the macro is enabled at compile time. So, It don&apos;t think we can avoid this problem when using ENABLE() macro.

In WebKitBuild/Release/DerivedSources/WebCore/HTMLElementFactory.cpp

#if ENABLE(SHADOW_DOM)

static PassRefPtr&lt;HTMLElement&gt; contentConstructor(const QualifiedName&amp; tagName, Document* document, HTMLFormElement*, bool)
{
    if (!RuntimeEnabledFeatures::shadowDOMEnabled())
        return 0;
    return HTMLContentElement::create(tagName, document);
}

#endif

#if ENABLE(DIALOG_ELEMENT)

static PassRefPtr&lt;HTMLElement&gt; dialogConstructor(const QualifiedName&amp; tagName, Document* document, HTMLFormElement*, bool)
{
    if (!ContextFeatures::dialogElementEnabled(document))
        return 0;
    return HTMLDialogElement::create(tagName, document);
}

#endif

#if ENABLE(VIDEO)

static PassRefPtr&lt;HTMLElement&gt; sourceConstructor(const QualifiedName&amp; tagName, Document* document, HTMLFormElement*, bool)
{
    Settings* settings = document-&gt;settings();
    if (!MediaPlayer::isAvailable() || (settings &amp;&amp; !settings-&gt;mediaEnabled()))
        return 0;

    return HTMLSourceElement::create(tagName, document);
}

#endif

...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921332</commentid>
    <comment_count>18</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2013-08-26 21:26:21 -0700</bug_when>
    <thetext>(In reply to comment #16)
 
&gt; Then, how about setting qName as null as below ?, or do you think we can define new tag for this case ?
&gt; 
&gt; if (ConstructorFunction function = gFunctionMap-&gt;get(qName.localName().impl())) {
&gt;     if (PassRefPtr&lt;HTMLElement&gt; element = function(qName, document, formElement, createdByParser))
&gt;         return element;
&gt;     else
&gt;         qName = 0 or new tag;
&gt; }
&gt; 
&gt; return HTMLUnknownElement::create(qName, document);

qName can&apos;t be changed because it is const. So, we may try to return HTMLUnknownElement with a null QualifiedName() as below,

    else
        return HTMLUnknownElement::create(QualifiedName(nullAtom, nullAtom, nullAtom), document);


    return HTMLUnknownElement::create(qName, document);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921342</commentid>
    <comment_count>19</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2013-08-26 23:53:27 -0700</bug_when>
    <thetext>(In reply to comment #17)
&gt; (From update of attachment 209654 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=209654&amp;action=review
&gt; 
&gt; &gt;&gt;&gt; Source/WebCore/html/HTMLSourceElement.h:-67
&gt; &gt;&gt;&gt; -    return element-&gt;hasTagName(HTMLNames::sourceTag);
&gt; &gt;&gt; 
&gt; &gt;&gt; We can only get an HTMLUnknownElement for sourceTag if VIDEO is disabled at compile time. Why not simply do:
&gt; &gt;&gt; #if (VIDEO)
&gt; &gt;&gt;     return element-&gt;hasTagName(HTMLNames::sourceTag)
&gt; &gt;&gt; #else
&gt; &gt;&gt;     UNUSED_PARAM(element);
&gt; &gt;&gt;     return false;
&gt; &gt;&gt; #endif
&gt; &gt; 
&gt; &gt; BTW, this looks like a good reason to generate those isXXXElement functions. It is bug prone otherwise.
&gt; 
&gt; We need to consider HTMLElementFactory return 0 with a tag. However, it looks some ctor functions can return 0 when the macro is enabled at compile time. So, It don&apos;t think we can avoid this problem when using ENABLE() macro.
&gt; 
&gt; In WebKitBuild/Release/DerivedSources/WebCore/HTMLElementFactory.cpp
&gt; 
&gt; #if ENABLE(SHADOW_DOM)
&gt; 
&gt; static PassRefPtr&lt;HTMLElement&gt; contentConstructor(const QualifiedName&amp; tagName, Document* document, HTMLFormElement*, bool)
&gt; {
&gt;     if (!RuntimeEnabledFeatures::shadowDOMEnabled())
&gt;         return 0;
&gt;     return HTMLContentElement::create(tagName, document);
&gt; }
&gt; 
&gt; #endif
&gt; 
&gt; #if ENABLE(DIALOG_ELEMENT)
&gt; 
&gt; static PassRefPtr&lt;HTMLElement&gt; dialogConstructor(const QualifiedName&amp; tagName, Document* document, HTMLFormElement*, bool)
&gt; {
&gt;     if (!ContextFeatures::dialogElementEnabled(document))
&gt;         return 0;
&gt;     return HTMLDialogElement::create(tagName, document);
&gt; }
&gt; 
&gt; #endif
&gt; 
&gt; #if ENABLE(VIDEO)
&gt; 
&gt; static PassRefPtr&lt;HTMLElement&gt; sourceConstructor(const QualifiedName&amp; tagName, Document* document, HTMLFormElement*, bool)
&gt; {
&gt;     Settings* settings = document-&gt;settings();
&gt;     if (!MediaPlayer::isAvailable() || (settings &amp;&amp; !settings-&gt;mediaEnabled()))
&gt;         return 0;
&gt; 
&gt;     return HTMLSourceElement::create(tagName, document);
&gt; }
&gt; 
&gt; #endif
&gt; 
&gt; ...

Right, is some cases the feature is enabled at runtime, not simply compile time. However, since this factory is generated, this means we already have all the information we need to generate the isHTML*Element() functions, rignt?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921343</commentid>
    <comment_count>20</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2013-08-27 00:02:24 -0700</bug_when>
    <thetext>(In reply to comment #19)
&gt; 
&gt; Right, is some cases the feature is enabled at runtime, not simply compile time. However, since this factory is generated, this means we already have all the information we need to generate the isHTML*Element() functions, rignt?

I&apos;m not sure if we should generate isHTML*Element() for all tags at the moment. However, I think we need to support isHTML*Element() for &apos;return 0&apos; ctor at least.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921344</commentid>
    <comment_count>21</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2013-08-27 00:13:24 -0700</bug_when>
    <thetext>(In reply to comment #20)
&gt; (In reply to comment #19)
&gt; &gt; 
&gt; &gt; Right, is some cases the feature is enabled at runtime, not simply compile time. However, since this factory is generated, this means we already have all the information we need to generate the isHTML*Element() functions, rignt?
&gt; 
&gt; I&apos;m not sure if we should generate isHTML*Element() for all tags at the moment. However, I think we need to support isHTML*Element() for &apos;return 0&apos; ctor at least.

Can you explain why you don&apos;t want to generate them?

From what I can see, the isHTML*Element() functions code needs to match what is in an already generated file (the HTMLElementFactory). Since we are able to generate the HTMLElementFactory already, it should be trivial to generate the isHTML*Element() functions. However, doing this work manually seems risky, bug prone and difficult to maintain.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921345</commentid>
    <comment_count>22</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2013-08-27 00:20:52 -0700</bug_when>
    <thetext>(In reply to comment #21)
&gt; (In reply to comment #20)
&gt; &gt; (In reply to comment #19)
&gt; &gt; &gt; 
&gt; &gt; &gt; Right, is some cases the feature is enabled at runtime, not simply compile time. However, since this factory is generated, this means we already have all the information we need to generate the isHTML*Element() functions, rignt?
&gt; &gt; 
&gt; &gt; I&apos;m not sure if we should generate isHTML*Element() for all tags at the moment. However, I think we need to support isHTML*Element() for &apos;return 0&apos; ctor at least.
&gt; 
&gt; Can you explain why you don&apos;t want to generate them?

There was concerns when we contributed isFooElement() to blink.

One is some C++ Element subclasses represent multiple tag names. e.g. HTMLQuoteElement represents &lt;blockquote&gt; and &lt;q&gt;, however, hasTagName(blockquoteTag) and hasTagName(qTag) are not always checked together. We can&apos;t replace all of hasTagName(blockquoteTag) with isHTMLQuoteElement()

Other is to add &quot;#include &quot;FooElement.h&quot; cause unnecessary dependency. HTML parser should avoid to depend on C++ element implementation class if possible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921348</commentid>
    <comment_count>23</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2013-08-27 00:38:57 -0700</bug_when>
    <thetext>(In reply to comment #22)
&gt; (In reply to comment #21)
&gt; &gt; (In reply to comment #20)
&gt; &gt; &gt; (In reply to comment #19)
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; Right, is some cases the feature is enabled at runtime, not simply compile time. However, since this factory is generated, this means we already have all the information we need to generate the isHTML*Element() functions, rignt?
&gt; &gt; &gt; 
&gt; &gt; &gt; I&apos;m not sure if we should generate isHTML*Element() for all tags at the moment. However, I think we need to support isHTML*Element() for &apos;return 0&apos; ctor at least.
&gt; &gt; 
&gt; &gt; Can you explain why you don&apos;t want to generate them?
&gt; 
&gt; There was concerns when we contributed isFooElement() to blink.
&gt; 
&gt; One is some C++ Element subclasses represent multiple tag names. e.g. HTMLQuoteElement represents &lt;blockquote&gt; and &lt;q&gt;, however, hasTagName(blockquoteTag) and hasTagName(qTag) are not always checked together. We can&apos;t replace all of hasTagName(blockquoteTag) with isHTMLQuoteElement()

This seems like an argument not to use the isHTML*Element() in some cases, not an argument against generating the isHTML*Element() functions. I mean, does this statement ever affect the code you write for isHTML*Element()?

&gt; Other is to add &quot;#include &quot;FooElement.h&quot; cause unnecessary dependency. HTML parser should avoid to depend on C++ element implementation class if possible.

Actually, if you generate those isHTML*element() functions, they will likely all be in the same file. e.g. HTMLElementHelpers.h or something like that. And as far as I can see, this file would not need to include any FooElement.h, only HTMLNames.h and likely RuntimeEnabledFeatures.h.

And again, if we don&apos;t want to add include in one place, well, we don&apos;t have to use the generated isHTML*Element() functions. The fact that they are generated and available does not mandate that you need to use them everywhere.

I am adding a few people in CC as I am curious what WebKit people think about generating these.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921361</commentid>
    <comment_count>24</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2013-08-27 01:01:58 -0700</bug_when>
    <thetext>I&apos;m all for generating the is*Element() and to*Element() functions. Since there are elements for which these helpers are not required, perhaps we could specifically annotate the elements in HTMLTagNames.in that should have them generated.

I guess similar could be done for the SVG elements, in svgtags.in.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921365</commentid>
    <comment_count>25</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2013-08-27 01:13:44 -0700</bug_when>
    <thetext>(In reply to comment #24)
&gt; I&apos;m all for generating the is*Element() and to*Element() functions. Since there are elements for which these helpers are not required, perhaps we could specifically annotate the elements in HTMLTagNames.in that should have them generated.

If we can specify which element needs to have isFooElement() or toFooElement(), we may generate the needed isFooElement() and toFooElement().
 
&gt; I guess similar could be done for the SVG elements, in svgtags.in.

If we can adjust the generation into HTML elements, IMHO, we can do it on SVG as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921377</commentid>
    <comment_count>26</comment_count>
      <attachid>209726</attachid>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2013-08-27 01:48:40 -0700</bug_when>
    <thetext>Created attachment 209726
WIP suggestion according to comment #18</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921382</commentid>
    <comment_count>27</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2013-08-27 01:50:39 -0700</bug_when>
    <thetext>(In reply to comment #26)
&gt; Created an attachment (id=209726) [details]
&gt; WIP suggestion according to comment #18

I would like to know how do you think to use this suggestion instead of modifying isHTML*Element().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921398</commentid>
    <comment_count>28</comment_count>
      <attachid>209726</attachid>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2013-08-27 02:19:42 -0700</bug_when>
    <thetext>Comment on attachment 209726
WIP suggestion according to comment #18

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

&gt; Source/WebCore/dom/make_names.pl:955
&gt; +            return $parameters{fallbackInterfaceName}::create(QualifiedName(nullAtom, nullAtom, nullAtom), document);

what does the factory code look like with this change? It is not obvious for me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921450</commentid>
    <comment_count>29</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2013-08-27 05:08:48 -0700</bug_when>
    <thetext>(In reply to comment #28)
&gt; (From update of attachment 209726 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=209726&amp;action=review
&gt; 
&gt; &gt; Source/WebCore/dom/make_names.pl:955
&gt; &gt; +            return $parameters{fallbackInterfaceName}::create(QualifiedName(nullAtom, nullAtom, nullAtom), document);
&gt; 
&gt; what does the factory code look like with this change? It is not obvious for me.

In HTMLElementFactory::createHTMLElement(), the factory function creates new element. However, as I said many times, some creation functions can return 0. In that case, element is null. then the factory function returns a HTMLUnknownElement instance with valid tags(e.g. audioTag, videoTag, trackTag and so on)

    if (ConstructorFunction function = gFunctionMap-&gt;get(qName.localName().impl())) {
        if (PassRefPtr&lt;HTMLElement&gt; element = function(qName, document, formElement, createdByParser))
            return element;
    }

    return HTMLUnknownElement::create(qName, document);

// audioConstructor
static PassRefPtr&lt;HTMLElement&gt; audioConstructor(const QualifiedName&amp; tagName, Document* document, HTMLFormElement*, bool createdByParser)             
{
    Settings* settings = document-&gt;settings();
    if (!MediaPlayer::isAvailable() || (settings &amp;&amp; !settings-&gt;mediaEnabled()))
        return 0; // audioConstructor may return 0.


My second suggestion is that we return HTMLUnknownElement with null tag name because this isn&apos;t an unknown situation. This case is that element creation is failed. So, my suggestion is to consider to return HTMLUnknownElement() with null tag.

As far as I understand, HTMLUnknownElement supports tags out of specification, for example, &lt;foo1&gt;&lt;/foo1&gt;, &lt;stupid&gt;&lt;/stupid&gt; and so on. But, this case is not the situation for it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>923644</commentid>
    <comment_count>30</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2013-09-02 03:11:25 -0700</bug_when>
    <thetext>Bug #120584 is working on generating the is*Element() checks. I think we should work on top of that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>923647</commentid>
    <comment_count>31</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2013-09-02 03:29:59 -0700</bug_when>
    <thetext>(In reply to comment #30)
&gt; Bug #120584 is working on generating the is*Element() checks. I think we should work on top of that.

ok, let&apos;s work on this after landing it. BTW, current test case doesn&apos;t make a crash on EFL port. I&apos;m taking a look it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>932089</commentid>
    <comment_count>32</comment_count>
    <who name="Xueqing Huang">xqhuang.webkit</who>
    <bug_when>2013-09-23 02:43:39 -0700</bug_when>
    <thetext>(In reply to comment #31)
&gt; (In reply to comment #30)
&gt; &gt; Bug #120584 is working on generating the is*Element() checks. I think we should work on top of that.
&gt; 
&gt; ok, let&apos;s work on this after landing it. BTW, current test case doesn&apos;t make a crash on EFL port. I&apos;m taking a look it.

Windows port could reproduce the crash caused by this issue.
HTMLUnknownElement override |isHTMLUnknownElement| and return true, I suggest check whether an element was a HTMLUnknownElement or not via isHTMLUnknownElement in |isHTML*Element()|. e.g:
bool isHTMLAudioElement(const Element&amp; element) { 
    return element.hasTagName(HTMLNames::audioTag) &amp;&amp; !isHTMLUnknownElement(element);
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>932091</commentid>
    <comment_count>33</comment_count>
    <who name="Xueqing Huang">xqhuang.webkit</who>
    <bug_when>2013-09-23 02:45:04 -0700</bug_when>
    <thetext>*** Bug 121537 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>932164</commentid>
    <comment_count>34</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2013-09-23 09:32:59 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; I was later thinking of simply checking that, for the problematic elements, the HTMLElement is not a HTMLUnknownElement:
&gt; 
&gt; inline bool isHTMLAudioElement(Node* node)
&gt; {
&gt;     return node-&gt;hasTagName(HTMLNames::audioTag) &amp;&amp; !toHTMLElement(node)-&gt;isHTMLUnknownElement();
&gt; }

Yes, I think this is exactly what we want to do, only for the elements that can be affected by this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>932166</commentid>
    <comment_count>35</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2013-09-23 09:34:11 -0700</bug_when>
    <thetext>(In reply to comment #29)
&gt; However, as I said many times, some creation functions can return 0. In that case, element is null.

Exactly. We will need code to check for unknown elements in the isXXX function for any of the creation functions that can return nullptr.

And we should minimize our use of this technique. It’s not really a good pattern.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>935790</commentid>
    <comment_count>36</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2013-10-03 08:49:27 -0700</bug_when>
    <thetext>Hmm, crash doesn&apos;t occurs on existing test. It looks this crash was fixed indirectly. I will check if this crash is really fixed. Can anyone reproduce this crash now ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>935918</commentid>
    <comment_count>37</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2013-10-03 12:35:06 -0700</bug_when>
    <thetext>I don’t see evidence that the isHTMLAudioElement function has been fixed. The script that generates constructors and isHTMLAudioElement functions still seems to be checking MediaPlayer::isAvailable and settings &amp;&amp; !settings-&gt;mediaEnabled() in the audio element constructor and in the audio element createWrapper function, but not in the isHTMLAudioElement function. From what I see from code inspection, this still needs to be fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>935960</commentid>
    <comment_count>38</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2013-10-03 13:57:19 -0700</bug_when>
    <thetext>I can still reproduce this crash on the GTK port with running the test case I&apos;ve attached in bug #119951 through either DumpRenderTree or WebKitTestRunner. Things basically go FUBAR when WebCore::JSNodeOwner::isReachableFromOpaqueRoots is reached during the GC and the isHTMLAudioElement() check returns a false positive in the isReachableFromDOM function.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>936169</commentid>
    <comment_count>39</comment_count>
      <attachid>213353</attachid>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2013-10-04 06:03:42 -0700</bug_when>
    <thetext>Created attachment 213353
WIP</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>936171</commentid>
    <comment_count>40</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2013-10-04 06:08:47 -0700</bug_when>
    <thetext>First of all, sorry for too late update. BTW, I&apos;m suspecting if we need to return a fallback element when MediaPlayer isn&apos;t available. Besides there was a similar patch for V8 binding.

https://bugs.webkit.org/show_bug.cgi?id=103431

Unfortunately, I have a reproduce problem because of my env problem. I will re-submit a new patch after fixing my env problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>936531</commentid>
    <comment_count>41</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2013-10-05 00:02:32 -0700</bug_when>
    <thetext>I’ll fix this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>936533</commentid>
    <comment_count>42</comment_count>
      <attachid>213445</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2013-10-05 00:22:30 -0700</bug_when>
    <thetext>Created attachment 213445
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>936534</commentid>
    <comment_count>43</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-10-05 00:24:59 -0700</bug_when>
    <thetext>Attachment 213445 did not pass style-queue:

Failed to run &quot;[&apos;Tools/Scripts/check-webkit-style&apos;, &apos;--diff-files&apos;, u&apos;Source/WebCore/ChangeLog&apos;, u&apos;Source/WebCore/dom/make_names.pl&apos;, u&apos;Source/WebCore/html/HTMLElement.h&apos;]&quot; exit_code: 1
Source/WebCore/html/HTMLElement.h:147:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>936542</commentid>
    <comment_count>44</comment_count>
      <attachid>213445</attachid>
    <who name="Andreas Kling">kling</who>
    <bug_when>2013-10-05 00:53:17 -0700</bug_when>
    <thetext>Comment on attachment 213445
Patch

r=me
The previous patch on this bug had a layout test. We should make sure to add it as well, assuming it works.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>936558</commentid>
    <comment_count>45</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2013-10-05 06:48:58 -0700</bug_when>
    <thetext>Darin, please land after fixing style error.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>936559</commentid>
    <comment_count>46</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2013-10-05 06:52:13 -0700</bug_when>
    <thetext>(In reply to comment #45)
&gt; Darin, please land after fixing style error.

That’s not a style error. That’s the style script incorrectly complaining about an include that is not not part of the normal includes at the top of the file.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>936560</commentid>
    <comment_count>47</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2013-10-05 06:52:53 -0700</bug_when>
    <thetext>(In reply to comment #44)
&gt; The previous patch on this bug had a layout test. We should make sure to add it as well, assuming it works.

I’ll add the layout test and check that it demonstrates the bug before I land.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>936569</commentid>
    <comment_count>48</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2013-10-05 08:00:33 -0700</bug_when>
    <thetext>Committed r156953: &lt;http://trac.webkit.org/changeset/156953&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>209654</attachid>
            <date>2013-08-26 07:35:28 -0700</date>
            <delta_ts>2013-08-27 01:48:31 -0700</delta_ts>
            <desc>Patch without test case</desc>
            <filename>bug-120297-20130826233527.patch</filename>
            <type>text/plain</type>
            <size>3646</size>
            <attacher name="Gyuyoung Kim">gyuyoung.kim</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTU0NT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RWxlbWVudChjb25zdCBOb2RlKiBu
b2RlKQogewogICAgIEFTU0VSVChub2RlKTsKLSAgICByZXR1cm4gbm9kZS0+aXNJbnNlcnRpb25Q
b2ludCgpICYmIHRvSW5zZXJ0aW9uUG9pbnQobm9kZSktPmluc2VydGlvblBvaW50VHlwZSgpID09
IEluc2VydGlvblBvaW50OjpIVE1MQ29udGVudEVsZW1lbnRUeXBlOworICAgIHJldHVybiBub2Rl
LT5pc0luc2VydGlvblBvaW50KCkgJiYgdG9JbnNlcnRpb25Qb2ludChub2RlKS0+aW5zZXJ0aW9u
UG9pbnRUeXBlKCkgPT0gSW5zZXJ0aW9uUG9pbnQ6OkhUTUxDb250ZW50RWxlbWVudFR5cGUgJiYg
IXRvSFRNTEVsZW1lbnQobm9kZSktPmlzSFRNTFVua25vd25FbGVtZW50KCk7CiB9CiAKIGlubGlu
ZSBIVE1MQ29udGVudEVsZW1lbnQqIHRvSFRNTENvbnRlbnRFbGVtZW50KE5vZGUqIG5vZGUpCg==
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>209726</attachid>
            <date>2013-08-27 01:48:40 -0700</date>
            <delta_ts>2013-10-04 06:03:30 -0700</delta_ts>
            <desc>WIP suggestion according to comment #18</desc>
            <filename>bug-120297-20130827174839.patch</filename>
            <type>text/plain</type>
            <size>3991</size>
            <attacher name="Gyuyoung Kim">gyuyoung.kim</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTU0NjY0CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggZTUzYmQxZDZhZDAwNjdl
NmQxMjhkOWI1ZTZhZmEwNjg4ZDI5OWE5MC4uOGRlNTAxOTQ4OTU1ODVmZjI4ZTRlYzc1NjQ0ZmZk
MzcwMTFhNzBkNyAxMDA2NDQKLS0tIGEvU291cm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worICAgIHNvdXJjZUVsZW1lbnQgPSBudWxsOworCisgICAg
aWYgKHdpbmRvdy5HQ0NvbnRyb2xsZXIpCisgICAgICAgIEdDQ29udHJvbGxlci5jb2xsZWN0KCk7
Cit9CisKK2Z1bmN0aW9uIGRpYWxvZ1Rlc3QoKSB7CisgICAgaWYgKHdpbmRvdy5pbnRlcm5hbHMp
CisgICAgICAgIHdpbmRvdy5pbnRlcm5hbHMuc2V0dGluZ3Muc2V0RGlhbG9nRWxlbWVudEVuYWJs
ZWQoZmFsc2UpOworCisgICAgdmFyIGRpYWxvZ0VsZW1lbnQgPSBkb2N1bWVudC5jcmVhdGVFbGVt
ZW50KCJkaWFsb2ciKTsKKyAgICBkaWFsb2dFbGVtZW50ID0gbnVsbDsKKworICAgIGlmICh3aW5k
b3cuR0NDb250cm9sbGVyKQorICAgICAgICBHQ0NvbnRyb2xsZXIuY29sbGVjdCgpOworfQorCitm
dW5jdGlvbiBydW5UZXN0KCkgeworICAgIGlmICh3aW5kb3cudGVzdFJ1bm5lcikKKyAgICAgICAg
dGVzdFJ1bm5lci5kdW1wQXNUZXh0KCk7CisKKyAgICBtZWRpYVRlc3QoKTsKKyAgICBkaWFsb2dU
ZXN0KCk7Cit9Cis8L3NjcmlwdD4KKzwvaGVhZD4KKzxib2R5IG9ubG9hZD0icnVuVGVzdCgpIj4K
K1RoZSB0ZXN0IHBhc3NlcyBpZiBpdCBkb2Vzbid0IGNyYXNoLgorPC9ib2R5PgorPC9odG1sPgor
Cg==
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>213353</attachid>
            <date>2013-10-04 06:03:42 -0700</date>
            <delta_ts>2013-10-05 00:22:24 -0700</delta_ts>
            <desc>WIP</desc>
            <filename>bug-120297-20131004220341.patch</filename>
            <type>text/plain</type>
            <size>3998</size>
            <attacher name="Gyuyoung Kim">gyuyoung.kim</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTU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yYXNoLgorPC9ib2R5Pgor
PC9odG1sPgo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>213445</attachid>
            <date>2013-10-05 00:22:30 -0700</date>
            <delta_ts>2013-10-05 00:53:17 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-120297-20131005002229.patch</filename>
            <type>text/plain</type>
            <size>5350</size>
            <attacher name="Darin Adler">darin</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTU2OTQ4CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggYTU2YmRlYWY1ZjYxNDVl
Zjg0MGU0YjE0NDQ4NTExMDI1NmYzZjAzZS4uNTEzMzg0YWUwNzNiNWNkYzQxNjExNGYzZjNkZWVm
Njg1NzAxOTk4MCAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDI0IEBACisyMDEzLTEwLTA1ICBEYXJp
biBBZGxlciAgPGRhcmluQGFwcGxlLmNvbT4KKworICAgICAgICBOZWVkIHRvIGNoZWNrIGlmIHNv
bWUgSFRNTCBjaGlsZCBlbGVtZW50cyBhcmUgSFRNTFVua25vd25FbGVtZW50CisgICAgICAgIGh0
dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0xMjAyOTcKKworICAgICAgICBS
ZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICAqIGRvbS9tYWtlX25hbWVzLnBs
OgorICAgICAgICAocHJpbnRDb25zdHJ1Y3RvckludGVyaW9yKTogQWRkZWQgYWRkaXRpb25hbCBj
b21tZW50cyBhYm91dCB0aGUKKyAgICAgICAgd3JhcHBlck9ubHlJZk1lZ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gICAgICAgICAgOwogICAgICAgICB9IGVsc2lmICgkZW5hYmxlZFRhZ3N7JHRhZ05h
bWV9e3J1bnRpbWVDb25kaXRpb25hbH0pIHsKICAgICAgICAgICAgIG15ICRydW50aW1lQ29uZGl0
aW9uYWwgPSAkZW5hYmxlZFRhZ3N7JHRhZ05hbWV9e3J1bnRpbWVDb25kaXRpb25hbH07CiAgICAg
ICAgICAgICBwcmludCBGIDw8RU5ECmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9odG1sL0hU
TUxFbGVtZW50LmggYi9Tb3VyY2UvV2ViQ29yZS9odG1sL0hUTUxFbGVtZW50LmgKaW5kZXggY2Uz
ZGYzNTA5MmI2MWNkM2NiODA1YTZmNzlhYzE1NzdlNWY0OGE3My4uNmNlYTRkODZiZDBjMTI2MzMz
YWQyOTM2MWFiZDJkMGQ2YjNhN2MxNyAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvaHRtbC9I
VE1MRWxlbWVudC5oCisrKyBiL1NvdXJjZS9XZWJDb3JlL2h0bWwvSFRNTEVsZW1lbnQuaApAQCAt
MjUsOCArMjUsNiBAQAogCiAjaW5jbHVkZSAiU3R5bGVkRWxlbWVudC5oIgogCi0jaW5jbHVkZSAi
SFRNTEVsZW1lbnRUeXBlSGVscGVycy5oIgotCiBuYW1lc3BhY2UgV2ViQ29yZSB7CiAKIGNsYXNz
IERvY3VtZW50RnJhZ21lbnQ7CkBAIC0xNDYsNCArMTQ0LDYgQEAgRUxFTUVOVF9UWVBFX0NBU1RT
KEhUTUxFbGVtZW50KQogCiB9IC8vIG5hbWVzcGFjZSBXZWJDb3JlCiAKKyNpbmNsdWRlICJIVE1M
RWxlbWVudFR5cGVIZWxwZXJzLmgiCisKICNlbmRpZiAvLyBIVE1MRWxlbWVudF9oCg==
</data>
<flag name="review"
          id="235810"
          type_id="1"
          status="+"
          setter="kling"
    />
          </attachment>
      

    </bug>

</bugzilla>