Changeset 204166 in webkit
- Timestamp:
- Aug 5, 2016, 4:25:28 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r204165 r204166 1 2016-08-05 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r203935. 4 https://bugs.webkit.org/show_bug.cgi?id=160596 5 6 looks like a 1-2% PLUM regression on iPhone 6s (Requested by 7 kling_ on #webkit). 8 9 Reverted changeset: 10 11 "Window's named properties should be exposed on a 12 WindowProperties object in its prototype" 13 https://bugs.webkit.org/show_bug.cgi?id=160354 14 http://trac.webkit.org/changeset/203935 15 1 16 2016-08-05 Youenn Fablet <youenn@apple.com> 2 17 -
trunk/LayoutTests/fast/dom/Window/es52-globals-expected.txt
r203935 r204166 2 2 PASS window.hasOwnProperty("x") is true 3 3 PASS window.hasOwnProperty("y") is false 4 PASS window.hasOwnProperty("f") is false 5 PASS window.__proto__.__proto__.hasOwnProperty("f") is true 6 PASS window.hasOwnProperty("div") is false 7 PASS window.__proto__.__proto__.hasOwnProperty("div") is true 8 PASS window.hasOwnProperty("a") is false 4 PASS window.hasOwnProperty("f") is true 5 PASS window.hasOwnProperty("div") is true 6 FAIL window.hasOwnProperty("a") should be true. Was false. 9 7 PASS Element is not undefined 10 8 PASS x is 1 -
trunk/LayoutTests/fast/dom/Window/es52-globals.html
r203935 r204166 15 15 shouldBeTrue('window.hasOwnProperty("x")'); 16 16 shouldBeFalse('window.hasOwnProperty("y")'); 17 shouldBeFalse('window.hasOwnProperty("f")'); 18 shouldBeTrue('window.__proto__.__proto__.hasOwnProperty("f")'); 19 shouldBeFalse('window.hasOwnProperty("div")'); 20 shouldBeTrue('window.__proto__.__proto__.hasOwnProperty("div")'); 21 shouldBeFalse('window.hasOwnProperty("a")'); 17 shouldBeTrue('window.hasOwnProperty("f")'); 18 shouldBeTrue('window.hasOwnProperty("div")'); 19 shouldBeTrue('window.hasOwnProperty("a")'); 22 20 23 21 </script> -
trunk/LayoutTests/fast/loader/window-clearing-expected.txt
r203935 r204166 10 10 11 11 PASS: element 3 in the window's prototype chain was cleared 12 13 PASS: element 4 in the window's prototype chain was cleared -
trunk/LayoutTests/http/tests/security/window-named-proto-expected.txt
r203935 r204166 1 CONSOLE MESSAGE: line 2: TypeError: null is not an object (evaluating 'document.body.innerHTML')1 CONSOLE MESSAGE: line 1: Blocked a frame with origin "null" from accessing a frame with origin "http://localhost:8080". The frame requesting access has a protocol of "data", the frame being accessed has a protocol of "http". Protocols must match. 2 2 3 CONSOLE MESSAGE: line 1: TypeError: undefined is not an object (evaluating 'parent.__proto__.alert') 4 -
trunk/LayoutTests/http/tests/security/window-named-valueOf-expected.txt
r203935 r204166 1 CONSOLE MESSAGE: line 1: Threw exception: TypeError: Illegal constructor 1 CONSOLE MESSAGE: line 1: Blocked a frame with origin "null" from accessing a frame with origin "http://localhost:8080". The frame requesting access has a protocol of "data", the frame being accessed has a protocol of "http". Protocols must match. 2 3 CONSOLE MESSAGE: line 1: Blocked a frame with origin "null" from accessing a frame with origin "http://localhost:8080". The frame requesting access has a protocol of "data", the frame being accessed has a protocol of "http". Protocols must match. 4 2 5 This passes if it doesn't alert the contents of innocent-victim. -
trunk/LayoutTests/http/tests/security/window-named-valueOf.html
r203935 r204166 24 24 alert(obj.valueOf.constructor("return document.body.innerHTML")()); 25 25 } catch(ex) { 26 console.log("Threw exception: " + ex)27 26 } 28 27 if (window.testRunner) -
trunk/LayoutTests/imported/w3c/ChangeLog
r204164 r204166 1 2016-08-05 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r203935. 4 https://bugs.webkit.org/show_bug.cgi?id=160596 5 6 looks like a 1-2% PLUM regression on iPhone 6s (Requested by 7 kling_ on #webkit). 8 9 Reverted changeset: 10 11 "Window's named properties should be exposed on a 12 WindowProperties object in its prototype" 13 https://bugs.webkit.org/show_bug.cgi?id=160354 14 http://trac.webkit.org/changeset/203935 15 1 16 2016-08-05 Youenn Fablet <youenn@apple.com> 2 17 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt
r204079 r204166 5160 5160 PASS Window interface object length 5161 5161 PASS Window interface object name 5162 PASS Window interface: existence and properties of interface prototype object 5162 FAIL Window interface: existence and properties of interface prototype object assert_equals: Class name for prototype of Window.prototype is not "WindowProperties" expected "[object WindowProperties]" but got "[object EventTargetPrototype]" 5163 5163 PASS Window interface: existence and properties of interface prototype object's "constructor" property 5164 5164 PASS Window interface: attribute self -
trunk/Source/WebCore/CMakeLists.txt
r204142 r204166 1134 1134 bindings/js/JSDOMWindowBase.cpp 1135 1135 bindings/js/JSDOMWindowCustom.cpp 1136 bindings/js/JSDOMWindowProperties.cpp1137 1136 bindings/js/JSDOMWindowShell.cpp 1138 1137 bindings/js/JSDOMWrapper.cpp -
trunk/Source/WebCore/ChangeLog
r204164 r204166 1 2016-08-05 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r203935. 4 https://bugs.webkit.org/show_bug.cgi?id=160596 5 6 looks like a 1-2% PLUM regression on iPhone 6s (Requested by 7 kling_ on #webkit). 8 9 Reverted changeset: 10 11 "Window's named properties should be exposed on a 12 WindowProperties object in its prototype" 13 https://bugs.webkit.org/show_bug.cgi?id=160354 14 http://trac.webkit.org/changeset/203935 15 1 16 2016-08-05 Youenn Fablet <youenn@apple.com> 2 17 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r204147 r204166 1787 1787 460BB6151D0A1BF000221812 /* Base64Utilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 460BB6131D0A1BEC00221812 /* Base64Utilities.cpp */; }; 1788 1788 460BB6161D0A1BF000221812 /* Base64Utilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 460BB6141D0A1BEC00221812 /* Base64Utilities.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1789 460CBF351D4BCD0E0092E88E /* JSDOMWindowProperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 460CBF331D4BCCFE0092E88E /* JSDOMWindowProperties.cpp */; };1790 460CBF361D4BCD0E0092E88E /* JSDOMWindowProperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 460CBF341D4BCCFE0092E88E /* JSDOMWindowProperties.h */; };1791 1789 4634592C1AC2271000ECB71C /* PowerObserverMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4634592B1AC2271000ECB71C /* PowerObserverMac.cpp */; }; 1792 1790 463EB6221B8789E00096ED51 /* TagCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 463EB6201B8789CB0096ED51 /* TagCollection.cpp */; }; … … 9089 9087 460BB6131D0A1BEC00221812 /* Base64Utilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Base64Utilities.cpp; sourceTree = "<group>"; }; 9090 9088 460BB6141D0A1BEC00221812 /* Base64Utilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Base64Utilities.h; sourceTree = "<group>"; }; 9091 460CBF331D4BCCFE0092E88E /* JSDOMWindowProperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMWindowProperties.cpp; sourceTree = "<group>"; };9092 460CBF341D4BCCFE0092E88E /* JSDOMWindowProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMWindowProperties.h; sourceTree = "<group>"; };9093 9089 4634592B1AC2271000ECB71C /* PowerObserverMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PowerObserverMac.cpp; sourceTree = "<group>"; }; 9094 9090 463EB6201B8789CB0096ED51 /* TagCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TagCollection.cpp; sourceTree = "<group>"; }; … … 17762 17758 9767CE09145ABC12005E64DB /* ExceptionHeaders.h */, 17763 17759 9767CE0A145ABC13005E64DB /* ExceptionInterfaces.h */, 17760 9908B0FD1BCAD07D00ED0F45 /* FetchInternalsBuiltins.cpp */, 17764 17761 9B03D8061BB3110D00B764B9 /* FetchInternalsBuiltins.h */, 17765 17762 A17C81200F2A5CF7005DAAEB /* HTMLElementFactory.cpp */, … … 21939 21936 BC6932710D7E293900AE44D1 /* JSDOMWindowBase.cpp */, 21940 21937 BC6932720D7E293900AE44D1 /* JSDOMWindowBase.h */, 21941 460CBF331D4BCCFE0092E88E /* JSDOMWindowProperties.cpp */,21942 460CBF341D4BCCFE0092E88E /* JSDOMWindowProperties.h */,21943 21938 BCBFB53A0DCD29CF0019B3E5 /* JSDOMWindowShell.cpp */, 21944 21939 BCBFB53B0DCD29CF0019B3E5 /* JSDOMWindowShell.h */, … … 26256 26251 81BE20D311F4BC3200915DFA /* JSIDBCursor.h in Headers */, 26257 26252 C585A68311D4FB08004C3E4B /* JSIDBDatabase.h in Headers */, 26258 460CBF361D4BCD0E0092E88E /* JSDOMWindowProperties.h in Headers */,26259 26253 C585A69711D4FB13004C3E4B /* JSIDBFactory.h in Headers */, 26260 26254 C572EE1F1201C9BC007D8F82 /* JSIDBIndex.h in Headers */, … … 29099 29093 A8C2280E11D4A59700D5A7D3 /* DocumentParser.cpp in Sources */, 29100 29094 4A4F48A916B0DFC000EDBB29 /* DocumentRuleSets.cpp in Sources */, 29101 460CBF351D4BCD0E0092E88E /* JSDOMWindowProperties.cpp in Sources */,29102 29095 AD6E71AC1668899D00320C13 /* DocumentSharedObjectPool.cpp in Sources */, 29103 29096 0B9056190F2578BE0095FF6A /* DocumentThreadableLoader.cpp in Sources */, -
trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
r203935 r204166 63 63 #include "JSDOMWindowBase.cpp" 64 64 #include "JSDOMWindowCustom.cpp" 65 #include "JSDOMWindowProperties.cpp"66 65 #include "JSDOMWindowShell.cpp" 67 66 #include "JSDOMWrapper.cpp" -
trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
r203935 r204166 147 147 } 148 148 149 // Do prototype lookup early so that functions and attributes in the prototype can have 150 // precedence over the index and name getters. 151 // FIXME: This seems like a silly idea. It only serves to suppress named property access 152 // to frames that happen to have names corresponding to properties on the prototype. 153 // This seems to only serve to leak some information cross-origin. 154 JSValue proto = thisObject->getPrototypeDirect(); 155 if (proto.isObject() && asObject(proto)->getPropertySlot(exec, propertyName, slot)) { 156 thisObject->printErrorMessage(errorMessage); 157 slot.setUndefined(); 158 return true; 159 } 160 149 161 // Check for child frames by name before built-in properties to match Mozilla. This does 150 162 // not match IE, but some sites end up naming frames things that conflict with window … … 159 171 slot.setUndefined(); 160 172 return true; 173 } 174 175 static bool jsDOMWindowGetOwnPropertySlotNamedItemGetter(JSDOMWindow* thisObject, Frame& frame, ExecState* exec, PropertyName propertyName, PropertySlot& slot) 176 { 177 JSValue proto = thisObject->getPrototypeDirect(); 178 if (proto.isObject() && asObject(proto)->hasProperty(exec, propertyName)) 179 return false; 180 181 // Check for child frames by name before built-in properties to match Mozilla. This does 182 // not match IE, but some sites end up naming frames things that conflict with window 183 // properties that are in Moz but not IE. Since we have some of these, we have to do it 184 // the Moz way. 185 if (auto* scopedChild = frame.tree().scopedChild(propertyNameToAtomicString(propertyName))) { 186 slot.setValue(thisObject, ReadOnly | DontDelete | DontEnum, toJS(exec, scopedChild->document()->domWindow())); 187 return true; 188 } 189 190 // FIXME: Search the whole frame hierarchy somewhere around here. 191 // We need to test the correct priority order. 192 193 // Allow shortcuts like 'Image1' instead of document.images.Image1 194 Document* document = frame.document(); 195 if (is<HTMLDocument>(*document)) { 196 auto& htmlDocument = downcast<HTMLDocument>(*document); 197 auto* atomicPropertyName = propertyName.publicName(); 198 if (atomicPropertyName && htmlDocument.hasWindowNamedItem(*atomicPropertyName)) { 199 JSValue namedItem; 200 if (UNLIKELY(htmlDocument.windowNamedItemContainsMultipleElements(*atomicPropertyName))) { 201 Ref<HTMLCollection> collection = document->windowNamedItems(atomicPropertyName); 202 ASSERT(collection->length() > 1); 203 namedItem = toJS(exec, thisObject->globalObject(), collection); 204 } else 205 namedItem = toJS(exec, thisObject->globalObject(), htmlDocument.windowNamedItem(*atomicPropertyName)); 206 slot.setValue(thisObject, ReadOnly | DontDelete | DontEnum, namedItem); 207 return true; 208 } 209 } 210 211 return false; 161 212 } 162 213 … … 204 255 #endif 205 256 206 return false; 257 // (3) Finally, named properties. 258 // Really, this should just be 'return false;' - these should all be on the NPO. 259 return jsDOMWindowGetOwnPropertySlotNamedItemGetter(thisObject, *frame, exec, propertyName, slot); 207 260 } 208 261 … … 232 285 233 286 // (2) Regular own properties. 234 return Base::getOwnPropertySlotByIndex(thisObject, exec, index, slot); 287 if (Base::getOwnPropertySlotByIndex(thisObject, exec, index, slot)) 288 return true; 289 290 // (3) Finally, named properties. 291 // Really, this should just be 'return false;' - these should all be on the NPO. 292 return jsDOMWindowGetOwnPropertySlotNamedItemGetter(thisObject, *frame, exec, Identifier::from(exec, index), slot); 235 293 } 236 294 -
trunk/Source/WebCore/bindings/js/JSDOMWindowShell.cpp
r203935 r204166 33 33 #include "GCController.h" 34 34 #include "JSDOMWindow.h" 35 #include "JSDOMWindowProperties.h"36 35 #include "JSEventTarget.h" 37 36 #include "ScriptController.h" … … 87 86 JSDOMWindow* jsDOMWindow = JSDOMWindow::create(vm, structure, *domWindow, this); 88 87 prototype->structure()->setGlobalObject(vm, jsDOMWindow); 89 90 Structure* windowPropertiesStructure = JSDOMWindowProperties::createStructure(vm, jsDOMWindow, JSEventTarget::prototype(vm, jsDOMWindow)); 91 JSDOMWindowProperties* windowProperties = JSDOMWindowProperties::create(windowPropertiesStructure, *jsDOMWindow); 92 93 prototype->structure()->setPrototypeWithoutTransition(vm, windowProperties); 88 prototype->structure()->setPrototypeWithoutTransition(vm, JSEventTarget::prototype(vm, jsDOMWindow)); 94 89 setWindow(vm, jsDOMWindow); 95 90 ASSERT(jsDOMWindow->globalObject() == jsDOMWindow);
Note:
See TracChangeset
for help on using the changeset viewer.