Bug 34018 - The infinite recursion detection logic in fast/dom/Window/window-properties.html does not work as expected
Summary: The infinite recursion detection logic in fast/dom/Window/window-properties.h...
Status: ASSIGNED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Jian Li
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-22 13:37 PST by Jian Li
Modified: 2010-06-10 20:40 PDT (History)
4 users (show)

See Also:


Attachments
Proposed Patch (781.02 KB, patch)
2010-01-22 15:34 PST, Jian Li
jianli: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jian Li 2010-01-22 13:37:32 PST
The infinite recursion detection logic in layout test fast/dom/Window/window-properties.html is kind of broken. It causes false alarms for those prototypes that have parent prototypes exposed.

For example, CSSStyleRule derives from CSSRule and both constructors are exposed in DOMWindow. When running the above layout test,  window.CSSStyleRule.prototype is dumped as the following:
    window.CSSStyleRule.prototype [printed above as window.CSSRule.prototype]

This is because the infinite recursion detection logic in this test relies on setting and checking the property with the fixed name "__visitedByLogValue__". Once it is set in the parent prototype element, it can be seen from the child prototype element and thus causes the early abortion when processing the child prototype element.

We should fix this logic in order to get the following output:
    window.CSSStyleRule.prototype [object CSSStyleRulePrototype]
    window.CSSStyleRule.prototype.CHARSET_RULE [number]
   ...

One possible fix is to add the value name into the name of the property used to check if it has been visited or not.
Comment 1 Jian Li 2010-01-22 15:34:38 PST
Created attachment 47238 [details]
Proposed Patch
Comment 2 Darin Adler 2010-01-22 17:25:01 PST
Comment on attachment 47238 [details]
Proposed Patch

Is this right? Over and over again all I see ATTRIBUTE_NODE on lots of prototypes. Do they really all have separate ATTRIBUTE_NODE properties.
Comment 3 Geoffrey Garen 2010-01-25 11:43:56 PST
A simpler way to fix this bug is to change "value.__visitedByLogValue__" to "value.hasOwnProperty("__visitedByLogValue__")".