Skip to content
Permalink
Browse files
LayoutTests:
        Reviewed by Eric.

        - test case that verifies that <object> containing html is treated
          like <iframe> in various respects
        http://bugzilla.opendarwin.org/show_bug.cgi?id=7125

        * fast/dom/HTMLObjectElement/object-as-frame-expected.txt: Added.
        * fast/dom/HTMLObjectElement/object-as-frame.html: Added.

        - updated this test to reflect that the onload event now fires for iframes,
          including ones with empty src
        http://bugzilla.opendarwin.org/show_bug.cgi?id=3609

        * fast/events/event-targets-expected.checksum: Removed.
        * fast/events/event-targets-expected.png: Removed.
        * fast/events/event-targets-expected.txt:
        * fast/events/event-targets.html:

WebCore:

        Reviewed by Eric.

        - fixed "remove frame, renderer and completed flag from ChildFrame, make Frame track these"
        http://bugzilla.opendarwin.org/show_bug.cgi?id=7125

        - fixed "onload event never called for iframe element with emtpy or about:blank src"
        http://bugzilla.opendarwin.org/show_bug.cgi?id=3609

        * bridge/mac/MacFrame.h:
        * bridge/mac/MacFrame.mm:
        (WebCore::MacFrame::MacFrame): pass along renderer
        (WebCore::MacFrame::nextKeyViewInFrameHierarchy): get owner element in newfangled way
        * bridge/mac/WebCoreFrameBridge.h:
        * bridge/mac/WebCoreFrameBridge.mm:
        (-[WebCoreFrameBridge removeChild:]): don't mess with renderer
        (-[WebCoreFrameBridge init]): call new designated initializer
        (-[WebCoreFrameBridge initWithRenderer:]): new designated initializer
        (-[WebCoreFrameBridge dealloc]): don't mess with renderer
        (-[WebCoreFrameBridge finalize]): ditto
        (-[WebCoreFrameBridge installInFrame:]): ditto
        * page/Frame.cpp:
        (WebCore::FrameList::find): get name from frame not ChildFrame
        (WebCore::Frame::init): take renderer parameter
        (WebCore::Frame::clear): clear m_plugins, not m_objects
        (WebCore::Frame::childBegin): updated comment
        (WebCore::Frame::stop): add check-completed for documentless case here
        (WebCore::Frame::checkCompleted): don't track separate completed flag
        in ChildFrame, use the sub Frame object's own
        (WebCore::Frame::checkEmitLoadEvent): ditto
        (WebCore::Frame::requestFrame): don't store renderer and name in ChildFrame,
        instead pass them along
        (WebCore::Frame::requestObject): ditto above
        (WebCore::Frame::loadPlugin): expect renderer parameter
        (WebCore::Frame::loadSubframe): expect renderer and name parameters
        (WebCore::Frame::slotChildStarted): don't mess with ChildFrame
        (WebCore::Frame::slotChildCompleted): ditto
        (WebCore::Frame::childFrame): don't check m_objects
        (WebCore::Frame::frameExists): fix spacing, remove obsolete check and comment
        (WebCore::Frame::frameNames): get name from frame
        (WebCore::Frame::ownerElement): simplify a lot since the Frame knows its owner
        renderer now
        (WebCore::Frame::ownerRenderer): added
        (WebCore::Frame::canCachePage): check m_plugins not m_objects
        * page/Frame.h:
        * page/FramePrivate.h:
        (WebCore::ChildFrame): Remove constructor, most fields.
        (WebCore::FramePrivate::FramePrivate): Pass ownerRenderer
        * rendering/render_frames.cpp:
        (WebCore::RenderPartObject::updateWidget): Make sure to pass name attr
        to requestObject.

WebKit:

        Reviewed by Eric.

        - fixed "remove frame, renderer and completed flag from ChildFrame, make Frame track these"
        http://bugzilla.opendarwin.org/show_bug.cgi?id=7125

        - fixed "onload event never called for iframe element with emtpy or about:blank src"
        http://bugzilla.opendarwin.org/show_bug.cgi?id=3609

        * WebCoreSupport/WebFrameBridge.h:
        * WebCoreSupport/WebFrameBridge.m:
        (-[WebFrameBridge initWithPage:webView:renderer:frameName:view:]): Pass along renderer.
        (-[WebFrameBridge createChildFrameNamed:withURL:referrer:renderPart:allowsScrolling:marginWidth:marginHeight:]): Pass along renderer.
        * WebCoreSupport/WebPageBridge.m:
        (-[WebPageBridge initWithMainFrameName:webView:frameView:]): Pass null for renderer.
        * WebView/WebView.m:
        * WebView/WebViewPrivate.h:



Canonical link: https://commits.webkit.org/10652@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@12638 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
othermaciej committed Feb 7, 2006
1 parent 11dd61b commit 642aad1d85a8427da513398179be736e5e5ff809
Showing 22 changed files with 282 additions and 231 deletions.
@@ -1,3 +1,23 @@
2006-02-06 Maciej Stachowiak <mjs@apple.com>

Reviewed by Eric.

- test case that verifies that <object> containing html is treated
like <iframe> in various respects
http://bugzilla.opendarwin.org/show_bug.cgi?id=7125

* fast/dom/HTMLObjectElement/object-as-frame-expected.txt: Added.
* fast/dom/HTMLObjectElement/object-as-frame.html: Added.

- updated this test to reflect that the onload event now fires for iframes,
including ones with empty src
http://bugzilla.opendarwin.org/show_bug.cgi?id=3609

* fast/events/event-targets-expected.checksum: Removed.
* fast/events/event-targets-expected.png: Removed.
* fast/events/event-targets-expected.txt:
* fast/events/event-targets.html:

2006-02-06 Adele Peterson <adele@apple.com?

Reviewed by Maciej.
@@ -0,0 +1,8 @@
PASS window.frames.length is 2
PASS window.frames[0].frameElement.name is "frame"
PASS window.frames[1].frameElement.name is "obj"
Loading 'data:text/html,Updated contents of iframe' in iframe...
Loading 'data:text/html,Updated contents of object' in object...
PASS window.frames[0].location.toString() is "data:text/html,Updated contents of iframe"
PASS window.frames[1].location.toString() is "data:text/html,Updated contents of object"

@@ -0,0 +1,47 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../../js/resources/js-test-style.css">
<script src="../../js/resources/js-test-pre.js"></script>
<script>

if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}

var updatedFrameURL = "data:text/html,Updated contents of iframe";
var updatedObjectURL = "data:text/html,Updated contents of object";

function runTests()
{
shouldBe("window.frames.length", "2");
shouldBe("window.frames[0].frameElement.name", '"frame"');
shouldBe("window.frames[1].frameElement.name", '"obj"');
debug("Loading '" + updatedFrameURL + "' in iframe...");
debug("Loading '" + updatedObjectURL + "' in object...");
open(updatedFrameURL, "frame");
open(updatedObjectURL, "obj");
setTimeout("runMoreTests()", 0);
}

function runMoreTests()
{
shouldBe("window.frames[0].location.toString()", '"' + updatedFrameURL + '"');
shouldBe("window.frames[1].location.toString()", '"' + updatedObjectURL + '"');
if (window.layoutTestController) {
layoutTestController.notifyDone();
}
}
</script>

</head>
<body onload="runTests()">
<p id="description"></p>
<div id="console"></div>

<iframe name="frame" src="data:text/html,Old contents of iframe"></iframe>
<object name="obj" type="text/html" data="data:text/html,New contents of frame"></object>

</body>
</html>

This file was deleted.

Deleted file not rendered
@@ -1,35 +1,15 @@
layer at (0,0) size 800x600
RenderCanvas at (0,0) size 800x600
layer at (0,0) size 800x288
RenderBlock {HTML} at (0,0) size 800x288
RenderBody {BODY} at (8,16) size 784x256
RenderBlock {P} at (0,0) size 784x18
RenderInline {U} at (0,0) size 392x18
RenderText {TEXT} at (0,0) size 392x18
text run at (0,0) width 392: "Any lines that are bold correspond to event handlers that fired."
RenderBlock {P} at (0,34) size 784x18
RenderText {TEXT} at (0,0) size 115x18
text run at (0,0) width 115: "IMG onloadEvent"
RenderBlock {P} at (0,68) size 784x18
RenderText {TEXT} at (0,0) size 144x18
text run at (0,0) width 144: "OBJECT onloadEvent"
RenderBlock {P} at (0,102) size 784x18
RenderText {TEXT} at (0,0) size 145x18
text run at (0,0) width 145: "IFRAME onloadEvent"
RenderBlock {P} at (0,136) size 784x18
RenderText {TEXT} at (0,0) size 131x18
text run at (0,0) width 131: "IMG onunloadEvent"
RenderBlock {P} at (0,170) size 784x18
RenderText {TEXT} at (0,0) size 160x18
text run at (0,0) width 160: "OBJECT onunloadEvent"
RenderBlock {P} at (0,204) size 784x18
RenderText {TEXT} at (0,0) size 161x18
text run at (0,0) width 161: "IFRAME onunloadEvent"
RenderBlock {P} at (0,238) size 784x18
RenderText {TEXT} at (0,0) size 674x18
text run at (0,0) width 674: "NOTE: If IFRAME events start firing, make sure to check out the security issue <rdar://problem/4317593>"
RenderBlock (anonymous) at (0,272) size 784x0
RenderText {TEXT} at (0,0) size 0x0
RenderText {TEXT} at (0,0) size 0x0
RenderText {TEXT} at (0,0) size 0x0
RenderText {TEXT} at (0,0) size 0x0
Any lines that are bold and say "- fired" correspond to event handlers that fired. Only the iframe onload event should fire in this test case.

IMG onloadEvent

OBJECT onloadEvent

IFRAME onloadEvent - fired

IMG onunloadEvent

OBJECT onunloadEvent

IFRAME onunloadEvent


@@ -4,6 +4,9 @@
<HEAD>
<TITLE>Test onunload and onload events for body-type document</TITLE>
<SCRIPT>
if (window.layoutTestController)
layoutTestController.dumpAsText();

function removeElementById(victimID)
{
vic = document.getElementById(victimID);
@@ -23,21 +26,21 @@
}

cap.setAttribute('style','font-weight:bold;');
cap.innerText += " - fired";
}

</SCRIPT>
</HEAD>
<BODY id="myBody" onload="removeElementById('myImage'); removeElementById('myObject'); removeElementById('myIFrame');"">
<P><U>Any lines that are bold correspond to event handlers that fired.</U></P>
<P><U>Any lines that are bold and say "- fired" correspond to event handlers that fired. Only the iframe onload event should fire in this test case.</U></P>
<P id="loadIMAGE">IMG onloadEvent</P>
<P id="loadOBJECT">OBJECT onloadEvent</P>
<P id="loadIFRAME">IFRAME onloadEvent</P>
<P id="unloadIMAGE">IMG onunloadEvent</P>
<P id="unloadOBJECT">OBJECT onunloadEvent</P>
<P id="unloadIFRAME">IFRAME onunloadEvent</P>
<P> NOTE: If IFRAME events start firing, make sure to check out the security issue &lt;rdar://problem/4317593&gt;</P>
<IMG id="myImage" onload="boldCaption('loadIMAGE')" onunload="boldCaption('unloadIMAGE')" width="40" height="40"></IMG>
<OBJECT id="myObject" onload="boldCaption('loadOBJECT')" onunload="boldCaption('unloadOBJECT')">Apple</OBJECT>
<IFRAME id="myIFrame" src="about:blank" onload="boldCaption('loadIMAGE')" onunload="boldCaption('loadIMAGE')" style="border-style:solid; border-color:red;"></IFRAME>
<IFRAME id="myIFrame" src="about:blank" onload="boldCaption('loadIFRAME')" onunload="boldCaption('loadIFRAME')" style="border-style:solid; border-color:red;"></IFRAME>
</BODY>
</HTML>
@@ -1,3 +1,56 @@
2006-02-06 Maciej Stachowiak <mjs@apple.com>

Reviewed by Eric.

- fixed "remove frame, renderer and completed flag from ChildFrame, make Frame track these"
http://bugzilla.opendarwin.org/show_bug.cgi?id=7125

- fixed "onload event never called for iframe element with emtpy or about:blank src"
http://bugzilla.opendarwin.org/show_bug.cgi?id=3609

* bridge/mac/MacFrame.h:
* bridge/mac/MacFrame.mm:
(WebCore::MacFrame::MacFrame): pass along renderer
(WebCore::MacFrame::nextKeyViewInFrameHierarchy): get owner element in newfangled way
* bridge/mac/WebCoreFrameBridge.h:
* bridge/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge removeChild:]): don't mess with renderer
(-[WebCoreFrameBridge init]): call new designated initializer
(-[WebCoreFrameBridge initWithRenderer:]): new designated initializer
(-[WebCoreFrameBridge dealloc]): don't mess with renderer
(-[WebCoreFrameBridge finalize]): ditto
(-[WebCoreFrameBridge installInFrame:]): ditto
* page/Frame.cpp:
(WebCore::FrameList::find): get name from frame not ChildFrame
(WebCore::Frame::init): take renderer parameter
(WebCore::Frame::clear): clear m_plugins, not m_objects
(WebCore::Frame::childBegin): updated comment
(WebCore::Frame::stop): add check-completed for documentless case here
(WebCore::Frame::checkCompleted): don't track separate completed flag
in ChildFrame, use the sub Frame object's own
(WebCore::Frame::checkEmitLoadEvent): ditto
(WebCore::Frame::requestFrame): don't store renderer and name in ChildFrame,
instead pass them along
(WebCore::Frame::requestObject): ditto above
(WebCore::Frame::loadPlugin): expect renderer parameter
(WebCore::Frame::loadSubframe): expect renderer and name parameters
(WebCore::Frame::slotChildStarted): don't mess with ChildFrame
(WebCore::Frame::slotChildCompleted): ditto
(WebCore::Frame::childFrame): don't check m_objects
(WebCore::Frame::frameExists): fix spacing, remove obsolete check and comment
(WebCore::Frame::frameNames): get name from frame
(WebCore::Frame::ownerElement): simplify a lot since the Frame knows its owner
renderer now
(WebCore::Frame::ownerRenderer): added
(WebCore::Frame::canCachePage): check m_plugins not m_objects
* page/Frame.h:
* page/FramePrivate.h:
(WebCore::ChildFrame): Remove constructor, most fields.
(WebCore::FramePrivate::FramePrivate): Pass ownerRenderer
* rendering/render_frames.cpp:
(WebCore::RenderPartObject::updateWidget): Make sure to pass name attr
to requestObject.

2006-02-06 Adele Peterson <adele@apple.com>

Reviewed by Maciej.
@@ -118,7 +118,7 @@ enum KWQSelectionDirection {
class MacFrame : public Frame
{
public:
MacFrame();
MacFrame(RenderPart*);
~MacFrame();

void clear();
@@ -130,7 +130,7 @@ - (void *)pluginScriptableObject;
return true;
}

MacFrame::MacFrame()
MacFrame::MacFrame(RenderPart* ownerRenderer)
: _bridge(nil)
, _started(this, SIGNAL(started(KIO::Job *)))
, _completed(this, SIGNAL(completed()))
@@ -152,7 +152,7 @@ - (void *)pluginScriptableObject;
Cache::init();

// The widget is made outside this class in our case.
Frame::init(0);
Frame::init(0, ownerRenderer);

mutableInstances().prepend(this);
}
@@ -987,9 +987,8 @@ - (void *)pluginScriptableObject;
NSView *next = nextKeyViewInFrame(node, direction);
if (!next) {
MacFrame *parent = Mac(treeNode()->parent());
if (parent) {
next = parent->nextKeyViewInFrameHierarchy(parent->childFrame(this)->m_renderer->element(), direction);
}
if (parent)
next = parent->nextKeyViewInFrameHierarchy(ownerElement(), direction);
}

// remove focus from currently focused node if we're giving focus to another view
@@ -183,22 +183,19 @@ typedef enum
@interface WebCoreFrameBridge : NSObject
{
WebCoreMacFrame *m_frame;
WebCoreRenderPart *_renderPart;
RenderArena *_renderPartArena;
BOOL _shouldCreateRenderers;

NSString *_frameNamespace;
}

+ (WebCoreFrameBridge *)bridgeForDOMDocument:(DOMDocument *)document;

- (id)initWithRenderer:(WebCoreRenderPart *)renderer;

+ (NSArray *)supportedMIMETypes;

- (void)initializeSettings:(WebCoreSettings *)settings;

- (void)setRenderPart:(WebCoreRenderPart *)renderPart;
- (WebCoreRenderPart *)renderPart;

- (void)setName:(NSString *)name;
- (NSString *)name;
/* Creates a name for an frame unnamed in the HTML. It should produce repeatable results for loads of the same frameset. */
@@ -270,16 +270,8 @@ - (void)appendChild:(WebCoreFrameBridge *)child
m_frame->treeNode()->appendChild(adoptRef([child part]));
}

- (void)_clearRenderPart
{
if (_renderPart)
_renderPart->deref(_renderPartArena);
_renderPart = 0;
}

- (void)removeChild:(WebCoreFrameBridge *)child
{
[child _clearRenderPart];
m_frame->treeNode()->removeChild([child part]);
}

@@ -477,11 +469,16 @@ + (WebCoreFrameBridge *)bridgeForDOMDocument:(DOMDocument *)document
}

- (id)init
{
return [self initWithRenderer:0];
}

- (id)initWithRenderer:(WebCoreRenderPart *)renderer
{
if (!(self = [super init]))
return nil;

m_frame = new MacFrame;
m_frame = new MacFrame(renderer);
m_frame->setBridge(self);

if (!initializedObjectCacheSize){
@@ -512,10 +509,6 @@ - (void)initializeSettings: (WebCoreSettings *)settings
- (void)dealloc
{
[self removeFromFrame];

if (_renderPart)
_renderPart->deref(_renderPartArena);

[super dealloc];
}

@@ -525,10 +518,6 @@ - (void)finalize
// We need to do it at some well-defined time instead.

[self removeFromFrame];

if (_renderPart) {
_renderPart->deref(_renderPartArena);
}
m_frame->setBridge(nil);

[super finalize];
@@ -539,21 +528,6 @@ - (MacFrame *)part
return m_frame;
}

- (void)setRenderPart:(RenderPart *)newPart;
{
RenderArena *arena = newPart->ref();
if (_renderPart) {
_renderPart->deref(_renderPartArena);
}
_renderPart = newPart;
_renderPartArena = arena;
}

- (RenderPart *)renderPart
{
return _renderPart;
}

- (void)setParent:(WebCoreFrameBridge *)parent
{
// FIXME: frames should be created with the right parent in the first place
@@ -1084,11 +1058,12 @@ - (void)installInFrame:(NSView *)view
{
// If this isn't the main frame, it must have a render m_frame set, or it
// won't ever get installed in the view hierarchy.
ASSERT(self == [self mainFrame] || _renderPart != nil);
ASSERT(self == [self mainFrame] || m_frame->ownerRenderer());

m_frame->view()->setView(view);
if (_renderPart) {
_renderPart->setWidget(m_frame->view());
// FIXME: frame tries to do this too, is it needed?
if (m_frame->ownerRenderer()) {
m_frame->ownerRenderer()->setWidget(m_frame->view());
// Now the render part owns the view, so we don't any more.
}

0 comments on commit 642aad1

Please sign in to comment.