<?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>33915</bug_id>
          
          <creation_ts>2010-01-20 11:29:45 -0800</creation_ts>
          <short_desc>Web Inspector: JavaScript Error in DOMAgent.js:375 (_attributesUpdated)</short_desc>
          <delta_ts>2010-02-08 15:45:12 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector (Deprecated)</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Brian Weinstein">bweinstein</reporter>
          <assigned_to name="Kelly Norton">knorton</assigned_to>
          <cc>bweinstein</cc>
    
    <cc>joepeck</cc>
    
    <cc>keishi</cc>
    
    <cc>pfeldman</cc>
    
    <cc>pmuellr</cc>
    
    <cc>rik</cc>
    
    <cc>timothy</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>182874</commentid>
    <comment_count>0</comment_count>
    <who name="Brian Weinstein">bweinstein</who>
    <bug_when>2010-01-20 11:29:45 -0800</bug_when>
    <thetext>I am getting a JavaScript error when I inspect the inspector, even when I haven&apos;t interacted with it.

STEPS TO REPRODUCE:
- Go to www.google.com
- Open the inspector [1]
- Open the inspector [2] of the first inspector [1]

There will be a JavaScript error in inspector[2].</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>183187</commentid>
    <comment_count>1</comment_count>
      <attachid>47117</attachid>
    <who name="Kelly Norton">knorton</who>
    <bug_when>2010-01-21 06:53:24 -0800</bug_when>
    <thetext>Created attachment 47117
Proposed fix.

The problem is due to the special treatment of the styleAttr. When InspectorDOMAgent calls Element::attributes to build a list of attributes, it ends up calling setAttribute for the styleAttr. This shows up in the InspectorDOMAgent as a spurious Attr modification. The fix is to ignore all attr modifications when m_synchronizingStyleAttribute is set.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>183548</commentid>
    <comment_count>2</comment_count>
      <attachid>47117</attachid>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2010-01-22 01:56:49 -0800</bug_when>
    <thetext>Comment on attachment 47117
Proposed fix.

The EWS seems to be saying that this breaks the build on mac. So r- for that, unless you know this is a false positive for some reason.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>183557</commentid>
    <comment_count>3</comment_count>
      <attachid>47117</attachid>
    <who name="Pavel Feldman">pfeldman</who>
    <bug_when>2010-01-22 02:06:58 -0800</bug_when>
    <thetext>Comment on attachment 47117
Proposed fix.

What exactly doesn&apos;t InspectorDOMAgent like? If it is a general issue such as &quot;re-entering agent&apos;s code synchronously when building script structures for nodes&quot;, I&apos;d rather fix it in InspectorDOMAgent itself. Just mute all the node-related mutation callbacks while building script objects.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>183607</commentid>
    <comment_count>4</comment_count>
    <who name="Kelly Norton">knorton</who>
    <bug_when>2010-01-22 05:20:41 -0800</bug_when>
    <thetext>I think this is a false positive, since I tested the change on mac. But I will double check.

Pavel:
The problem is that there is special handling of styleAttr in Element. It uses setAttribute to synchronize its own internal state whenever you ask for attributes. InspectorDOMAgent asks for the attributes of nodes causing setAttribute to be called for the style attribute.  The nice thing is that Element actually keeps a flag to indicate when it is doing internal synchronization. So it makes sense to not notify InspectorController when internal state is being synchronized. It would work to put a flag in InspectorDOMAgent, but we would be creating a different flag to track the same thing when Element should not have called InspectorController in the first place (since it knows the setAttribute is not legitimate). I don&apos;t think this one is a general re-entrency issue since it is reasonable to expect that calling Element::attributes should not cause attribute mutations.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>183617</commentid>
    <comment_count>5</comment_count>
    <who name="Pavel Feldman">pfeldman</who>
    <bug_when>2010-01-22 05:57:56 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; I think this is a false positive, since I tested the change on mac. But I will
&gt; double check.
&gt; 
&gt; Pavel:
&gt; The problem is that there is special handling of styleAttr in Element. It uses
&gt; setAttribute to synchronize its own internal state whenever you ask for
&gt; attributes. InspectorDOMAgent asks for the attributes of nodes causing
&gt; setAttribute to be called for the style attribute.  The nice thing is that
&gt; Element actually keeps a flag to indicate when it is doing internal
&gt; synchronization. So it makes sense to not notify InspectorController when
&gt; internal state is being synchronized. It would work to put a flag in
&gt; InspectorDOMAgent, but we would be creating a different flag to track the same
&gt; thing when Element should not have called InspectorController in the first
&gt; place (since it knows the setAttribute is not legitimate). I don&apos;t think this
&gt; one is a general re-entrency issue since it is reasonable to expect that
&gt; calling Element::attributes should not cause attribute mutations.

