Commit cc06b695 authored by darin's avatar darin
Browse files

LayoutTests:

        Reviewed by Geoff.

        - test for <rdar://problem/5215830> REGRESSION: ebay.com layout is wrong

        * fast/dom/iframe-document.html: Updated test to expect no document property.
        * fast/dom/iframe-document-expected.txt: Updated.

        * fast/forms/focus2.html: Changed test to use ownerDocument instead of document.

WebCore:

        Reviewed by Geoff.

        - fix <rdar://problem/5215830> REGRESSION: ebay.com layout is wrong

        The code on ebay was looking for the "document" property on a iframe.
        We changed that to be the ownerDocument rather than the contentDocument,
        which was not what ebay was expecting. The best fix seems to be removing
        the document property altogether.

        Test: fast/dom/iframe-document.html

        * bindings/js/kjs_html.h: Remove ElementDocument.
        * bindings/js/kjs_html.cpp: (KJS::JSHTMLElement::getValueProperty): Ditto.

WebKit:

        Reviewed by Geoff.

        * WebInspector/webInspector/treeoutline.js: Use ownerDocument instead of non-standard
        document property.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@21651 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e1787a6a
2007-05-22 Darin Adler <darin@apple.com>
Reviewed by Geoff.
- test for <rdar://problem/5215830> REGRESSION: ebay.com layout is wrong
* fast/dom/iframe-document.html: Updated test to expect no document property.
* fast/dom/iframe-document-expected.txt: Updated.
* fast/forms/focus2.html: Changed test to use ownerDocument instead of document.
2007-05-22 Adele Peterson <adele@apple.com>
 
Reviewed by Darin.
This tests the document property on an HTMLIFrameElement. Internet Explorer and Safari have a document property on all elements that gives the document the element is in. Old versions of Safari overrode this on iframe elements to return the document inside the iframe, which created an incompatibility with at least on SAP application because it doesn't match the behavior of other browsers.
This tests the document property on an HTMLIFrameElement. Internet Explorer has a document property on all elements that gives the document the element is in. Old versions of Safari had both this and another property on iframe elements to return the document inside the iframe, which created an incompatibility with at least on SAP application because it doesn't match the behavior of other browsers.
TEST PASSED: The document property is returning the document the iframe element is in.
TEST PASSED: The frame has no document property.
......@@ -5,9 +5,9 @@ function test()
layoutTestController.dumpAsText();
var result;
if (!document.getElementById('frame').document)
result = "TEST PASSED: The frame has no document property, so this is probably not IE or Safari.";
result = "TEST PASSED: The frame has no document property.";
else if (document == document.getElementById('frame').document)
result = "TEST PASSED: The document property is returning the document the iframe element is in.";
result = "TEST FAILED: The document property is returning the document the iframe element is in.";
else
result = "TEST FAILED: The document property is returning a document other than the one the iframe element is in, probably the document inside the frame.";
var resultElement = document.getElementById('result');
......@@ -16,9 +16,10 @@ function test()
</script>
<body onload="test()">
<p>This tests the document property on an HTMLIFrameElement.
Internet Explorer and Safari have a document property on all elements that gives the document the element is in.
Old versions of Safari overrode this on iframe elements to return the document inside the iframe, which created an incompatibility
with at least on SAP application because it doesn't match the behavior of other browsers.</p>
Internet Explorer has a document property on all elements that gives the document the element is in.
Old versions of Safari had both this and another property on iframe elements to return the document
inside the iframe, which created an incompatibility with at least on SAP application because it
doesn't match the behavior of other browsers.</p>
<p id="result">TEST NOT RUN</p>
<iframe src="data:text/html,iframe contents" id="frame"></iframe>
</body>
......@@ -79,26 +79,26 @@ function addElements(parentElement)
// Form elements
for (var i = 0; i < inputTypes.length; ++i) { //>
var input = parentElement.document.createElement('input');
var input = parentElement.ownerDocument.createElement('input');
input.type = inputTypes[i];
addEventListeners(input);
parentElement.appendChild(input);
}
// Textarea
var textarea = parentElement.document.createElement('textarea');
var textarea = parentElement.ownerDocument.createElement('textarea');
addEventListeners(textarea);
parentElement.appendChild(textarea);
// Contenteditable
var div = parentElement.document.createElement('div');
var div = parentElement.ownerDocument.createElement('div');
div.contentEditable = true;
div.style.border = "1px solid black";
addEventListeners(div);
parentElement.appendChild(div);
// Anchor
var anchor = parentElement.document.createElement('a');
var anchor = parentElement.ownerDocument.createElement('a');
anchor.innerHTML = "anchor";
anchor.href = "javascript:";
addEventListeners(anchor);
......
2007-05-22 Darin Adler <darin@apple.com>
Reviewed by Geoff.
- fix <rdar://problem/5215830> REGRESSION: ebay.com layout is wrong
The code on ebay was looking for the "document" property on a iframe.
We changed that to be the ownerDocument rather than the contentDocument,
which was not what ebay was expecting. The best fix seems to be removing
the document property altogether.
Test: fast/dom/iframe-document.html
* bindings/js/kjs_html.h: Remove ElementDocument.
* bindings/js/kjs_html.cpp: (KJS::JSHTMLElement::getValueProperty): Ditto.
2007-05-22 Adele Peterson <adele@apple.com>
 
