Bug 144227 - Unexpected custom DOM wrapper property is undefined soon after it was assigned
Summary: Unexpected custom DOM wrapper property is undefined soon after it was assigned
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 144228
  Show dependency treegraph
 
Reported: 2015-04-26 10:50 PDT by Timothy Hatcher
Modified: 2022-02-11 14:09 PST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Hatcher 2015-04-26 10:50:30 PDT
TimelineRuler.js in the Web Inspector occasionally throws an exception and never records. The _labelElement property we add to a DOM node at the beginning of a loop body ends up being undefined at the end of the loop body. This smells like a JIT optimization bug to me since this code has always worked fine and only recently started happening. It is also very inconsistent on when it happens. Because it is so random when it happens, we haven't been able to pin point steps or make a reduction. Just resting the Inspector window, or zooming the Timeline in and out causes updateLayout to be called.

From the TimelineRuler updateLayout function:

        var dividerElement = this._headerElement.firstChild;
        for (var i = 0; i <= dividerCount; ++i) {
            if (!dividerElement) {
                dividerElement = document.createElement("div");
                dividerElement.className = WebInspector.TimelineRuler.DividerElementStyleClassName;
                this._headerElement.appendChild(dividerElement);

                var labelElement = document.createElement("div");
                labelElement.className = WebInspector.TimelineRuler.DividerLabelElementStyleClassName;
                dividerElement._labelElement = labelElement;
                dividerElement.appendChild(labelElement);
            }

            // ...

            var dividerTime = firstDividerTime + (sliceTime * i);

            // ...

            dividerElement._labelElement.textContent = isNaN(dividerTime) ? "" : Number.secondsToString(dividerTime - this._zeroTime, true);
            dividerElement = dividerElement.nextSibling;
        }

The exceptions happens on the second to last line in the loop. dividerElement._labelElement is undefined, but it should never be.
Comment 1 Radar WebKit Bug Importer 2015-04-26 10:50:45 PDT
<rdar://problem/20702089>