Changeset 46440 in webkit


Ignore:
Timestamp:
Jul 27, 2009 4:21:44 PM (15 years ago)
Author:
eric@webkit.org
Message:

2009-07-27 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.

prototypes-inheritance-2.html should crawl more types
https://bugs.webkit.org/show_bug.cgi?id=27741

Now we evaluate the crawl targets lazily so as not to skew any JS binding caching with our test ordering.
We could get around all caching by always instantiating a new copy of the frame
but that would be super-slow. :)

We're now crawling a bunch more types, all of which we pass.

  • fast/dom/prototype-inheritance-2-expected.txt:
  • fast/dom/resources/prototype-inheritance-2.js: (evalToCrawlObject.LazyEvalCrawlObject): (evalToCrawlObject): (pushPropertyValuesWithUnseenTypes): (crawl):
Location:
trunk/LayoutTests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r46437 r46440  
     12009-07-27  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        prototypes-inheritance-2.html should crawl more types
     6        https://bugs.webkit.org/show_bug.cgi?id=27741
     7
     8        Now we evaluate the crawl targets lazily so as not to skew any JS binding caching with our test ordering.
     9        We could get around all caching by always instantiating a new copy of the frame
     10        but that would be super-slow. :)
     11
     12        We're now crawling a bunch more types, all of which we pass.
     13
     14        * fast/dom/prototype-inheritance-2-expected.txt:
     15        * fast/dom/resources/prototype-inheritance-2.js:
     16        (evalToCrawlObject.LazyEvalCrawlObject):
     17        (evalToCrawlObject):
     18        (pushPropertyValuesWithUnseenTypes):
     19        (crawl):
     20
    1212009-07-27  Ojan Vafai  <ojan@chromium.org>
    222
  • trunk/LayoutTests/fast/dom/prototype-inheritance-2-expected.txt

    r46348 r46440  
    1111PASS BarInfoPrototype from inner.menubar.__proto__
    1212FAIL Boolean from inner.offscreenBuffering
    13 PASS CSSRuleList from inner.document.styleSheets.0.cssRules
     13PASS CSSCharsetRule from inner.document.getElementById("dummyStyle").sheet.cssRules.0
     14PASS CSSCharsetRuleConstructor from inner.document.getElementById("dummyStyle").sheet.cssRules.0.constructor
     15PASS CSSCharsetRulePrototype from inner.document.getElementById("dummyStyle").sheet.cssRules.0.__proto__
     16PASS CSSFontFaceRule from inner.document.getElementById("dummyStyle").sheet.cssRules.3
     17PASS CSSFontFaceRuleConstructor from inner.document.getElementById("dummyStyle").sheet.cssRules.3.constructor
     18PASS CSSFontFaceRulePrototype from inner.document.getElementById("dummyStyle").sheet.cssRules.3.__proto__
     19PASS CSSImportRule from inner.document.getElementById("dummyStyle").sheet.cssRules.1
     20PASS CSSImportRuleConstructor from inner.document.getElementById("dummyStyle").sheet.cssRules.1.constructor
     21PASS CSSImportRulePrototype from inner.document.getElementById("dummyStyle").sheet.cssRules.1.__proto__
     22PASS CSSMediaRule from inner.document.getElementById("dummyStyle").sheet.cssRules.2
     23PASS CSSMediaRuleConstructor from inner.document.getElementById("dummyStyle").sheet.cssRules.2.constructor
     24PASS CSSMediaRulePrototype from inner.document.getElementById("dummyStyle").sheet.cssRules.2.__proto__
     25PASS CSSPrimitiveValue from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(background-clip)
     26PASS CSSPrimitiveValueConstructor from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(background-clip).constructor
     27PASS CSSPrimitiveValuePrototype from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(background-clip).__proto__
     28PASS CSSRuleList from inner.document.getElementById("dummyStyle").sheet.cssRules
    1429PASS CSSRuleListConstructor from inner.document.styleSheets.0.rules.constructor
    1530PASS CSSRuleListPrototype from inner.document.styleSheets.0.cssRules.__proto__
    16 PASS CSSStyleDeclaration from inner.document.scripts.0.style
     31PASS CSSRulePrototype from inner.document.getElementById("dummyStyle").sheet.cssRules.0.__proto__.__proto__
     32PASS CSSStyleDeclaration from inner.document.getElementById("styledSpan").style
    1733PASS CSSStyleDeclarationConstructor from inner.document.activeElement.style.constructor
    1834PASS CSSStyleDeclarationPrototype from inner.document.scripts.0.style.__proto__
     35PASS CSSStyleRule from inner.document.getElementById("dummyStyle").sheet.cssRules.4
     36PASS CSSStyleRuleConstructor from inner.document.getElementById("dummyStyle").sheet.cssRules.4.constructor
     37PASS CSSStyleRulePrototype from inner.document.getElementById("dummyStyle").sheet.cssRules.4.__proto__
    1938PASS CSSStyleSheet from inner.document.styleSheets.0
    2039PASS CSSStyleSheetConstructor from inner.document.styleSheets.0.constructor
    2140PASS CSSStyleSheetPrototype from inner.document.styleSheets.0.__proto__
    22 PASS CharacterDataPrototype from inner.document.activeElement.attributes.0.lastChild.__proto__.__proto__
     41PASS CSSValue from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(-webkit-animation-timing-function).0
     42PASS CSSValueConstructor from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(-webkit-animation-timing-function).0.constructor
     43PASS CSSValueList from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(-webkit-transition-timing-function)
     44PASS CSSValueListConstructor from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(background-position).constructor
     45PASS CSSValueListPrototype from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(-webkit-transition-timing-function).__proto__
     46PASS CSSValuePrototype from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(background-clip).__proto__.__proto__
     47FAIL CanvasPattern from inner.document.getElementsByTagName("canvas")[0].getContext("2d").createPattern(inner.document.getElementsByTagName("img")[0], "")
     48FAIL CanvasPatternPrototype from inner.document.getElementsByTagName("canvas")[0].getContext("2d").createPattern(inner.document.getElementsByTagName("img")[0], "").__proto__
     49PASS CanvasRenderingContext2D from inner.document.getElementsByTagName("canvas")[0].getContext("2d")
     50PASS CanvasRenderingContext2DConstructor from inner.document.getElementsByTagName("canvas")[0].getContext("2d").constructor
     51PASS CanvasRenderingContext2DPrototype from inner.document.getElementsByTagName("canvas")[0].getContext("2d").__proto__
     52PASS CharacterDataPrototype from inner.document.activeElement.childNodes.61.__proto__.__proto__
     53PASS ClientRect from inner.document.body.getBoundingClientRect()
     54PASS ClientRectConstructor from inner.document.body.getBoundingClientRect().constructor
     55PASS ClientRectList from inner.document.body.getClientRects()
     56PASS ClientRectListConstructor from inner.document.body.getClientRects().constructor
     57PASS ClientRectListPrototype from inner.document.body.getClientRects().__proto__
     58PASS ClientRectPrototype from inner.document.body.getBoundingClientRect().__proto__
    2359PASS Collection from inner.document.forms.testForm
     60PASS Comment from inner.document.activeElement.lastElementChild.previousElementSibling.previousSibling
     61PASS CommentConstructor from inner.document.activeElement.childNodes.61.constructor
     62PASS CommentPrototype from inner.document.activeElement.childNodes.61.__proto__
    2463PASS Console from inner.console
    2564PASS ConsolePrototype from inner.console.__proto__
     65PASS Counter from inner.document.getElementById("styledSpan").style.getPropertyCSSValue("content")[0].getCounterValue()
     66PASS CounterConstructor from inner.document.getElementById("styledSpan").style.getPropertyCSSValue("content")[0].getCounterValue().constructor
     67PASS CounterPrototype from inner.document.getElementById("styledSpan").style.getPropertyCSSValue("content")[0].getCounterValue().__proto__
    2668PASS DOMApplicationCache from inner.applicationCache
    2769PASS DOMApplicationCachePrototype from inner.applicationCache.__proto__
     
    3577PASS DataGridColumnListPrototype from inner.document.activeElement.childNodes.14.columns.__proto__
    3678PASS DocumentPrototype from inner.document.__proto__.__proto__
    37 PASS ElementPrototype from inner.document.activeElement.__proto__.__proto__.__proto__
     79PASS ElementPrototype from inner.document.activeElement.lastElementChild.__proto__.__proto__
    3880FAIL Function from inner.document.location.pathname.constructor
    3981PASS HTMLAnchorElement from inner.document.activeElement.firstElementChild
     
    67109PASS HTMLCanvasElementConstructor from inner.document.activeElement.childNodes.10.constructor
    68110PASS HTMLCanvasElementPrototype from inner.document.activeElement.childNodes.10.__proto__
    69 PASS HTMLCollection from inner.document.links
     111FAIL HTMLCollection from inner.document.testForm
    70112PASS HTMLCollectionPrototype from inner.document.activeElement.childNodes.47.options.__proto__
    71113PASS HTMLDListElement from inner.document.activeElement.childNodes.11
     
    81123PASS HTMLDocumentConstructor from inner.document.constructor
    82124PASS HTMLDocumentPrototype from inner.document.__proto__
    83 PASS HTMLElement from inner.document.scripts.0.previousElementSibling
    84 PASS HTMLElementConstructor from inner.document.scripts.0.previousElementSibling.constructor
    85 PASS HTMLElementPrototype from inner.document.activeElement.__proto__.__proto__
     125PASS HTMLElement from inner.document.activeElement.lastElementChild
     126PASS HTMLElementConstructor from inner.document.activeElement.lastElementChild.constructor
     127PASS HTMLElementPrototype from inner.document.activeElement.lastElementChild.__proto__
    86128PASS HTMLEmbedElement from inner.document.plugins.0
    87129PASS HTMLEmbedElementConstructor from inner.document.plugins.0.constructor
     
    93135PASS HTMLFontElementConstructor from inner.document.activeElement.childNodes.19.constructor
    94136PASS HTMLFontElementPrototype from inner.document.activeElement.childNodes.19.__proto__
    95 PASS HTMLFormElement from inner.document.activeElement.lastElementChild
    96 PASS HTMLFormElementConstructor from inner.document.activeElement.lastElementChild.constructor
    97 PASS HTMLFormElementPrototype from inner.document.activeElement.lastElementChild.__proto__
     137PASS HTMLFormElement from inner.document.activeElement.childNodes.59
     138PASS HTMLFormElementConstructor from inner.document.forms.0.constructor
     139PASS HTMLFormElementPrototype from inner.document.forms.0.__proto__
    98140PASS HTMLFrameSetElement from inner.document.activeElement.childNodes.21
    99141PASS HTMLFrameSetElementConstructor from inner.document.activeElement.childNodes.21.constructor
     
    114156PASS HTMLImageElementConstructor from inner.document.images.0.constructor
    115157PASS HTMLImageElementPrototype from inner.document.images.0.__proto__
    116 PASS HTMLInputElement from inner.document.activeElement.childNodes.26
     158FAIL HTMLInputElement from inner.document.testForm[0].testInput
    117159PASS HTMLInputElementConstructor from inner.document.activeElement.childNodes.26.constructor
    118160PASS HTMLInputElementPrototype from inner.document.activeElement.childNodes.26.__proto__
     
    170212PASS HTMLSelectElementConstructor from inner.document.scripts.0.nextElementSibling.constructor
    171213PASS HTMLSelectElementPrototype from inner.document.activeElement.childNodes.47.__proto__
    172 PASS HTMLStyleElement from inner.document.activeElement.childNodes.48
    173 PASS HTMLStyleElementConstructor from inner.document.activeElement.childNodes.48.constructor
    174 PASS HTMLStyleElementPrototype from inner.document.activeElement.childNodes.48.__proto__
     214PASS HTMLStyleElement from inner.document.activeElement.lastElementChild.previousElementSibling
     215PASS HTMLStyleElementConstructor from inner.document.activeElement.lastElementChild.previousElementSibling.constructor
     216PASS HTMLStyleElementPrototype from inner.document.activeElement.lastElementChild.previousElementSibling.__proto__
    175217PASS HTMLTableCaptionElement from inner.document.activeElement.childNodes.49
    176218PASS HTMLTableCaptionElementConstructor from inner.document.activeElement.childNodes.49.constructor
     
    221263PASS NodePrototype from inner.document.__proto__.__proto__.__proto__
    222264FAIL Number from inner.pageXOffset
    223 PASS Object from inner.document.forms.testForm.__proto__
     265PASS Object from inner.document.location.__proto__.__proto__
    224266PASS Plugin from inner.clientInformation.mimeTypes.0.enabledPlugin
    225267PASS PluginArray from inner.clientInformation.plugins
     
    228270PASS PluginConstructor from inner.clientInformation.plugins.0.constructor
    229271PASS PluginPrototype from inner.clientInformation.mimeTypes.0.enabledPlugin.__proto__
     272PASS RGBColor from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(fill).rgbColor
     273PASS RGBColorConstructor from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(fill).rgbColor.constructor
     274PASS RGBColorPrototype from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(fill).rgbColor.__proto__
     275PASS Rect from inner.document.getElementById("styledSpan").style.getPropertyCSSValue("clip").getRectValue()
     276PASS RectConstructor from inner.document.getElementById("styledSpan").style.getPropertyCSSValue("clip").getRectValue().constructor
     277PASS RectPrototype from inner.document.getElementById("styledSpan").style.getPropertyCSSValue("clip").getRectValue().__proto__
     278PASS SVGColorPrototype from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(fill).__proto__.__proto__
     279PASS SVGPaint from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(fill)
     280PASS SVGPaintConstructor from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(fill).constructor
     281PASS SVGPaintPrototype from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(fill).__proto__
    230282PASS Screen from inner.screen
    231283PASS ScreenPrototype from inner.screen.__proto__
     
    233285PASS StorageConstructor from inner.localStorage.constructor
    234286PASS StoragePrototype from inner.localStorage.__proto__
    235 FAIL String from inner.name
     287FAIL String from inner.document.location.pathname
    236288PASS StyleSheetList from inner.document.styleSheets
    237289PASS StyleSheetListConstructor from inner.document.styleSheets.constructor
     
    239291PASS StyleSheetPrototype from inner.document.styleSheets.0.__proto__.__proto__
    240292PASS Text from inner.document.activeElement.attributes.0.firstChild
    241 PASS TextConstructor from inner.document.activeElement.attributes.0.lastChild.constructor
    242 PASS TextPrototype from inner.document.activeElement.attributes.0.lastChild.__proto__
     293PASS TextConstructor from inner.document.activeElement.lastElementChild.previousElementSibling.lastChild.constructor
     294PASS TextPrototype from inner.document.activeElement.lastElementChild.previousElementSibling.lastChild.__proto__
    243295PASS TimeRanges from inner.document.activeElement.childNodes.3.played
    244296PASS TimeRangesPrototype from inner.document.activeElement.childNodes.3.played.__proto__
    245297PASS ValidityState from inner.document.plugins.0.nextElementSibling.validity
    246298PASS ValidityStatePrototype from inner.document.plugins.0.nextElementSibling.validity.__proto__
     299PASS WebKitCSSKeyframeRule from inner.document.getElementById("dummyStyle").sheet.cssRules.5.0
     300PASS WebKitCSSKeyframeRuleConstructor from inner.document.getElementById("dummyStyle").sheet.cssRules.5.0.constructor
     301PASS WebKitCSSKeyframeRulePrototype from inner.document.getElementById("dummyStyle").sheet.cssRules.5.0.__proto__
     302PASS WebKitCSSKeyframesRule from inner.document.getElementById("dummyStyle").sheet.cssRules.5
     303PASS WebKitCSSKeyframesRuleConstructor from inner.document.getElementById("dummyStyle").sheet.cssRules.5.constructor
     304PASS WebKitCSSKeyframesRulePrototype from inner.document.getElementById("dummyStyle").sheet.cssRules.5.__proto__
    247305PASS XSLTProcessorConsructor from inner.XSLTProcessor
    248306Never found Audio
    249307Never found CDATASection
    250 Never found CSSCharsetRule
    251 Never found CSSFontFaceRule
    252 Never found CSSImportRule
    253 Never found CSSMediaRule
    254308Never found CSSPageRule
    255 Never found CSSPrimitiveValue
    256309Never found CSSRule
    257 Never found CSSStyleRule
    258 Never found CSSValue
    259 Never found CSSValueList
    260310Never found CSSVariablesDeclaration
    261311Never found CSSVariablesRule
    262 Never found CanvasRenderingContext2D
    263312Never found CharacterData
    264 Never found ClientRect
    265 Never found ClientRectList
    266313Never found Clipboard
    267 Never found Comment
    268 Never found Counter
    269314Never found DOMParser
    270315Never found Document
     
    295340Never found Option
    296341Never found ProcessingInstruction
    297 Never found RGBColor
    298342Never found Range
    299 Never found Rect
    300343Never found SVGAngle
    301344Never found SVGColor
     
    303346Never found SVGLength
    304347Never found SVGMarkerElement
    305 Never found SVGPaint
    306348Never found SVGPathSeg
    307349Never found SVGPreserveAspectRatio
     
    313355Never found StyleSheet
    314356Never found TextMetrics
    315 Never found WebKitCSSKeyframeRule
    316 Never found WebKitCSSKeyframesRule
    317357Never found WebKitCSSMatrix
    318358Never found WebKitCSSTransformValue
  • trunk/LayoutTests/fast/dom/resources/prototype-inheritance-2.js

    r46318 r46440  
    7474function evalToCrawlObject(path)
    7575{
    76     return makeCrawlObject(eval(path), path);
     76    // This allows us to add things to the end of the crawl list
     77    // without the early-eval changing the test results.
     78    function LazyEvalCrawlObject(path){
     79        this.valuePath = path;
     80        var value;
     81
     82        this.__defineGetter__("value", function(){
     83            if (!value)
     84                value = eval(this.valuePath);
     85            return value;
     86        });
     87    }
     88
     89    return new LazyEvalCrawlObject(path);
    7790}
    7891
     
    89102        var value = parentObject[property];
    90103        var valuePath = parentPath + "." + property;
     104        // CSSStyleDeclaration.item() just returns property names, but we want to crawl the actual CSS values
     105        if (parentType == "CSSStyleDeclaration" && parseInt(property)) { // This will skip 0, but that should be OK.
     106            valuePath = parentPath + ".getPropertyCSSValue(" + value + ")"
     107            value = parentObject.getPropertyCSSValue(value);
     108        }
    91109        var type = classNameForObject(value);
    92110        if (!type)
     
    101119}
    102120
    103 function crawl(toCrawl) {
    104     while (toCrawl.length) {
    105         var crawlTarget = toCrawl.shift();
    106         var object = crawlTarget.value;
    107         var type = classNameForObject(object);
    108         // If we've already seen an object of this type, and it's not a collection, ignore it.
    109         if (resultsByType[type] && !object.item && !object.length)
    110             continue;
    111 
    112         resultsByType[type] = makeCrawlObject(object.isInner, crawlTarget.valuePath);
    113         pushPropertyValuesWithUnseenTypes(toCrawl, object, crawlTarget.valuePath);
     121function crawl(crawlStarts) {
     122    while (crawlStarts.length) {
     123        var toCrawl = [crawlStarts.shift()];
     124        while (toCrawl.length) {
     125            var crawlTarget = toCrawl.shift();
     126            var object = crawlTarget.value;
     127            var type = classNameForObject(object);
     128            // If we've already seen an object of this type, and it's not a collection
     129            if (resultsByType[type] && !object.item && !object.length) {
     130                // Make sure this isn't a new failure before skipping it.
     131                if (object.isInner || object.isInner === resultsByType[type].value)
     132                    continue;
     133            }
     134
     135            resultsByType[type] = makeCrawlObject(object.isInner, crawlTarget.valuePath);
     136            pushPropertyValuesWithUnseenTypes(toCrawl, object, crawlTarget.valuePath);
     137        }
    114138    }
    115139}
     
    155179    htmlToAdd += "<" + tagName + "></" + tagName + ">";
    156180}
    157 htmlToAdd += "<form name='testForm'></form><form name='testForm'></form>";
     181htmlToAdd += "<form name='testForm'><input name='testInput'></form><form name='testForm'></form>";
     182htmlToAdd += "<!-- test -->";
     183styleContents = "@charset 'UTF-8';";
     184styleContents += "@import url('dummy.css') print;\n"; // Our parser seems to want this rule first?
     185styleContents += "@variables { Ignored: 2em; }\n"; // For when variables are turned back on
     186styleContents += "@page { margin: 3cm; }\n"; // Current WebKit ignores @page
     187styleContents += "@media print { body { margin: 3cm; } }\n"
     188styleContents += "@font-face {font-family:'Times';}\n";
     189styleContents += "ignored {font-family: var(Ignored);}\n"; // a CSSStyleRule
     190styleContents += "@-webkit-keyframes fade { 0% { opacity: 0; } }\n"; // a WebKitCSSKeyframesRule
     191
     192htmlToAdd += "<style id='dummyStyle'>" + styleContents + "</style>";
     193htmlToAdd += "<span id='styledSpan' style='clip: rect(0, 0, 1, 1); content: counter(dummy, square);'></span>";
     194
    158195inner.document.body.innerHTML = htmlToAdd;
    159196
    160 var toCrawl = [
     197var crawlStartPaths = [
    161198    evalToCrawlObject('inner.document.location'), // window.location is tested by other tests, so test document.location in this one.
     199    //evalToCrawlObject('inner.testForm'), // Causes many failures
    162200    evalToCrawlObject('inner.document.forms.testForm'), // NamedNodesCollection has the wrong prototype, test that.
    163201    evalToCrawlObject('inner'),
     202    evalToCrawlObject('inner.document.testForm'),
     203    evalToCrawlObject('inner.document.testForm[0].testInput'),
     204    evalToCrawlObject('inner.document.getElementsByTagName("canvas")[0].getContext("2d")'), // for CanvasRenderingContext2D
     205    evalToCrawlObject('inner.document.getElementsByTagName("canvas")[0].getContext("2d").createPattern(inner.document.getElementsByTagName("img")[0], "")'), // for CanvasRenderingContext2D
     206    evalToCrawlObject('inner.document.body.getClientRects()'), // For ClientRectList
     207    evalToCrawlObject('inner.document.body.getBoundingClientRect()'), // For ClientRect, getClientRects() returns an empty list for in our test, not sure why.
     208    evalToCrawlObject('inner.getComputedStyle(inner.document.body)'),
     209    evalToCrawlObject('inner.document.getElementById("dummyStyle").sheet.cssRules'), // For various CSSRule subclasses
     210    evalToCrawlObject('inner.document.getElementById("styledSpan").style'),
     211    evalToCrawlObject('inner.document.getElementById("styledSpan").style.getPropertyCSSValue("clip").getRectValue()'),
     212    evalToCrawlObject('inner.document.getElementById("styledSpan").style.getPropertyCSSValue("content")[0].getCounterValue()'),
    164213    // Can add more stuff to crawl here.
    165214];
    166 crawl(toCrawl);
     215
     216crawl(crawlStartPaths);
    167217var sortedTypes = propertiesOnObject(resultsByType).sort();
    168218
     
    191241}
    192242
    193 document.body.removeChild(subframe);
     243//document.body.removeChild(subframe);
    194244
    195245var successfullyParsed = true;
Note: See TracChangeset for help on using the changeset viewer.