Reviewed by Darin.
......@@ -464,7 +464,6 @@ const JSHTMLElement::Accessors* JSHTMLElement::accessors() const
innerText KJS::JSHTMLElement::ElementInnerText DontDelete
outerHTML KJS::JSHTMLElement::ElementOuterHTML DontDelete
outerText KJS::JSHTMLElement::ElementOuterText DontDelete
document KJS::JSHTMLElement::ElementDocument DontDelete|ReadOnly
# IE extension
children KJS::JSHTMLElement::ElementChildren DontDelete|ReadOnly
contentEditable KJS::JSHTMLElement::ElementContentEditable DontDelete
......@@ -695,8 +694,6 @@ JSValue *JSHTMLElement::getValueProperty(ExecState* exec, int token) const
return jsString(element.outerHTML());
case ElementOuterText:
return jsString(element.outerText());
case ElementDocument:
return toJS(exec,element.ownerDocument());
case ElementChildren:
return getHTMLCollection(exec, element.children().get());
case ElementContentEditable:
......
......@@ -101,7 +101,7 @@ namespace KJS {
FrameSetCols, FrameSetRows,
GetContext,
ElementInnerHTML, ElementId, ElementDir, ElementLang,
ElementClassName, ElementInnerText, ElementDocument, ElementChildren, ElementContentEditable,
ElementClassName, ElementInnerText, ElementChildren, ElementContentEditable,
ElementIsContentEditable, ElementOuterHTML, ElementOuterText
};
private:
......
// -*- mode: c++; c-basic-offset: 4 -*-
/*
* Copyright (C) 2006-2007 Apple Inc.
* Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -106,8 +106,8 @@ namespace WebCore {
#if PLATFORM(MAC)
void focusNSView(NSView*);
#endif
private:
private:
Page* m_page;
ChromeClient* m_client;
};
......
2007-05-22 Darin Adler <darin@apple.com>
Reviewed by Geoff.
* WebInspector/webInspector/treeoutline.js: Use ownerDocument instead of non-standard
document property.
2007-05-22 Adele Peterson <adele@apple.com>
 
Reviewed by Darin.
......
......@@ -303,7 +303,7 @@ TreeElement.prototype._attach = function()
if (this._listItemNode && this._listItemNode.parentNode)
this._listItemNode.parentNode.removeChild(this._listItemNode);
this._listItemNode = this.treeOutline._childrenListNode.document.createElement("li");
this._listItemNode = this.treeOutline._childrenListNode.ownerDocument.createElement("li");
this._listItemNode.treeElement = this;
this._listItemNode.innerHTML = this.title;
......@@ -415,7 +415,7 @@ TreeElement.prototype.expand = function()
if (this.refreshChildren)
this.children = [];
this._childrenListNode = this.treeOutline._childrenListNode.document.createElement("ol");
this._childrenListNode = this.treeOutline._childrenListNode.ownerDocument.createElement("ol");
this._childrenListNode.parentTreeElement = this;
this._childrenListNode.addStyleClass("children");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment