Commit 6b1b5c2d authored by kmccullo's avatar kmccullo

LayoutTests:

        Reviewed by.

        - Rolling back change to fix the build until I have a good fix for data: urls.

        * ChangeLog:
        * fast/dom/HTMLHeadElement/resources/head-check.js:
        * fast/dom/frame-loading-via-document-write-expected.txt: Removed.
        * fast/dom/frame-loading-via-document-write.html: Removed.
        * fast/dom/resources/frame-loading-via-document-write.js: Removed.
        * fast/dom/resources/green250x50.png: Removed.
        * fast/dom/resources/success.html: Removed.
        * http/tests/security/frame-loading-via-document-write-expected.txt: Removed.
        * http/tests/security/frame-loading-via-document-write.html: Removed.
        * http/tests/security/resources/frame-loading-via-document-write.js: Removed.
        * http/tests/security/resources/success.html: Removed.

WebCore:

        Reviewed by.

        - Rolling back change to fix the build until I have a good fix for data: urls.

        * ChangeLog:
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::load):
        (WebCore::FrameLoader::open):
        * platform/String.cpp:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@21724 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent bf85dfb9
2007-05-24 Kevin McCullough <kmccullough@apple.com>
Reviewed by.
- Rolling back change to fix the build until I have a good fix for data: urls.
* ChangeLog:
* fast/dom/HTMLHeadElement/resources/head-check.js:
* fast/dom/frame-loading-via-document-write-expected.txt: Removed.
* fast/dom/frame-loading-via-document-write.html: Removed.
* fast/dom/resources/frame-loading-via-document-write.js: Removed.
* fast/dom/resources/green250x50.png: Removed.
* fast/dom/resources/success.html: Removed.
* http/tests/security/frame-loading-via-document-write-expected.txt: Removed.
* http/tests/security/frame-loading-via-document-write.html: Removed.
* http/tests/security/resources/frame-loading-via-document-write.js: Removed.
* http/tests/security/resources/success.html: Removed.
2007-05-24 Mitz Pettel <mitz@webkit.org>
Reviewed by Darin.
......@@ -54,19 +72,6 @@
* fast/dom/prototype-chain-expected.txt:
* fast/dom/prototype-chain.html:
2007-05-23 Kevin McCullough <kmccullough@apple.com>
Reviewed by Darin.
- rdar://problem/5183523
- Tests for a fix for a regression with Excel worksheets. We now check the document's URL to see if it can load a resource in the case of a URL click, instead of checking the referrer, which is blank for local files.
* fast/dom/frame-loading-via-document-write-expected.txt: Added.
* fast/dom/frame-loading-via-document-write.html: Added.
* fast/dom/resources/frame-loading-via-document-write.js: Added.
* fast/dom/resources/green250x50.png: Added.
* fast/dom/resources/success.html: Added.
2007-05-23 Kevin McCullough <kmccullough@apple.com>
Reviewed by.
......@@ -7,15 +7,19 @@ if (window.layoutTestController) {
}
function testAndLoadNext() {
alert("Hey");
iframe = document.getElementById("iframe");
if (iframe.src.substring(0, 5) == "data:") {
alert("YOU");
iframe.src = "resources/head-check-" + currentTest + ".html";
return;
}
alert("Get");
debug("Testing: " + iframe.src.substring(iframe.src.lastIndexOf("/") + 1));
shouldBe("iframe.contentWindow.document.getElementsByTagName('head').length", "1");
shouldBe("iframe.contentWindow.document.firstChild.firstChild.nodeName.toLowerCase()", "'head'");
debug("");
alert("hi");
if (currentTest < maxTests) {
currentTest++;
iframe.src = "data:text/html,";
......
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderFrameSet {FRAMESET} at (0,0) size 800x600
RenderFrame {FRAME} at (0,0) size 800x196
layer at (0,0) size 800x196
RenderView at (0,0) size 800x196
layer at (0,0) size 800x196
RenderBlock {HTML} at (0,0) size 800x196
RenderBody {BODY} at (8,8) size 784x180
RenderBlock {DIV} at (0,0) size 784x54
RenderInline {SPAN} at (0,0) size 221x18
RenderText {#text} at (0,0) size 221x18
text run at (0,0) width 221: "This page was successfully loaded."
RenderBR {BR} at (221,14) size 0x0
RenderInline {SPAN} at (0,0) size 120x18
RenderText {#text} at (0,18) size 120x18
text run at (0,18) width 120: "My protocol is file:"
RenderBR {BR} at (120,32) size 0x0
RenderInline {SPAN} at (0,0) size 125x18
RenderText {#text} at (0,36) size 125x18
text run at (0,36) width 125: "My referrer is blank"
RenderBR {BR} at (125,50) size 0x0
RenderFrame {FRAME} at (0,202) size 800x196
layer at (0,0) size 800x196
RenderView at (0,0) size 800x196
layer at (0,0) size 800x94
RenderBlock {HTML} at (0,0) size 800x94
RenderBody {BODY} at (8,8) size 784x78
RenderTable {TABLE} at (0,0) size 256x78
RenderTableSection {TBODY} at (0,0) size 256x78
RenderTableRow {TR} at (0,2) size 256x74
RenderTableCell {TD} at (2,2) size 252x74 [r=0 c=0 rs=1 cs=1]
RenderBlock {DIV} at (1,1) size 250x18
RenderText {#text} at (0,0) size 89x18
text run at (0,0) width 89: "Image loaded."
RenderBlock (anonymous) at (1,19) size 250x54
RenderImage {IMG} at (0,0) size 250x50
RenderFrame {FRAME} at (0,404) size 800x196
layer at (0,0) size 800x196
RenderView at (0,0) size 800x196
layer at (0,0) size 800x94
RenderBlock {HTML} at (0,0) size 800x94
RenderBody {BODY} at (8,8) size 784x78
RenderTable {TABLE} at (0,0) size 256x78
RenderTableSection {TBODY} at (0,0) size 256x78
RenderTableRow {TR} at (0,2) size 256x74
RenderTableCell {TD} at (2,2) size 252x74 [r=0 c=0 rs=1 cs=1]
RenderBlock {DIV} at (1,1) size 250x18
RenderText {#text} at (0,0) size 89x18
text run at (0,0) width 89: "Image loaded."
RenderBlock (anonymous) at (1,19) size 250x54
RenderImage {IMG} at (0,0) size 250x50
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script language="JavaScript">
function buildFrameset()
{
if (window.layoutTestController)
layoutTestController.waitUntilDone();
var outHTML="<frameset rows=\"33%, 33%, 33%\">"+
"<frame src=\"\" name=\"topRow\">"+
"<frame src=\"\" name=\"middleRow\">"+
"<frame src=\"\" name=\"bottomRow\">"+
"</frameset>";
document.open("text/html","replace");
document.write(outHTML);
document.close();
outHTML = "<html><head><scr" + "ipt language=\"JavaScript\" src=\"resources/frame-loading-via-document-write.js\">"+
"</scr" + "ipt></head><body onLoad=\"clickAnchor()\"><table><tr><td>"+
"<a href=\"resources/success.html\" target=\"topRow\" id=\"anchorLink\">Click me. If nothing loads above we have a problem.</a>"+
"</td></tr></table></body></html>";
frames['topRow'].document.open("text/html","replace");
frames['topRow'].document.charset=document.charset;
frames['topRow'].document. write(outHTML);
frames['topRow'].document.close();
outHTML = "<html><head><scr" + "ipt language=\"JavaScript\" src=\"resources/frame-loading-via-document-write.js\">"+
"</scr" + "ipt></head><body onLoad=\"didImageLoad()\"><table><tr><td>"+
"<div id=\"result\"></div>"+
"<img src=\"file:////tmp/LayoutTests/fast/dom/resources/green250x50.png\" id=\"myImg\">"+
"</td></tr></table></body></html>";
frames['middleRow'].document.open("text/html","replace");
frames['middleRow'].document.charset=document.charset;
frames['middleRow'].document. write(outHTML);
frames['middleRow'].document.close();
outHTML = "<html><head><scr" + "ipt language=\"JavaScript\" src=\"resources/frame-loading-via-document-write.js\">"+
"</scr" + "ipt></head><body onLoad=\"lastTest()\"><table><tr><td>"+
"<div id=\"result\"></div>"+
"<img src=\"resources/green250x50.png\" id=\"myImg\">"+
"</td></tr></table></body></html>";
frames['bottomRow'].document.open("text/html","replace");
frames['bottomRow'].document.charset=document.charset;
frames['bottomRow'].document. write(outHTML);
frames['bottomRow'].document.close();
}
buildFrameset();
</script>
</head>
<body>
<p>JavaScript FAILED! you should not see this.</p>
</body>
</html>
function clickAnchor()
{
var event = document.createEvent('MouseEvent');
event.initEvent( 'click', true, true );
document.getElementById('anchorLink').dispatchEvent(event);
}
function didImageLoad()
{
var result = document.getElementById("result");
var myImg = document.getElementById("myImg");
if (myImg.height == 0 && myImg.width == 0) {
result.innerHTML = "Image NOT loaded.";
} else {
result.innerHTML = "Image loaded.";
}
}
function lastTest()
{
didImageLoad();
if (window.layoutTestController)
layoutTestController.notifyDone();
}
<html>
<head>
<script language="JavaScript">
function debug(msg)
{
var span = document.createElement("span");
span.innerHTML = msg + '<br>';
document.getElementById("console").appendChild(span);
}
function runTests()
{
debug("This page was successfully loaded.");
debug("My protocol is " + window.location.protocol);
if(document.referrer == "")
debug("My referrer is blank");
else
debug("My referrer is NOT blank");
}
</script>
</head>
<body onLoad="runTests()">
<div id="console"></div>
</body>
</html>
CONSOLE MESSAGE: line 0: Not allowed to load local resource: file:////tmp/LayoutTests/fast/dom/resources/green250x50.png
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderFrameSet {FRAMESET} at (0,0) size 800x600
RenderFrame {FRAME} at (0,0) size 800x196
layer at (0,0) size 800x196
RenderView at (0,0) size 800x196
layer at (0,0) size 800x196
RenderBlock {HTML} at (0,0) size 800x196
RenderBody {BODY} at (8,8) size 784x180
RenderBlock {DIV} at (0,0) size 784x54
RenderInline {SPAN} at (0,0) size 221x18
RenderText {#text} at (0,0) size 221x18
text run at (0,0) width 221: "This page was successfully loaded."
RenderBR {BR} at (221,14) size 0x0
RenderInline {SPAN} at (0,0) size 124x18
RenderText {#text} at (0,18) size 124x18
text run at (0,18) width 124: "My protocol is http:"
RenderBR {BR} at (124,32) size 0x0
RenderInline {SPAN} at (0,0) size 125x18
RenderText {#text} at (0,36) size 125x18
text run at (0,36) width 125: "My referrer is blank"
RenderBR {BR} at (125,50) size 0x0
RenderFrame {FRAME} at (0,202) size 800x196
layer at (0,0) size 800x196
RenderView at (0,0) size 800x196
layer at (0,0) size 800x58
RenderBlock {HTML} at (0,0) size 800x58
RenderBody {BODY} at (8,8) size 784x42
RenderTable {TABLE} at (0,0) size 133x42
RenderTableSection {TBODY} at (0,0) size 133x42
RenderTableRow {TR} at (0,2) size 133x38
RenderTableCell {TD} at (2,2) size 129x38 [r=0 c=0 rs=1 cs=1]
RenderBlock {DIV} at (1,1) size 127x18
RenderText {#text} at (0,0) size 127x18
text run at (0,0) width 127: "Image NOT loaded."
RenderBlock (anonymous) at (1,19) size 127x18
RenderImage {IMG} at (0,14) size 0x0
RenderFrame {FRAME} at (0,404) size 800x196
layer at (0,0) size 800x196
RenderView at (0,0) size 800x196
layer at (0,0) size 800x94
RenderBlock {HTML} at (0,0) size 800x94
RenderBody {BODY} at (8,8) size 784x78
RenderTable {TABLE} at (0,0) size 256x78
RenderTableSection {TBODY} at (0,0) size 256x78
RenderTableRow {TR} at (0,2) size 256x74
RenderTableCell {TD} at (2,2) size 252x74 [r=0 c=0 rs=1 cs=1]
RenderBlock {DIV} at (1,1) size 250x18
RenderText {#text} at (0,0) size 89x18
text run at (0,0) width 89: "Image loaded."
RenderBlock (anonymous) at (1,19) size 250x54
RenderImage {IMG} at (0,0) size 250x50
<html>
<head>
<script language="JavaScript">
function buildFrameset()
{
if (window.layoutTestController)
layoutTestController.waitUntilDone();
var outHTML="<frameset rows=\"33%, 33%, 33%\">"+
"<frame src=\"\" name=\"topRow\">"+
"<frame src=\"\" name=\"middleRow\">"+
"<frame src=\"\" name=\"bottomRow\">"+
"</frameset>";
document.open("text/html","replace");
document.write(outHTML);
document.close();
outHTML = "<html><head><scr" + "ipt language=\"JavaScript\" src=\"resources/frame-loading-via-document-write.js\">"+
"</scr" + "ipt></head><body onLoad=\"clickAnchor()\"><table><tr><td>"+
"<a href=\"resources/success.html\" target=\"topRow\" id=\"anchorLink\">Click me. If nothing loads above we have a problem.</a>"+
"</td></tr></table></body></html>";
frames['topRow'].document.open("text/html","replace");
frames['topRow'].document.charset=document.charset;
frames['topRow'].document. write(outHTML);
frames['topRow'].document.close();
outHTML = "<html><head><scr" + "ipt language=\"JavaScript\" src=\"resources/frame-loading-via-document-write.js\">"+
"</scr" + "ipt></head><body onLoad=\"didImageLoad()\"><table><tr><td>"+
"<div id=\"result\"></div>"+
"<img src=\"file:////tmp/LayoutTests/fast/dom/resources/green250x50.png\" id=\"myImg\">"+
"</td></tr></table></body></html>";
frames['middleRow'].document.open("text/html","replace");
frames['middleRow'].document.charset=document.charset;
frames['middleRow'].document. write(outHTML);
frames['middleRow'].document.close();
outHTML = "<html><head><scr" + "ipt language=\"JavaScript\" src=\"resources/frame-loading-via-document-write.js\">"+
"</scr" + "ipt></head><body onLoad=\"lastTest()\"><table><tr><td>"+
"<div id=\"result\"></div>"+
"<img src=\"resources/green250x50.png\" id=\"myImg\">"+
"</td></tr></table></body></html>";
frames['bottomRow'].document.open("text/html","replace");
frames['bottomRow'].document.charset=document.charset;
frames['bottomRow'].document. write(outHTML);
frames['bottomRow'].document.close();
}
buildFrameset();
</script>
</head>
<body>
<p>JavaScript FAILED! you should not see this.</p>
</body>
</html>
function clickAnchor()
{
var event = document.createEvent('MouseEvent');
event.initEvent( 'click', true, true );
document.getElementById('anchorLink').dispatchEvent(event);
}
function didImageLoad()
{
var result = document.getElementById("result");
var myImg = document.getElementById("myImg");
if (myImg.height == 0 && myImg.width == 0) {
result.innerHTML = "Image NOT loaded.";
} else {
result.innerHTML = "Image loaded.";
}
}
function lastTest()
{
didImageLoad();
if (window.layoutTestController)
layoutTestController.notifyDone();
}
<html>
<head>
<script language="JavaScript">
function debug(msg)
{
var span = document.createElement("span");
span.innerHTML = msg + '<br>';
document.getElementById("console").appendChild(span);
}
function runTests()
{
debug("This page was successfully loaded.");
debug("My protocol is " + window.location.protocol);
if(document.referrer == "")
debug("My referrer is blank");
else
debug("My referrer is NOT blank");
}
</script>
</head>
<body onLoad="runTests()">
<div id="console"></div>
</body>
</html>
2007-05-24 Kevin McCullough <kmccullough@apple.com>
Reviewed by.
- Rolling back change to fix the build until I have a good fix for data: urls.
* ChangeLog:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::open):
* platform/String.cpp:
2007-05-24 David Hyatt <hyatt@apple.com>
Add two more error messages to the HTMLParser.
......@@ -1781,22 +1781,20 @@ void FrameLoader::load(const KURL& URL, Event* event)
void FrameLoader::load(const FrameLoadRequest& request, bool userGesture, Event* event,
HTMLFormElement* submitForm, const HashMap<String, String>& formValues)
{
KURL url = request.resourceRequest().url();
ASSERT(frame()->document());
if (!canLoad(url, frame()->document())) {
FrameLoader::reportLocalLoadFailed(frame()->page(), url.url());
return;
}
String referrer;
String argsReferrer = request.resourceRequest().httpReferrer();
if (!argsReferrer.isEmpty())
referrer = argsReferrer;
else
referrer = m_outgoingReferrer;
bool hideReferrer;
if (!canLoad(request.resourceRequest().url(), referrer, hideReferrer)) {
FrameLoader::reportLocalLoadFailed(frame()->page(), request.resourceRequest().url().url());
return;
}
if (shouldHideReferrer(url, referrer))
if (hideReferrer)
referrer = String();
Frame* targetFrame = m_frame->tree()->find(request.frameName());
......@@ -1816,10 +1814,10 @@ void FrameLoader::load(const FrameLoadRequest& request, bool userGesture, Event*
if (submitForm && !formValues.isEmpty())
formState = FormState::create(submitForm, formValues, m_frame);
load(url, referrer, loadType,
load(request.resourceRequest().url(), referrer, loadType,
request.frameName(), event, formState.release());
} else
post(url, referrer, request.frameName(),
post(request.resourceRequest().url(), referrer, request.frameName(),
request.resourceRequest().httpBody(), request.resourceRequest().httpContentType(), event, submitForm, formValues);
if (targetFrame && targetFrame != m_frame)
......@@ -2567,6 +2565,7 @@ void FrameLoader::open(CachedPage& cachedPage)
m_isComplete = false;
m_wasLoadEventEmitted = false;
m_outgoingReferrer = URL.url();
FrameView* view = cachedPage.view();
if (view)
view->setWasScrolledByUser(false);
......
......@@ -510,11 +510,3 @@ WebCore::String* string(const char* s)
return new WebCore::String(s);
}
#endif
#ifndef NDEBUG
void dump(const WebCore::String* s)
{
if(s)
printf("%s\n", s->ascii().data());
}
#endif
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