Changeset 46440 in webkit
- Timestamp:
- Jul 27, 2009 4:21:44 PM (15 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r46437 r46440 1 2009-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 1 21 2009-07-27 Ojan Vafai <ojan@chromium.org> 2 22 -
trunk/LayoutTests/fast/dom/prototype-inheritance-2-expected.txt
r46348 r46440 11 11 PASS BarInfoPrototype from inner.menubar.__proto__ 12 12 FAIL Boolean from inner.offscreenBuffering 13 PASS CSSRuleList from inner.document.styleSheets.0.cssRules 13 PASS CSSCharsetRule from inner.document.getElementById("dummyStyle").sheet.cssRules.0 14 PASS CSSCharsetRuleConstructor from inner.document.getElementById("dummyStyle").sheet.cssRules.0.constructor 15 PASS CSSCharsetRulePrototype from inner.document.getElementById("dummyStyle").sheet.cssRules.0.__proto__ 16 PASS CSSFontFaceRule from inner.document.getElementById("dummyStyle").sheet.cssRules.3 17 PASS CSSFontFaceRuleConstructor from inner.document.getElementById("dummyStyle").sheet.cssRules.3.constructor 18 PASS CSSFontFaceRulePrototype from inner.document.getElementById("dummyStyle").sheet.cssRules.3.__proto__ 19 PASS CSSImportRule from inner.document.getElementById("dummyStyle").sheet.cssRules.1 20 PASS CSSImportRuleConstructor from inner.document.getElementById("dummyStyle").sheet.cssRules.1.constructor 21 PASS CSSImportRulePrototype from inner.document.getElementById("dummyStyle").sheet.cssRules.1.__proto__ 22 PASS CSSMediaRule from inner.document.getElementById("dummyStyle").sheet.cssRules.2 23 PASS CSSMediaRuleConstructor from inner.document.getElementById("dummyStyle").sheet.cssRules.2.constructor 24 PASS CSSMediaRulePrototype from inner.document.getElementById("dummyStyle").sheet.cssRules.2.__proto__ 25 PASS CSSPrimitiveValue from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(background-clip) 26 PASS CSSPrimitiveValueConstructor from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(background-clip).constructor 27 PASS CSSPrimitiveValuePrototype from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(background-clip).__proto__ 28 PASS CSSRuleList from inner.document.getElementById("dummyStyle").sheet.cssRules 14 29 PASS CSSRuleListConstructor from inner.document.styleSheets.0.rules.constructor 15 30 PASS CSSRuleListPrototype from inner.document.styleSheets.0.cssRules.__proto__ 16 PASS CSSStyleDeclaration from inner.document.scripts.0.style 31 PASS CSSRulePrototype from inner.document.getElementById("dummyStyle").sheet.cssRules.0.__proto__.__proto__ 32 PASS CSSStyleDeclaration from inner.document.getElementById("styledSpan").style 17 33 PASS CSSStyleDeclarationConstructor from inner.document.activeElement.style.constructor 18 34 PASS CSSStyleDeclarationPrototype from inner.document.scripts.0.style.__proto__ 35 PASS CSSStyleRule from inner.document.getElementById("dummyStyle").sheet.cssRules.4 36 PASS CSSStyleRuleConstructor from inner.document.getElementById("dummyStyle").sheet.cssRules.4.constructor 37 PASS CSSStyleRulePrototype from inner.document.getElementById("dummyStyle").sheet.cssRules.4.__proto__ 19 38 PASS CSSStyleSheet from inner.document.styleSheets.0 20 39 PASS CSSStyleSheetConstructor from inner.document.styleSheets.0.constructor 21 40 PASS CSSStyleSheetPrototype from inner.document.styleSheets.0.__proto__ 22 PASS CharacterDataPrototype from inner.document.activeElement.attributes.0.lastChild.__proto__.__proto__ 41 PASS CSSValue from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(-webkit-animation-timing-function).0 42 PASS CSSValueConstructor from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(-webkit-animation-timing-function).0.constructor 43 PASS CSSValueList from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(-webkit-transition-timing-function) 44 PASS CSSValueListConstructor from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(background-position).constructor 45 PASS CSSValueListPrototype from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(-webkit-transition-timing-function).__proto__ 46 PASS CSSValuePrototype from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(background-clip).__proto__.__proto__ 47 FAIL CanvasPattern from inner.document.getElementsByTagName("canvas")[0].getContext("2d").createPattern(inner.document.getElementsByTagName("img")[0], "") 48 FAIL CanvasPatternPrototype from inner.document.getElementsByTagName("canvas")[0].getContext("2d").createPattern(inner.document.getElementsByTagName("img")[0], "").__proto__ 49 PASS CanvasRenderingContext2D from inner.document.getElementsByTagName("canvas")[0].getContext("2d") 50 PASS CanvasRenderingContext2DConstructor from inner.document.getElementsByTagName("canvas")[0].getContext("2d").constructor 51 PASS CanvasRenderingContext2DPrototype from inner.document.getElementsByTagName("canvas")[0].getContext("2d").__proto__ 52 PASS CharacterDataPrototype from inner.document.activeElement.childNodes.61.__proto__.__proto__ 53 PASS ClientRect from inner.document.body.getBoundingClientRect() 54 PASS ClientRectConstructor from inner.document.body.getBoundingClientRect().constructor 55 PASS ClientRectList from inner.document.body.getClientRects() 56 PASS ClientRectListConstructor from inner.document.body.getClientRects().constructor 57 PASS ClientRectListPrototype from inner.document.body.getClientRects().__proto__ 58 PASS ClientRectPrototype from inner.document.body.getBoundingClientRect().__proto__ 23 59 PASS Collection from inner.document.forms.testForm 60 PASS Comment from inner.document.activeElement.lastElementChild.previousElementSibling.previousSibling 61 PASS CommentConstructor from inner.document.activeElement.childNodes.61.constructor 62 PASS CommentPrototype from inner.document.activeElement.childNodes.61.__proto__ 24 63 PASS Console from inner.console 25 64 PASS ConsolePrototype from inner.console.__proto__ 65 PASS Counter from inner.document.getElementById("styledSpan").style.getPropertyCSSValue("content")[0].getCounterValue() 66 PASS CounterConstructor from inner.document.getElementById("styledSpan").style.getPropertyCSSValue("content")[0].getCounterValue().constructor 67 PASS CounterPrototype from inner.document.getElementById("styledSpan").style.getPropertyCSSValue("content")[0].getCounterValue().__proto__ 26 68 PASS DOMApplicationCache from inner.applicationCache 27 69 PASS DOMApplicationCachePrototype from inner.applicationCache.__proto__ … … 35 77 PASS DataGridColumnListPrototype from inner.document.activeElement.childNodes.14.columns.__proto__ 36 78 PASS DocumentPrototype from inner.document.__proto__.__proto__ 37 PASS ElementPrototype from inner.document.activeElement. __proto__.__proto__.__proto__79 PASS ElementPrototype from inner.document.activeElement.lastElementChild.__proto__.__proto__ 38 80 FAIL Function from inner.document.location.pathname.constructor 39 81 PASS HTMLAnchorElement from inner.document.activeElement.firstElementChild … … 67 109 PASS HTMLCanvasElementConstructor from inner.document.activeElement.childNodes.10.constructor 68 110 PASS HTMLCanvasElementPrototype from inner.document.activeElement.childNodes.10.__proto__ 69 PASS HTMLCollection from inner.document.links 111 FAIL HTMLCollection from inner.document.testForm 70 112 PASS HTMLCollectionPrototype from inner.document.activeElement.childNodes.47.options.__proto__ 71 113 PASS HTMLDListElement from inner.document.activeElement.childNodes.11 … … 81 123 PASS HTMLDocumentConstructor from inner.document.constructor 82 124 PASS HTMLDocumentPrototype from inner.document.__proto__ 83 PASS HTMLElement from inner.document. scripts.0.previousElementSibling84 PASS HTMLElementConstructor from inner.document. scripts.0.previousElementSibling.constructor85 PASS HTMLElementPrototype from inner.document.activeElement. __proto__.__proto__125 PASS HTMLElement from inner.document.activeElement.lastElementChild 126 PASS HTMLElementConstructor from inner.document.activeElement.lastElementChild.constructor 127 PASS HTMLElementPrototype from inner.document.activeElement.lastElementChild.__proto__ 86 128 PASS HTMLEmbedElement from inner.document.plugins.0 87 129 PASS HTMLEmbedElementConstructor from inner.document.plugins.0.constructor … … 93 135 PASS HTMLFontElementConstructor from inner.document.activeElement.childNodes.19.constructor 94 136 PASS HTMLFontElementPrototype from inner.document.activeElement.childNodes.19.__proto__ 95 PASS HTMLFormElement from inner.document.activeElement. lastElementChild96 PASS HTMLFormElementConstructor from inner.document. activeElement.lastElementChild.constructor97 PASS HTMLFormElementPrototype from inner.document. activeElement.lastElementChild.__proto__137 PASS HTMLFormElement from inner.document.activeElement.childNodes.59 138 PASS HTMLFormElementConstructor from inner.document.forms.0.constructor 139 PASS HTMLFormElementPrototype from inner.document.forms.0.__proto__ 98 140 PASS HTMLFrameSetElement from inner.document.activeElement.childNodes.21 99 141 PASS HTMLFrameSetElementConstructor from inner.document.activeElement.childNodes.21.constructor … … 114 156 PASS HTMLImageElementConstructor from inner.document.images.0.constructor 115 157 PASS HTMLImageElementPrototype from inner.document.images.0.__proto__ 116 PASS HTMLInputElement from inner.document.activeElement.childNodes.26 158 FAIL HTMLInputElement from inner.document.testForm[0].testInput 117 159 PASS HTMLInputElementConstructor from inner.document.activeElement.childNodes.26.constructor 118 160 PASS HTMLInputElementPrototype from inner.document.activeElement.childNodes.26.__proto__ … … 170 212 PASS HTMLSelectElementConstructor from inner.document.scripts.0.nextElementSibling.constructor 171 213 PASS HTMLSelectElementPrototype from inner.document.activeElement.childNodes.47.__proto__ 172 PASS HTMLStyleElement from inner.document.activeElement. childNodes.48173 PASS HTMLStyleElementConstructor from inner.document.activeElement. childNodes.48.constructor174 PASS HTMLStyleElementPrototype from inner.document.activeElement. childNodes.48.__proto__214 PASS HTMLStyleElement from inner.document.activeElement.lastElementChild.previousElementSibling 215 PASS HTMLStyleElementConstructor from inner.document.activeElement.lastElementChild.previousElementSibling.constructor 216 PASS HTMLStyleElementPrototype from inner.document.activeElement.lastElementChild.previousElementSibling.__proto__ 175 217 PASS HTMLTableCaptionElement from inner.document.activeElement.childNodes.49 176 218 PASS HTMLTableCaptionElementConstructor from inner.document.activeElement.childNodes.49.constructor … … 221 263 PASS NodePrototype from inner.document.__proto__.__proto__.__proto__ 222 264 FAIL Number from inner.pageXOffset 223 PASS Object from inner.document. forms.testForm.__proto__265 PASS Object from inner.document.location.__proto__.__proto__ 224 266 PASS Plugin from inner.clientInformation.mimeTypes.0.enabledPlugin 225 267 PASS PluginArray from inner.clientInformation.plugins … … 228 270 PASS PluginConstructor from inner.clientInformation.plugins.0.constructor 229 271 PASS PluginPrototype from inner.clientInformation.mimeTypes.0.enabledPlugin.__proto__ 272 PASS RGBColor from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(fill).rgbColor 273 PASS RGBColorConstructor from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(fill).rgbColor.constructor 274 PASS RGBColorPrototype from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(fill).rgbColor.__proto__ 275 PASS Rect from inner.document.getElementById("styledSpan").style.getPropertyCSSValue("clip").getRectValue() 276 PASS RectConstructor from inner.document.getElementById("styledSpan").style.getPropertyCSSValue("clip").getRectValue().constructor 277 PASS RectPrototype from inner.document.getElementById("styledSpan").style.getPropertyCSSValue("clip").getRectValue().__proto__ 278 PASS SVGColorPrototype from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(fill).__proto__.__proto__ 279 PASS SVGPaint from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(fill) 280 PASS SVGPaintConstructor from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(fill).constructor 281 PASS SVGPaintPrototype from inner.getComputedStyle(inner.document.body).getPropertyCSSValue(fill).__proto__ 230 282 PASS Screen from inner.screen 231 283 PASS ScreenPrototype from inner.screen.__proto__ … … 233 285 PASS StorageConstructor from inner.localStorage.constructor 234 286 PASS StoragePrototype from inner.localStorage.__proto__ 235 FAIL String from inner. name287 FAIL String from inner.document.location.pathname 236 288 PASS StyleSheetList from inner.document.styleSheets 237 289 PASS StyleSheetListConstructor from inner.document.styleSheets.constructor … … 239 291 PASS StyleSheetPrototype from inner.document.styleSheets.0.__proto__.__proto__ 240 292 PASS Text from inner.document.activeElement.attributes.0.firstChild 241 PASS TextConstructor from inner.document.activeElement. attributes.0.lastChild.constructor242 PASS TextPrototype from inner.document.activeElement. attributes.0.lastChild.__proto__293 PASS TextConstructor from inner.document.activeElement.lastElementChild.previousElementSibling.lastChild.constructor 294 PASS TextPrototype from inner.document.activeElement.lastElementChild.previousElementSibling.lastChild.__proto__ 243 295 PASS TimeRanges from inner.document.activeElement.childNodes.3.played 244 296 PASS TimeRangesPrototype from inner.document.activeElement.childNodes.3.played.__proto__ 245 297 PASS ValidityState from inner.document.plugins.0.nextElementSibling.validity 246 298 PASS ValidityStatePrototype from inner.document.plugins.0.nextElementSibling.validity.__proto__ 299 PASS WebKitCSSKeyframeRule from inner.document.getElementById("dummyStyle").sheet.cssRules.5.0 300 PASS WebKitCSSKeyframeRuleConstructor from inner.document.getElementById("dummyStyle").sheet.cssRules.5.0.constructor 301 PASS WebKitCSSKeyframeRulePrototype from inner.document.getElementById("dummyStyle").sheet.cssRules.5.0.__proto__ 302 PASS WebKitCSSKeyframesRule from inner.document.getElementById("dummyStyle").sheet.cssRules.5 303 PASS WebKitCSSKeyframesRuleConstructor from inner.document.getElementById("dummyStyle").sheet.cssRules.5.constructor 304 PASS WebKitCSSKeyframesRulePrototype from inner.document.getElementById("dummyStyle").sheet.cssRules.5.__proto__ 247 305 PASS XSLTProcessorConsructor from inner.XSLTProcessor 248 306 Never found Audio 249 307 Never found CDATASection 250 Never found CSSCharsetRule251 Never found CSSFontFaceRule252 Never found CSSImportRule253 Never found CSSMediaRule254 308 Never found CSSPageRule 255 Never found CSSPrimitiveValue256 309 Never found CSSRule 257 Never found CSSStyleRule258 Never found CSSValue259 Never found CSSValueList260 310 Never found CSSVariablesDeclaration 261 311 Never found CSSVariablesRule 262 Never found CanvasRenderingContext2D263 312 Never found CharacterData 264 Never found ClientRect265 Never found ClientRectList266 313 Never found Clipboard 267 Never found Comment268 Never found Counter269 314 Never found DOMParser 270 315 Never found Document … … 295 340 Never found Option 296 341 Never found ProcessingInstruction 297 Never found RGBColor298 342 Never found Range 299 Never found Rect300 343 Never found SVGAngle 301 344 Never found SVGColor … … 303 346 Never found SVGLength 304 347 Never found SVGMarkerElement 305 Never found SVGPaint306 348 Never found SVGPathSeg 307 349 Never found SVGPreserveAspectRatio … … 313 355 Never found StyleSheet 314 356 Never found TextMetrics 315 Never found WebKitCSSKeyframeRule316 Never found WebKitCSSKeyframesRule317 357 Never found WebKitCSSMatrix 318 358 Never found WebKitCSSTransformValue -
trunk/LayoutTests/fast/dom/resources/prototype-inheritance-2.js
r46318 r46440 74 74 function evalToCrawlObject(path) 75 75 { 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); 77 90 } 78 91 … … 89 102 var value = parentObject[property]; 90 103 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 } 91 109 var type = classNameForObject(value); 92 110 if (!type) … … 101 119 } 102 120 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); 121 function 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 } 114 138 } 115 139 } … … 155 179 htmlToAdd += "<" + tagName + "></" + tagName + ">"; 156 180 } 157 htmlToAdd += "<form name='testForm'></form><form name='testForm'></form>"; 181 htmlToAdd += "<form name='testForm'><input name='testInput'></form><form name='testForm'></form>"; 182 htmlToAdd += "<!-- test -->"; 183 styleContents = "@charset 'UTF-8';"; 184 styleContents += "@import url('dummy.css') print;\n"; // Our parser seems to want this rule first? 185 styleContents += "@variables { Ignored: 2em; }\n"; // For when variables are turned back on 186 styleContents += "@page { margin: 3cm; }\n"; // Current WebKit ignores @page 187 styleContents += "@media print { body { margin: 3cm; } }\n" 188 styleContents += "@font-face {font-family:'Times';}\n"; 189 styleContents += "ignored {font-family: var(Ignored);}\n"; // a CSSStyleRule 190 styleContents += "@-webkit-keyframes fade { 0% { opacity: 0; } }\n"; // a WebKitCSSKeyframesRule 191 192 htmlToAdd += "<style id='dummyStyle'>" + styleContents + "</style>"; 193 htmlToAdd += "<span id='styledSpan' style='clip: rect(0, 0, 1, 1); content: counter(dummy, square);'></span>"; 194 158 195 inner.document.body.innerHTML = htmlToAdd; 159 196 160 var toCrawl= [197 var crawlStartPaths = [ 161 198 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 162 200 evalToCrawlObject('inner.document.forms.testForm'), // NamedNodesCollection has the wrong prototype, test that. 163 201 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()'), 164 213 // Can add more stuff to crawl here. 165 214 ]; 166 crawl(toCrawl); 215 216 crawl(crawlStartPaths); 167 217 var sortedTypes = propertiesOnObject(resultsByType).sort(); 168 218 … … 191 241 } 192 242 193 document.body.removeChild(subframe);243 //document.body.removeChild(subframe); 194 244 195 245 var successfullyParsed = true;
Note: See TracChangeset
for help on using the changeset viewer.