Ok, this sounds good provided that styleAttr is the only of a kind. I was afraid that there could be more active getters like this in operations like attributes, childNodes, etc. Having a single flag in DOM agent would cover all the cases that it is not ready for then.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>183693</commentid>
    <comment_count>6</comment_count>
      <attachid>47210</attachid>
    <who name="Kelly Norton">knorton</who>
    <bug_when>2010-01-22 10:28:25 -0800</bug_when>
    <thetext>Created attachment 47210
Updated patch (unchanged, trying again)

I&apos;ve tried to reproduce the mac build break locally and I&apos;ve been unable. So, I&apos;m going to resubmit this patch and see if the mac build goes green this time. If not, I&apos;ll track down the right people on irc to get the logs from the builder to see what is going wrong.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>183704</commentid>
    <comment_count>7</comment_count>
    <who name="Kelly Norton">knorton</who>
    <bug_when>2010-01-22 11:04:30 -0800</bug_when>
    <thetext>Mac failure was bogus, this patch is good for review.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>183871</commentid>
    <comment_count>8</comment_count>
    <who name="Kelly Norton">knorton</who>
    <bug_when>2010-01-22 16:38:32 -0800</bug_when>
    <thetext>http://trac.webkit.org/changeset/53736</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>47117</attachid>
            <date>2010-01-21 06:53:24 -0800</date>
            <delta_ts>2010-01-22 10:28:25 -0800</delta_ts>
            <desc>Proposed fix.</desc>
            <filename>Issue33915.diff</filename>
            <type>text/plain</type>
            <size>2054</size>
            <attacher name="Kelly Norton">knorton</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYkNvcmUvQ2hhbmdlTG9nIGIvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXgg
MjhmNzRlOC4uMjEzZTk5ZiAxMDA2NDQKLS0tIGEvV2ViQ29yZS9DaGFuZ2VMb2cKKysrIGIvV2Vi
Q29yZS9DaGFuZ2VMb2cKQEAgLTEsMyArMSwxNyBAQAorMjAxMC0wMS0yMSAgS2VsbHkgTm9ydG9u
ICA8a25vcnRvbkBnb29nbGUuY29tPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09Q
UyEpLgorCisgICAgICAgIFdlYiBJbnNwZWN0b3I6IEphdmFTY3JpcHQgRXJyb3IgaW4gRE9NQWdl
bnQuanM6Mzc1IChfYXR0cmlidXRlc1VwZGF0ZWQpCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJr
aXQub3JnL3Nob3dfYnVnLmNnaT9pZD0zMzkxNQorCisgICAgICAgIEVycm9ycyB3ZXJlIGNhdXNl
ZCBieSB0aGUgZmFjdCB0aGF0IEVsZW1lbnQ6OmF0dHJpYnV0ZXMgY2FsbHMgRWxlbWVudDo6c2V0
QXR0cmlidXRlIHRvCisgICAgICAgIHN5bmNocm9uaXplZCB0aGUgc3R5bGVB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AoSW5zcGVjdG9yQ29u
dHJvbGxlciogaW5zcGVjdG9yQ29udHJvbGxlciA9IHBhZ2UtPmluc3BlY3RvckNvbnRyb2xsZXIo
KSkgeworICAgICAgICAgICAgaWYgKCFtX3N5bmNocm9uaXppbmdTdHlsZUF0dHJpYnV0ZSkKKyAg
ICAgICAgICAgICAgICBpbnNwZWN0b3JDb250cm9sbGVyLT5kaWRNb2RpZnlET01BdHRyKHRoaXMp
OworICAgICAgICB9CiAgICAgfQogI2VuZGlmCiB9CkBAIC01NTksOCArNTYxLDEwIEBAIHZvaWQg
RWxlbWVudDo6c2V0QXR0cmlidXRlKGNvbnN0IFF1YWxpZmllZE5hbWUmIG5hbWUsIGNvbnN0IEF0
b21pY1N0cmluZyYgdmFsdWUsCiAKICNpZiBFTkFCTEUoSU5TUEVDVE9SKQogICAgIGlmIChQYWdl
KiBwYWdlID0gZG9jdW1lbnQoKS0+cGFnZSgpKSB7Ci0gICAgICAgIGlmIChJbnNwZWN0b3JDb250
cm9sbGVyKiBpbnNwZWN0b3JDb250cm9sbGVyID0gcGFnZS0+aW5zcGVjdG9yQ29udHJvbGxlcigp
KQotICAgICAgICAgICAgaW5zcGVjdG9yQ29udHJvbGxlci0+ZGlkTW9kaWZ5RE9NQXR0cih0aGlz
KTsKKyAgICAgICAgaWYgKEluc3BlY3RvckNvbnRyb2xsZXIqIGluc3BlY3RvckNvbnRyb2xsZXIg
PSBwYWdlLT5pbnNwZWN0b3JDb250cm9sbGVyKCkpIHsKKyAgICAgICAgICAgIGlmICghbV9zeW5j
aHJvbml6aW5nU3R5bGVBdHRyaWJ1dGUpCisgICAgICAgICAgICAgICAgaW5zcGVjdG9yQ29udHJv
bGxlci0+ZGlkTW9kaWZ5RE9NQXR0cih0aGlzKTsKKyAgICAgICAgfQogICAgIH0KICNlbmRpZgog
fQo=
</data>
<flag name="review"
          id="29505"
          type_id="1"
          status="+"
          setter="pfeldman"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>47210</attachid>
            <date>2010-01-22 10:28:25 -0800</date>
            <delta_ts>2010-02-08 15:45:12 -0800</delta_ts>
            <desc>Updated patch (unchanged, trying again)</desc>
            <filename>Issue33915.diff</filename>
            <type>text/plain</type>
            <size>2044</size>
            <attacher name="Kelly Norton">knorton</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYkNvcmUvQ2hhbmdlTG9nIGIvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXgg
NDRlZjU0Zi4uZTlmYjNmYiAxMDA2NDQKLS0tIGEvV2ViQ29yZS9DaGFuZ2VMb2cKKysrIGIvV2Vi
Q29yZS9DaGFuZ2VMb2cKQEAgLTEsMyArMSwxNyBAQAorMjAxMC0wMS0yMSAgS2VsbHkgTm9ydG9u
ICA8a25vcnRvbkBnb29nbGUuY29tPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09Q
UyEpLgorCisgICAgICAgIFdlYiBJbnNwZWN0b3I6IEphdmFTY3JpcHQgRXJyb3IgaW4gRE9NQWdl
bnQuanM6Mzc1IChfYXR0cmlidXRlc1VwZGF0ZWQpCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJr
aXQub3JnL3Nob3dfYnVnLmNnaT9pZD0zMzkxNQorCisgICAgICAgIEVycm9ycyB3ZXJlIGNhdXNl
ZCBieSB0aGUgZmFjdCB0aGF0IEVsZW1lbnQ6OmF0dHJpYnV0ZXMgY2FsbHMgRWxlbWVudDo6c2V0
QXR0cmlidXRlIHRvCisgICAgICAgIHN5bmNocm9uaXplZCB0aGUgc3R5bGVBdHRyLiBUaGUgZml4
IGlzIHRvIHNpbXBseSBjaGVjayB0aGUgc3luY2hyb25pemluZyBzdHlsZSBhdHRyaWJ1dGUKKyAg
ICAgICAgZmxhZy4KKworICAgICAgICAqIGRvbS9FbGVtZW50LmNwcDoKKyAgICAgICAgKFdlYkNv
cmU6OkVsZW1lbnQ6OnNldEF0dHJpYnV0Z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PTUF0dHIodGhpcyk7CisgICAgICAg
IH0KICAgICB9CiAjZW5kaWYKIH0KQEAgLTU1OSw4ICs1NjEsMTAgQEAgdm9pZCBFbGVtZW50Ojpz
ZXRBdHRyaWJ1dGUoY29uc3QgUXVhbGlmaWVkTmFtZSYgbmFtZSwgY29uc3QgQXRvbWljU3RyaW5n
JiB2YWx1ZSwKIAogI2lmIEVOQUJMRShJTlNQRUNUT1IpCiAgICAgaWYgKFBhZ2UqIHBhZ2UgPSBk
b2N1bWVudCgpLT5wYWdlKCkpIHsKLSAgICAgICAgaWYgKEluc3BlY3RvckNvbnRyb2xsZXIqIGlu
c3BlY3RvckNvbnRyb2xsZXIgPSBwYWdlLT5pbnNwZWN0b3JDb250cm9sbGVyKCkpCi0gICAgICAg
ICAgICBpbnNwZWN0b3JDb250cm9sbGVyLT5kaWRNb2RpZnlET01BdHRyKHRoaXMpOworICAgICAg
ICBpZiAoSW5zcGVjdG9yQ29udHJvbGxlciogaW5zcGVjdG9yQ29udHJvbGxlciA9IHBhZ2UtPmlu
c3BlY3RvckNvbnRyb2xsZXIoKSkgeworICAgICAgICAgICAgaWYgKCFtX3N5bmNocm9uaXppbmdT
dHlsZUF0dHJpYnV0ZSkKKyAgICAgICAgICAgICAgICBpbnNwZWN0b3JDb250cm9sbGVyLT5kaWRN
b2RpZnlET01BdHRyKHRoaXMpOworICAgICAgICB9CiAgICAgfQogI2VuZGlmCiB9Cg==
</data>
<flag name="review"
          id="29618"
          type_id="1"
          status="+"
          setter="pfeldman"
    />
    <flag name="commit-queue"
          id="29619"
          type_id="3"
          status="+"
          setter="eric"
    />
          </attachment>
      

    </bug>

</bugzilla>