[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.18-1-697-g2f78b87
simon.fraser at apple.com
simon.fraser at apple.com
Wed Jan 20 22:16:22 UTC 2010
The following commit has been merged in the debian/unstable branch:
commit dafc4c775ebf537bc6b7473f52c1b23a9c333062
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Jan 7 21:57:12 2010 +0000
2010-01-07 Simon Fraser <simon.fraser at apple.com>
Reviewed by Kevin Decker, Darin Adler.
https://bugs.webkit.org/show_bug.cgi?id=33338
Create a renderer for <object> and <embed>
Add RenderEmbeddedObject, which derives from RenderPartObject, and is created for <object> and <embed>.
Instances of RenderPartObject are now only allocated for iframes.
Move object/embed-related code from RenderPartObject to RenderEmbeddedObject.
* WebCore.xcodeproj/project.pbxproj:
Add RenderEmbeddedObject.h/cpp
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::createRenderer): Create a RenderEmbeddedObject.
(WebCore::HTMLEmbedElement::updateWidget): Use toRenderEmbeddedObject()
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::createRenderer): Make a RenderEmbeddedObject for the plugin-proxy case.
(WebCore::HTMLMediaElement::finishParsingChildren): Use toRenderEmbeddedObject() in the plugin-proxy code.
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::createRenderer): Make a RenderEmbeddedObject
(WebCore::HTMLObjectElement::updateWidget): Use toRenderEmbeddedObject()
* page/FrameView.h:
* page/FrameView.cpp:
(WebCore::FrameView::addWidgetToUpdate):
(WebCore::FrameView::removeWidgetToUpdate):
(WebCore::FrameView::updateWidgets):
Objects in the m_widgetUpdateSet are only ever RenderEmbeddedObjects.
* rendering/RenderEmbeddedObject.cpp: Added.
* rendering/RenderEmbeddedObject.h: Added.
Most of the code moved from RenderPartObject.
* rendering/RenderObject.h:
(WebCore::RenderObject::isEmbeddedObject): New method.
* rendering/RenderPart.cpp:
(WebCore::RenderPart::RenderPart): Initialize m_hasFallbackContent here, rather than in the derived classes.
* rendering/RenderPart.h: Comments.
* rendering/RenderPartObject.h:
* rendering/RenderPartObject.cpp:
(WebCore::RenderPartObject::RenderPartObject): Clean up, code moved to base class, and removed object/embed-specific code.
(WebCore::RenderPartObject::layout): Removed object/embed-specific code.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52947 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index ec6f04a..2d4fd08 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,44 @@
+2010-01-07 Simon Fraser <simon.fraser at apple.com>
+
+ Reviewed by Kevin Decker, Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33338
+ Create a renderer for <object> and <embed>
+
+ Change RenderPartObject to RenderEmbeddedObject in test results.
+
+ * http/tests/misc/acid3-expected.txt:
+ * platform/mac-tiger/svg/hixie/text/003-expected.txt:
+ * platform/mac/editing/pasteboard/pasting-object-expected.txt:
+ * platform/mac/fast/block/basic/013-expected.txt:
+ * platform/mac/fast/block/float/4145535Crash-expected.txt:
+ * platform/mac/fast/dom/HTMLObjectElement/vspace-hspace-as-number-expected.txt:
+ * platform/mac/fast/dynamic/flash-replacement-test-expected.txt:
+ * platform/mac/fast/frames/001-expected.txt:
+ * platform/mac/fast/invalid/residual-style-expected.txt:
+ * platform/mac/fast/parser/001-expected.txt:
+ * platform/mac/fast/replaced/007-expected.txt:
+ * platform/mac/fast/replaced/border-radius-clip-expected.txt:
+ * platform/mac/fast/replaced/replaced-breaking-expected.txt:
+ * platform/mac/plugins/embed-attributes-style-expected.txt:
+ * platform/mac/plugins/netscape-dom-access-expected.txt:
+ * platform/mac/plugins/qt-qwidget-plugin-expected.txt:
+ * platform/mac/svg/custom/getsvgdocument-expected.txt:
+ * platform/mac/svg/custom/scrolling-embedded-svg-file-image-repaint-problem-expected.txt:
+ * platform/mac/svg/hixie/text/003-expected.txt:
+ * platform/qt/editing/pasteboard/pasting-object-expected.txt:
+ * platform/qt/fast/block/basic/013-expected.txt:
+ * platform/qt/fast/block/float/4145535Crash-expected.txt:
+ * platform/qt/fast/dom/HTMLObjectElement/vspace-hspace-as-number-expected.txt:
+ * platform/qt/fast/dynamic/flash-replacement-test-expected.txt:
+ * platform/qt/fast/frames/001-expected.txt:
+ * platform/qt/fast/parser/001-expected.txt:
+ * platform/qt/fast/replaced/007-expected.txt:
+ * platform/qt/fast/replaced/replaced-breaking-expected.txt:
+ * platform/qt/plugins/embed-attributes-style-expected.txt:
+ * platform/qt/plugins/netscape-dom-access-expected.txt:
+ * platform/qt/plugins/qt-qwidget-plugin-expected.txt:
+
2010-01-07 Christian Sejersen <christian.webkit at gmail.com>
Reviewed by Darin Adler.
diff --git a/LayoutTests/http/tests/misc/acid3-expected.txt b/LayoutTests/http/tests/misc/acid3-expected.txt
index c14771a..964259c 100644
--- a/LayoutTests/http/tests/misc/acid3-expected.txt
+++ b/LayoutTests/http/tests/misc/acid3-expected.txt
@@ -226,7 +226,7 @@ layer at (639,17) size 20x20
RenderText at (0,0) size 20x20
text run at (0,0) width 20: "X"
layer at (130,84) size 300x150
- RenderPartObject {OBJECT} at (130,84) size 300x150
+ RenderEmbeddedObject {OBJECT} at (130,84) size 300x150
layer at (0,0) size 300x150
RenderView at (0,0) size 300x150
layer at (0,0) size 300x16
diff --git a/LayoutTests/platform/mac-tiger/svg/hixie/text/003-expected.txt b/LayoutTests/platform/mac-tiger/svg/hixie/text/003-expected.txt
index fa035c4..73a427c 100644
--- a/LayoutTests/platform/mac-tiger/svg/hixie/text/003-expected.txt
+++ b/LayoutTests/platform/mac-tiger/svg/hixie/text/003-expected.txt
@@ -7,7 +7,7 @@ layer at (0,0) size 800x402
RenderText {#text} at (0,0) size 608x18
text run at (0,0) width 608: "The following two blocks should look identical (to the pixel), and they should both say \"PASS\":"
RenderBlock {P} at (0,34) size 784x160
- RenderPartObject {OBJECT} at (0,0) size 306x156 [border: (3px inset #000080)]
+ RenderEmbeddedObject {OBJECT} at (0,0) size 306x156 [border: (3px inset #000080)]
layer at (0,0) size 300x150
RenderView at (0,0) size 300x150
layer at (0,0) size 300x150
@@ -16,7 +16,7 @@ layer at (0,0) size 800x402
RenderSVGInlineText {#text} at (0,-1) size 4x2
chunk 1 text run 1 at (0.00,0.80) startOffset 0 endOffset 4 width 4.00: "PASS"
RenderBlock {P} at (0,210) size 784x160
- RenderPartObject {OBJECT} at (0,0) size 306x156 [border: (3px inset #000080)]
+ RenderEmbeddedObject {OBJECT} at (0,0) size 306x156 [border: (3px inset #000080)]
layer at (0,0) size 300x150
RenderView at (0,0) size 300x150
layer at (0,0) size 300x150
diff --git a/LayoutTests/platform/mac/editing/pasteboard/pasting-object-expected.txt b/LayoutTests/platform/mac/editing/pasteboard/pasting-object-expected.txt
index a4abd29..bc33c14 100644
--- a/LayoutTests/platform/mac/editing/pasteboard/pasting-object-expected.txt
+++ b/LayoutTests/platform/mac/editing/pasteboard/pasting-object-expected.txt
@@ -17,7 +17,7 @@ layer at (0,0) size 800x600
RenderBlock {DIV} at (0,52) size 784x156
RenderText {#text} at (0,138) size 35x18
text run at (0,138) width 35: "Hello"
- RenderPartObject {OBJECT} at (35,0) size 302x152 [border: (1px solid #AAAAAA)]
+ RenderEmbeddedObject {OBJECT} at (35,0) size 302x152 [border: (1px solid #AAAAAA)]
RenderText {#text} at (337,138) size 49x18
text run at (337,138) width 49: " World!"
caret: position 1 of child 1 {OBJECT} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/platform/mac/fast/block/basic/013-expected.txt b/LayoutTests/platform/mac/fast/block/basic/013-expected.txt
index 5fd5678..fafd846 100644
--- a/LayoutTests/platform/mac/fast/block/basic/013-expected.txt
+++ b/LayoutTests/platform/mac/fast/block/basic/013-expected.txt
@@ -17,7 +17,7 @@ layer at (0,0) size 800x600
text run at (0,0) width 147: "This text is underneath."
RenderText {#text} at (504,90) size 4x18
text run at (504,90) width 4: " "
- RenderPartObject {OBJECT} at (0,108) size 500x100
+ RenderEmbeddedObject {OBJECT} at (0,108) size 500x100
layer at (0,0) size 500x100
RenderView at (0,0) size 500x100
layer at (0,0) size 500x100
diff --git a/LayoutTests/platform/mac/fast/block/float/4145535Crash-expected.txt b/LayoutTests/platform/mac/fast/block/float/4145535Crash-expected.txt
index bc23e4c..66d8d19 100644
--- a/LayoutTests/platform/mac/fast/block/float/4145535Crash-expected.txt
+++ b/LayoutTests/platform/mac/fast/block/float/4145535Crash-expected.txt
@@ -4,6 +4,6 @@ layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderBlock (anonymous) at (0,0) size 784x150
- RenderPartObject {EMBED} at (0,0) size 300x150
+ RenderEmbeddedObject {EMBED} at (0,0) size 300x150
RenderTable {TABLE} at (0,150) size 0x0
RenderTableSection {TBODY} at (0,0) size 0x0
diff --git a/LayoutTests/platform/mac/fast/dom/HTMLObjectElement/vspace-hspace-as-number-expected.txt b/LayoutTests/platform/mac/fast/dom/HTMLObjectElement/vspace-hspace-as-number-expected.txt
index 7671c5e..15b5dbf 100644
--- a/LayoutTests/platform/mac/fast/dom/HTMLObjectElement/vspace-hspace-as-number-expected.txt
+++ b/LayoutTests/platform/mac/fast/dom/HTMLObjectElement/vspace-hspace-as-number-expected.txt
@@ -8,7 +8,7 @@ layer at (0,0) size 800x600
text run at (0,0) width 782: "This test makes sure that HTMLObjectElement.vspace and HTMLObjectElement.hspace are exposed as numbers instead of"
text run at (0,18) width 719: "strings, per the DOM Level 2 HTML spec: http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-9893177"
RenderBlock (anonymous) at (0,52) size 784x170
- RenderPartObject {OBJECT} at (20,10) size 300x150
+ RenderEmbeddedObject {OBJECT} at (20,10) size 300x150
RenderText {#text} at (0,0) size 0x0
RenderBlock {DIV} at (0,222) size 784x18
RenderText {#text} at (0,0) size 76x18
diff --git a/LayoutTests/platform/mac/fast/dynamic/flash-replacement-test-expected.txt b/LayoutTests/platform/mac/fast/dynamic/flash-replacement-test-expected.txt
index 1bee8be..c6d6ae5 100644
--- a/LayoutTests/platform/mac/fast/dynamic/flash-replacement-test-expected.txt
+++ b/LayoutTests/platform/mac/fast/dynamic/flash-replacement-test-expected.txt
@@ -4,7 +4,7 @@ layer at (0,0) size 800x271
RenderBlock {HTML} at (0,0) size 800x271
RenderBody {BODY} at (8,8) size 784x255
RenderBlock (anonymous) at (0,0) size 784x158
- RenderPartObject {OBJECT} at (0,0) size 249x154
+ RenderEmbeddedObject {OBJECT} at (0,0) size 249x154
RenderText {#text} at (249,140) size 4x18
text run at (249,140) width 4: " "
RenderBR {BR} at (0,0) size 0x0
diff --git a/LayoutTests/platform/mac/fast/frames/001-expected.txt b/LayoutTests/platform/mac/fast/frames/001-expected.txt
index 86673fa..23a0f49 100644
--- a/LayoutTests/platform/mac/fast/frames/001-expected.txt
+++ b/LayoutTests/platform/mac/fast/frames/001-expected.txt
@@ -14,7 +14,7 @@ layer at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 84x84
RenderText {#text} at (170,174) size 4x18
text run at (170,174) width 4: " "
- RenderPartObject {OBJECT} at (174,18) size 170x170 [border: (10px solid #FF0000)]
+ RenderEmbeddedObject {OBJECT} at (174,18) size 170x170 [border: (10px solid #FF0000)]
layer at (0,0) size 100x100
RenderView at (0,0) size 100x100
layer at (0,0) size 100x100
@@ -22,7 +22,7 @@ layer at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 84x84
RenderText {#text} at (344,174) size 4x18
text run at (344,174) width 4: " "
- RenderPartObject {OBJECT} at (348,18) size 170x170 [border: (10px solid #FF0000)]
+ RenderEmbeddedObject {OBJECT} at (348,18) size 170x170 [border: (10px solid #FF0000)]
layer at (0,0) size 100x100
RenderView at (0,0) size 100x100
layer at (0,0) size 100x100
diff --git a/LayoutTests/platform/mac/fast/invalid/residual-style-expected.txt b/LayoutTests/platform/mac/fast/invalid/residual-style-expected.txt
index c5342d9..8b0f8c5 100644
--- a/LayoutTests/platform/mac/fast/invalid/residual-style-expected.txt
+++ b/LayoutTests/platform/mac/fast/invalid/residual-style-expected.txt
@@ -292,7 +292,7 @@ layer at (0,0) size 785x3441
RenderBlock (anonymous) at (0,1097) size 769x18
RenderText {#text} at (0,0) size 65x18
text run at (0,0) width 65: "EMBED: "
- RenderPartObject {EMBED} at (65,14) size 0x0
+ RenderEmbeddedObject {EMBED} at (65,14) size 0x0
RenderInline {FONT} at (0,0) size 171x18 [color=#008000]
RenderText {#text} at (65,0) size 171x18
text run at (65,0) width 171: "All of this should be green."
diff --git a/LayoutTests/platform/mac/fast/parser/001-expected.txt b/LayoutTests/platform/mac/fast/parser/001-expected.txt
index 0a59e99..6308eb7 100644
--- a/LayoutTests/platform/mac/fast/parser/001-expected.txt
+++ b/LayoutTests/platform/mac/fast/parser/001-expected.txt
@@ -22,7 +22,7 @@ layer at (0,0) size 800x600
RenderText {#text} at (0,0) size 64x15
text run at (0,0) width 64: "Pre text"
text run at (64,0) width 0: " "
- RenderPartObject {OBJECT} at (0,15) size 300x300 [bgcolor=#008000]
+ RenderEmbeddedObject {OBJECT} at (0,15) size 300x300 [bgcolor=#008000]
RenderText {#text} at (300,303) size 300x30
text run at (300,303) width 0: " "
text run at (0,318) width 104: "Also pre text"
diff --git a/LayoutTests/platform/mac/fast/replaced/007-expected.txt b/LayoutTests/platform/mac/fast/replaced/007-expected.txt
index 60fb389..c734d07 100644
--- a/LayoutTests/platform/mac/fast/replaced/007-expected.txt
+++ b/LayoutTests/platform/mac/fast/replaced/007-expected.txt
@@ -15,7 +15,7 @@ layer at (0,0) size 800x600
RenderBR {BR} at (623,154) size 0x0
RenderText {#text} at (163,294) size 158x18
text run at (163,294) width 158: "This should be centered. "
- RenderPartObject {OBJECT} at (321,158) size 300x150
+ RenderEmbeddedObject {OBJECT} at (321,158) size 300x150
layer at (0,0) size 300x150
RenderView at (0,0) size 300x150
layer at (0,0) size 300x150
diff --git a/LayoutTests/platform/mac/fast/replaced/border-radius-clip-expected.txt b/LayoutTests/platform/mac/fast/replaced/border-radius-clip-expected.txt
index 024f61a..a85daed 100644
--- a/LayoutTests/platform/mac/fast/replaced/border-radius-clip-expected.txt
+++ b/LayoutTests/platform/mac/fast/replaced/border-radius-clip-expected.txt
@@ -27,7 +27,7 @@ layer at (0,0) size 785x952
RenderText {#text} at (300,520) size 4x18
text run at (300,520) width 4: " "
RenderBR {BR} at (0,0) size 0x0
- RenderPartObject {EMBED} at (0,538) size 556x406 [bgcolor=#00FF00] [border: (3px solid #000000)]
+ RenderEmbeddedObject {EMBED} at (0,538) size 556x406 [bgcolor=#00FF00] [border: (3px solid #000000)]
RenderText {#text} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
layer at (8,392) size 300x150
diff --git a/LayoutTests/platform/mac/fast/replaced/replaced-breaking-expected.txt b/LayoutTests/platform/mac/fast/replaced/replaced-breaking-expected.txt
index a1ff481..0d9e8c2 100644
--- a/LayoutTests/platform/mac/fast/replaced/replaced-breaking-expected.txt
+++ b/LayoutTests/platform/mac/fast/replaced/replaced-breaking-expected.txt
@@ -59,8 +59,8 @@ layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 25x25
RenderBody {BODY} at (8,8) size 9x9
RenderText {#text} at (0,0) size 0x0
- RenderPartObject {EMBED} at (1,483) size 27x27 [border: (1px solid #000000)]
- RenderPartObject {EMBED} at (1,510) size 27x27 [border: (1px solid #000000)]
+ RenderEmbeddedObject {EMBED} at (1,483) size 27x27 [border: (1px solid #000000)]
+ RenderEmbeddedObject {EMBED} at (1,510) size 27x27 [border: (1px solid #000000)]
RenderText {#text} at (0,0) size 0x0
layer at (14,14) size 122x13
RenderBlock {DIV} at (3,3) size 122x13
diff --git a/LayoutTests/platform/mac/plugins/embed-attributes-style-expected.txt b/LayoutTests/platform/mac/plugins/embed-attributes-style-expected.txt
index b2d73b7..2a52682 100644
--- a/LayoutTests/platform/mac/plugins/embed-attributes-style-expected.txt
+++ b/LayoutTests/platform/mac/plugins/embed-attributes-style-expected.txt
@@ -12,17 +12,17 @@ layer at (0,0) size 800x600
RenderBlock {HR} at (0,52) size 784x2 [border: (1px inset #000000)]
RenderBlock {DIV} at (0,62) size 784x0
RenderBlock {DIV} at (0,62) size 784x104
- RenderPartObject {EMBED} at (0,0) size 50x100
+ RenderEmbeddedObject {EMBED} at (0,0) size 50x100
RenderText {#text} at (50,86) size 122x18
text run at (50,86) width 4: " "
text run at (54,86) width 118: "valign top attribute"
RenderBlock {DIV} at (0,166) size 784x104
- RenderPartObject {EMBED} at (0,0) size 50x100
+ RenderEmbeddedObject {EMBED} at (0,0) size 50x100
RenderText {#text} at (50,86) size 128x18
text run at (50,86) width 4: " "
text run at (54,86) width 124: "border 5px attribute"
RenderBlock {DIV} at (0,270) size 784x106
- RenderPartObject {EMBED} at (0,0) size 52x102 [border: (1px dashed #000000)]
+ RenderEmbeddedObject {EMBED} at (0,0) size 52x102 [border: (1px dashed #000000)]
RenderText {#text} at (52,88) size 102x18
text run at (52,88) width 4: " "
text run at (56,88) width 98: "hidden attribute"
diff --git a/LayoutTests/platform/mac/plugins/netscape-dom-access-expected.txt b/LayoutTests/platform/mac/plugins/netscape-dom-access-expected.txt
index 1680363..757b38e 100644
--- a/LayoutTests/platform/mac/plugins/netscape-dom-access-expected.txt
+++ b/LayoutTests/platform/mac/plugins/netscape-dom-access-expected.txt
@@ -8,7 +8,7 @@ layer at (0,0) size 800x600
text run at (0,0) width 508: "This page tests whether Netscape plug-ins can access their own DOM elements. "
text run at (508,0) width 266: "The plug-in should have a 3px red border."
RenderBlock (anonymous) at (0,34) size 784x206
- RenderPartObject {EMBED} at (0,0) size 206x206 [border: (3px solid #FF0000)]
+ RenderEmbeddedObject {EMBED} at (0,0) size 206x206 [border: (3px solid #FF0000)]
RenderText {#text} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/platform/mac/plugins/qt-qwidget-plugin-expected.txt b/LayoutTests/platform/mac/plugins/qt-qwidget-plugin-expected.txt
index 2102817..fd39bba 100644
--- a/LayoutTests/platform/mac/plugins/qt-qwidget-plugin-expected.txt
+++ b/LayoutTests/platform/mac/plugins/qt-qwidget-plugin-expected.txt
@@ -14,10 +14,10 @@ layer at (0,0) size 800x600
RenderBlock {DIV} at (0,102) size 784x34
RenderText {#text} at (0,16) size 111x18
text run at (0,16) width 111: "QT progress bar: "
- RenderPartObject {OBJECT} at (111,0) size 300x30
+ RenderEmbeddedObject {OBJECT} at (111,0) size 300x30
RenderText {#text} at (0,0) size 0x0
RenderBlock {DIV} at (0,136) size 784x34
RenderText {#text} at (0,16) size 156x18
text run at (0,16) width 156: "You should not see this: "
- RenderPartObject {OBJECT} at (156,0) size 300x30
+ RenderEmbeddedObject {OBJECT} at (156,0) size 300x30
RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/platform/mac/svg/custom/getsvgdocument-expected.txt b/LayoutTests/platform/mac/svg/custom/getsvgdocument-expected.txt
index 13d473e..f85062a 100644
--- a/LayoutTests/platform/mac/svg/custom/getsvgdocument-expected.txt
+++ b/LayoutTests/platform/mac/svg/custom/getsvgdocument-expected.txt
@@ -8,7 +8,7 @@ layer at (0,0) size 800x600
text run at (0,0) width 767: "This tests to see if HTMLEmbedElement.getSVGDocument() and HTMLObjectElement.getSVGDocument() work. You"
text run at (0,18) width 300: "should see SUCCESS printed twice below this:"
RenderBlock (anonymous) at (0,52) size 784x58
- RenderPartObject {EMBED} at (0,0) size 85x20
+ RenderEmbeddedObject {EMBED} at (0,0) size 85x20
layer at (0,0) size 85x20
RenderView at (0,0) size 85x20
layer at (0,0) size 85x20
@@ -19,7 +19,7 @@ layer at (0,0) size 800x600
chunk 1 text run 1 at (5.00,16.00) startOffset 0 endOffset 7 width 71.00: "SUCCESS"
RenderBR {BR} at (85,20) size 0x0
RenderBR {BR} at (0,20) size 0x18
- RenderPartObject {OBJECT} at (0,38) size 85x20
+ RenderEmbeddedObject {OBJECT} at (0,38) size 85x20
layer at (0,0) size 85x20
RenderView at (0,0) size 85x20
layer at (0,0) size 85x20
diff --git a/LayoutTests/platform/mac/svg/custom/scrolling-embedded-svg-file-image-repaint-problem-expected.txt b/LayoutTests/platform/mac/svg/custom/scrolling-embedded-svg-file-image-repaint-problem-expected.txt
index 5fbfa52..5b3cd21 100644
--- a/LayoutTests/platform/mac/svg/custom/scrolling-embedded-svg-file-image-repaint-problem-expected.txt
+++ b/LayoutTests/platform/mac/svg/custom/scrolling-embedded-svg-file-image-repaint-problem-expected.txt
@@ -54,7 +54,7 @@ layer at (0,0) size 1026x1035
text run at (202,9) width 91: "PNG Image"
RenderTableRow {TR} at (0,149) size 998x381
RenderTableCell {TD} at (2,149) size 496x381 [r=2 c=0 rs=1 cs=1]
- RenderPartObject {EMBED} at (8,8) size 480x360
+ RenderEmbeddedObject {EMBED} at (8,8) size 480x360
layer at (0,0) size 480x360
RenderView at (0,0) size 480x360
layer at (0,0) size 480x360
diff --git a/LayoutTests/platform/mac/svg/hixie/text/003-expected.txt b/LayoutTests/platform/mac/svg/hixie/text/003-expected.txt
index 1485804..ebe04fc 100644
--- a/LayoutTests/platform/mac/svg/hixie/text/003-expected.txt
+++ b/LayoutTests/platform/mac/svg/hixie/text/003-expected.txt
@@ -7,7 +7,7 @@ layer at (0,0) size 800x402
RenderText {#text} at (0,0) size 608x18
text run at (0,0) width 608: "The following two blocks should look identical (to the pixel), and they should both say \"PASS\":"
RenderBlock {P} at (0,34) size 784x160
- RenderPartObject {OBJECT} at (0,0) size 306x156 [border: (3px inset #000080)]
+ RenderEmbeddedObject {OBJECT} at (0,0) size 306x156 [border: (3px inset #000080)]
layer at (0,0) size 300x150
RenderView at (0,0) size 300x150
layer at (0,0) size 300x150
@@ -16,7 +16,7 @@ layer at (0,0) size 800x402
RenderSVGInlineText {#text} at (0,-1) size 4x2
chunk 1 text run 1 at (0.00,0.80) startOffset 0 endOffset 4 width 3.00: "PASS"
RenderBlock {P} at (0,210) size 784x160
- RenderPartObject {OBJECT} at (0,0) size 306x156 [border: (3px inset #000080)]
+ RenderEmbeddedObject {OBJECT} at (0,0) size 306x156 [border: (3px inset #000080)]
layer at (0,0) size 300x150
RenderView at (0,0) size 300x150
layer at (0,0) size 300x150
diff --git a/LayoutTests/platform/qt/editing/pasteboard/pasting-object-expected.txt b/LayoutTests/platform/qt/editing/pasteboard/pasting-object-expected.txt
index e3f8bb1..68e5de0 100644
--- a/LayoutTests/platform/qt/editing/pasteboard/pasting-object-expected.txt
+++ b/LayoutTests/platform/qt/editing/pasteboard/pasting-object-expected.txt
@@ -17,7 +17,7 @@ layer at (0,0) size 800x600
RenderBlock {DIV} at (0,52) size 784x157
RenderText {#text} at (0,138) size 32x19
text run at (0,138) width 32: "Hello"
- RenderPartObject {OBJECT} at (32,0) size 302x152 [border: (1px solid #AAAAAA)]
+ RenderEmbeddedObject {OBJECT} at (32,0) size 302x152 [border: (1px solid #AAAAAA)]
RenderText {#text} at (334,138) size 45x19
text run at (334,138) width 45: " World!"
caret: position 1 of child 1 {OBJECT} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/platform/qt/fast/block/basic/013-expected.txt b/LayoutTests/platform/qt/fast/block/basic/013-expected.txt
index bd6382b..0958480 100644
--- a/LayoutTests/platform/qt/fast/block/basic/013-expected.txt
+++ b/LayoutTests/platform/qt/fast/block/basic/013-expected.txt
@@ -17,7 +17,7 @@ layer at (0,0) size 800x600
text run at (0,0) width 149: "This text is underneath."
RenderText {#text} at (504,90) size 4x19
text run at (504,90) width 4: " "
- RenderPartObject {OBJECT} at (0,109) size 500x100
+ RenderEmbeddedObject {OBJECT} at (0,109) size 500x100
layer at (0,0) size 500x100
RenderView at (0,0) size 500x100
layer at (0,0) size 500x100
diff --git a/LayoutTests/platform/qt/fast/block/float/4145535Crash-expected.txt b/LayoutTests/platform/qt/fast/block/float/4145535Crash-expected.txt
index bc23e4c..66d8d19 100644
--- a/LayoutTests/platform/qt/fast/block/float/4145535Crash-expected.txt
+++ b/LayoutTests/platform/qt/fast/block/float/4145535Crash-expected.txt
@@ -4,6 +4,6 @@ layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderBlock (anonymous) at (0,0) size 784x150
- RenderPartObject {EMBED} at (0,0) size 300x150
+ RenderEmbeddedObject {EMBED} at (0,0) size 300x150
RenderTable {TABLE} at (0,150) size 0x0
RenderTableSection {TBODY} at (0,0) size 0x0
diff --git a/LayoutTests/platform/qt/fast/dom/HTMLObjectElement/vspace-hspace-as-number-expected.txt b/LayoutTests/platform/qt/fast/dom/HTMLObjectElement/vspace-hspace-as-number-expected.txt
index e8014b1..552346a 100644
--- a/LayoutTests/platform/qt/fast/dom/HTMLObjectElement/vspace-hspace-as-number-expected.txt
+++ b/LayoutTests/platform/qt/fast/dom/HTMLObjectElement/vspace-hspace-as-number-expected.txt
@@ -8,7 +8,7 @@ layer at (0,0) size 800x600
text run at (0,0) width 771: "This test makes sure that HTMLObjectElement.vspace and HTMLObjectElement.hspace are exposed as numbers instead"
text run at (0,19) width 697: "of strings, per the DOM Level 2 HTML spec: http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-9893177"
RenderBlock (anonymous) at (0,52) size 784x170
- RenderPartObject {OBJECT} at (20,10) size 300x150
+ RenderEmbeddedObject {OBJECT} at (20,10) size 300x150
RenderText {#text} at (0,0) size 0x0
RenderBlock {DIV} at (0,222) size 784x19
RenderText {#text} at (0,0) size 70x19
diff --git a/LayoutTests/platform/qt/fast/dynamic/flash-replacement-test-expected.txt b/LayoutTests/platform/qt/fast/dynamic/flash-replacement-test-expected.txt
index 1839264..510afa6 100644
--- a/LayoutTests/platform/qt/fast/dynamic/flash-replacement-test-expected.txt
+++ b/LayoutTests/platform/qt/fast/dynamic/flash-replacement-test-expected.txt
@@ -4,7 +4,7 @@ layer at (0,0) size 800x268
RenderBlock {HTML} at (0,0) size 800x268
RenderBody {BODY} at (8,8) size 784x252
RenderBlock (anonymous) at (0,0) size 784x159
- RenderPartObject {OBJECT} at (0,0) size 249x154
+ RenderEmbeddedObject {OBJECT} at (0,0) size 249x154
RenderText {#text} at (249,140) size 4x19
text run at (249,140) width 4: " "
RenderBR {BR} at (0,0) size 0x0
diff --git a/LayoutTests/platform/qt/fast/frames/001-expected.txt b/LayoutTests/platform/qt/fast/frames/001-expected.txt
index 65ec720..1b4f00d 100644
--- a/LayoutTests/platform/qt/fast/frames/001-expected.txt
+++ b/LayoutTests/platform/qt/fast/frames/001-expected.txt
@@ -14,7 +14,7 @@ layer at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 84x84
RenderText {#text} at (170,175) size 4x19
text run at (170,175) width 4: " "
- RenderPartObject {OBJECT} at (174,19) size 170x170 [border: (10px solid #FF0000)]
+ RenderEmbeddedObject {OBJECT} at (174,19) size 170x170 [border: (10px solid #FF0000)]
layer at (0,0) size 100x100
RenderView at (0,0) size 100x100
layer at (0,0) size 100x100
@@ -22,7 +22,7 @@ layer at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 84x84
RenderText {#text} at (344,175) size 4x19
text run at (344,175) width 4: " "
- RenderPartObject {OBJECT} at (348,19) size 170x170 [border: (10px solid #FF0000)]
+ RenderEmbeddedObject {OBJECT} at (348,19) size 170x170 [border: (10px solid #FF0000)]
layer at (0,0) size 100x100
RenderView at (0,0) size 100x100
layer at (0,0) size 100x100
diff --git a/LayoutTests/platform/qt/fast/parser/001-expected.txt b/LayoutTests/platform/qt/fast/parser/001-expected.txt
index 2e25d9f..8aff708 100644
--- a/LayoutTests/platform/qt/fast/parser/001-expected.txt
+++ b/LayoutTests/platform/qt/fast/parser/001-expected.txt
@@ -22,7 +22,7 @@ layer at (0,0) size 800x600
RenderText {#text} at (0,0) size 49x19
text run at (0,0) width 49: "Pre text"
text run at (49,0) width 0: " "
- RenderPartObject {OBJECT} at (0,19) size 300x300 [bgcolor=#008000]
+ RenderEmbeddedObject {OBJECT} at (0,19) size 300x300 [bgcolor=#008000]
RenderText {#text} at (300,305) size 300x38
text run at (300,305) width 0: " "
text run at (0,324) width 79: "Also pre text"
diff --git a/LayoutTests/platform/qt/fast/replaced/007-expected.txt b/LayoutTests/platform/qt/fast/replaced/007-expected.txt
index ed0509f..780c244 100644
--- a/LayoutTests/platform/qt/fast/replaced/007-expected.txt
+++ b/LayoutTests/platform/qt/fast/replaced/007-expected.txt
@@ -15,7 +15,7 @@ layer at (0,0) size 800x600
RenderBR {BR} at (624,154) size 0x0
RenderText {#text} at (161,295) size 161x19
text run at (161,295) width 161: "This should be centered. "
- RenderPartObject {OBJECT} at (322,159) size 300x150
+ RenderEmbeddedObject {OBJECT} at (322,159) size 300x150
layer at (0,0) size 300x150
RenderView at (0,0) size 300x150
layer at (0,0) size 300x150
diff --git a/LayoutTests/platform/qt/fast/replaced/replaced-breaking-expected.txt b/LayoutTests/platform/qt/fast/replaced/replaced-breaking-expected.txt
index 7c5fb39..6b772b2 100644
--- a/LayoutTests/platform/qt/fast/replaced/replaced-breaking-expected.txt
+++ b/LayoutTests/platform/qt/fast/replaced/replaced-breaking-expected.txt
@@ -59,8 +59,8 @@ layer at (0,0) size 800x668
RenderBlock {HTML} at (0,0) size 25x25
RenderBody {BODY} at (8,8) size 9x9
RenderText {#text} at (0,0) size 0x0
- RenderPartObject {EMBED} at (1,597) size 27x27 [border: (1px solid #000000)]
- RenderPartObject {EMBED} at (1,624) size 27x27 [border: (1px solid #000000)]
+ RenderEmbeddedObject {EMBED} at (1,597) size 27x27 [border: (1px solid #000000)]
+ RenderEmbeddedObject {EMBED} at (1,624) size 27x27 [border: (1px solid #000000)]
RenderText {#text} at (0,0) size 0x0
layer at (14,14) size 162x19
RenderBlock {DIV} at (3,3) size 162x19
diff --git a/LayoutTests/platform/qt/plugins/embed-attributes-style-expected.txt b/LayoutTests/platform/qt/plugins/embed-attributes-style-expected.txt
index 4933636..ce18adc 100644
--- a/LayoutTests/platform/qt/plugins/embed-attributes-style-expected.txt
+++ b/LayoutTests/platform/qt/plugins/embed-attributes-style-expected.txt
@@ -12,17 +12,17 @@ layer at (0,0) size 800x600
RenderBlock {HR} at (0,52) size 784x2 [border: (1px inset #000000)]
RenderBlock {DIV} at (0,61) size 784x0
RenderBlock {DIV} at (0,61) size 784x105
- RenderPartObject {EMBED} at (0,0) size 50x100
+ RenderEmbeddedObject {EMBED} at (0,0) size 50x100
RenderText {#text} at (50,86) size 121x19
text run at (50,86) width 4: " "
text run at (54,86) width 117: "valign top attribute"
RenderBlock {DIV} at (0,166) size 784x105
- RenderPartObject {EMBED} at (0,0) size 50x100
+ RenderEmbeddedObject {EMBED} at (0,0) size 50x100
RenderText {#text} at (50,86) size 129x19
text run at (50,86) width 4: " "
text run at (54,86) width 125: "border 5px attribute"
RenderBlock {DIV} at (0,271) size 784x107
- RenderPartObject {EMBED} at (0,0) size 52x102 [border: (1px dashed #000000)]
+ RenderEmbeddedObject {EMBED} at (0,0) size 52x102 [border: (1px dashed #000000)]
RenderText {#text} at (52,88) size 103x19
text run at (52,88) width 4: " "
text run at (56,88) width 99: "hidden attribute"
diff --git a/LayoutTests/platform/qt/plugins/netscape-dom-access-expected.txt b/LayoutTests/platform/qt/plugins/netscape-dom-access-expected.txt
index 38b5b42..7a60930 100644
--- a/LayoutTests/platform/qt/plugins/netscape-dom-access-expected.txt
+++ b/LayoutTests/platform/qt/plugins/netscape-dom-access-expected.txt
@@ -9,7 +9,7 @@ layer at (0,0) size 800x600
text run at (573,0) width 185: "The plug-in should have a"
text run at (0,20) width 107: "3px red border."
RenderBlock (anonymous) at (0,56) size 784x206
- RenderPartObject {EMBED} at (0,0) size 206x206 [border: (3px solid #FF0000)] [QT: geometry: {at (8,64) size 200x200} isHidden: 0 isSelfVisible: 1 isParentVisible: 1 mask: {at (0,0) size 200x200} ]
+ RenderEmbeddedObject {EMBED} at (0,0) size 206x206 [border: (3px solid #FF0000)] [QT: geometry: {at (8,64) size 200x200} isHidden: 0 isSelfVisible: 1 isParentVisible: 1 mask: {at (0,0) size 200x200} ]
RenderText {#text} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/platform/qt/plugins/qt-qwidget-plugin-expected.txt b/LayoutTests/platform/qt/plugins/qt-qwidget-plugin-expected.txt
index fcca77d..e7f4315 100644
--- a/LayoutTests/platform/qt/plugins/qt-qwidget-plugin-expected.txt
+++ b/LayoutTests/platform/qt/plugins/qt-qwidget-plugin-expected.txt
@@ -14,10 +14,10 @@ layer at (0,0) size 800x600
RenderBlock {DIV} at (0,104) size 784x34
RenderText {#text} at (0,14) size 123x20
text run at (0,14) width 123: "QT progress bar: "
- RenderPartObject {OBJECT} at (123,0) size 300x30 [QT: geometry: {at (131,112) size 300x30} isHidden: 0 isSelfVisible: 1 isParentVisible: 1 mask: {at (0,0) size 300x30} ]
+ RenderEmbeddedObject {OBJECT} at (123,0) size 300x30 [QT: geometry: {at (131,112) size 300x30} isHidden: 0 isSelfVisible: 1 isParentVisible: 1 mask: {at (0,0) size 300x30} ]
RenderText {#text} at (0,0) size 0x0
RenderBlock {DIV} at (0,138) size 784x34
RenderText {#text} at (0,14) size 174x20
text run at (0,14) width 174: "You should not see this: "
- RenderPartObject {OBJECT} at (174,0) size 300x30 [QT: geometry: {at (182,146) size 300x30} isHidden: 1 isSelfVisible: 0 isParentVisible: 1 mask: {at (0,0) size 300x30} ]
+ RenderEmbeddedObject {OBJECT} at (174,0) size 300x30 [QT: geometry: {at (182,146) size 300x30} isHidden: 1 isSelfVisible: 0 isParentVisible: 1 mask: {at (0,0) size 300x30} ]
RenderText {#text} at (0,0) size 0x0
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index c01fc63..5437621 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,5 +1,55 @@
2010-01-07 Simon Fraser <simon.fraser at apple.com>
+ Reviewed by Kevin Decker, Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33338
+ Create a renderer for <object> and <embed>
+
+ Add RenderEmbeddedObject, which derives from RenderPartObject, and is created for <object> and <embed>.
+ Instances of RenderPartObject are now only allocated for iframes.
+
+ Move object/embed-related code from RenderPartObject to RenderEmbeddedObject.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ Add RenderEmbeddedObject.h/cpp
+
+ * html/HTMLEmbedElement.cpp:
+ (WebCore::HTMLEmbedElement::createRenderer): Create a RenderEmbeddedObject.
+ (WebCore::HTMLEmbedElement::updateWidget): Use toRenderEmbeddedObject()
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::createRenderer): Make a RenderEmbeddedObject for the plugin-proxy case.
+ (WebCore::HTMLMediaElement::finishParsingChildren): Use toRenderEmbeddedObject() in the plugin-proxy code.
+
+ * html/HTMLObjectElement.cpp:
+ (WebCore::HTMLObjectElement::createRenderer): Make a RenderEmbeddedObject
+ (WebCore::HTMLObjectElement::updateWidget): Use toRenderEmbeddedObject()
+
+ * page/FrameView.h:
+ * page/FrameView.cpp:
+ (WebCore::FrameView::addWidgetToUpdate):
+ (WebCore::FrameView::removeWidgetToUpdate):
+ (WebCore::FrameView::updateWidgets):
+ Objects in the m_widgetUpdateSet are only ever RenderEmbeddedObjects.
+
+ * rendering/RenderEmbeddedObject.cpp: Added.
+ * rendering/RenderEmbeddedObject.h: Added.
+ Most of the code moved from RenderPartObject.
+
+ * rendering/RenderObject.h:
+ (WebCore::RenderObject::isEmbeddedObject): New method.
+
+ * rendering/RenderPart.cpp:
+ (WebCore::RenderPart::RenderPart): Initialize m_hasFallbackContent here, rather than in the derived classes.
+ * rendering/RenderPart.h: Comments.
+
+ * rendering/RenderPartObject.h:
+ * rendering/RenderPartObject.cpp:
+ (WebCore::RenderPartObject::RenderPartObject): Clean up, code moved to base class, and removed object/embed-specific code.
+ (WebCore::RenderPartObject::layout): Removed object/embed-specific code.
+
+2010-01-07 Simon Fraser <simon.fraser at apple.com>
+
Reviewed by Darin Adler.
https://bugs.webkit.org/show_bug.cgi?id=33338
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 37c2356..89c64f6 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -181,6 +181,8 @@
0F580CFE0F12DE9B0051D689 /* RenderLayerCompositor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F580CFA0F12DE9B0051D689 /* RenderLayerCompositor.cpp */; };
0F580CFF0F12DE9B0051D689 /* RenderLayerBacking.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F580CFB0F12DE9B0051D689 /* RenderLayerBacking.h */; };
0F580D000F12DE9B0051D689 /* RenderLayerBacking.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F580CFC0F12DE9B0051D689 /* RenderLayerBacking.cpp */; };
+ 0F5B7A5410F65D7A00376302 /* RenderEmbeddedObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F5B7A5210F65D7A00376302 /* RenderEmbeddedObject.cpp */; };
+ 0F5B7A5510F65D7A00376302 /* RenderEmbeddedObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5B7A5310F65D7A00376302 /* RenderEmbeddedObject.h */; };
0F6ECD450F252F3700BDE271 /* CSSPropertyLonghand.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F6ECD430F252F3700BDE271 /* CSSPropertyLonghand.h */; };
0F6ECD460F252F3700BDE271 /* CSSPropertyLonghand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F6ECD440F252F3700BDE271 /* CSSPropertyLonghand.cpp */; };
0FC705210EB1815600B90AD8 /* AtomicStringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC705200EB1815600B90AD8 /* AtomicStringHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -5396,6 +5398,8 @@
0F580CFA0F12DE9B0051D689 /* RenderLayerCompositor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderLayerCompositor.cpp; sourceTree = "<group>"; };
0F580CFB0F12DE9B0051D689 /* RenderLayerBacking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderLayerBacking.h; sourceTree = "<group>"; };
0F580CFC0F12DE9B0051D689 /* RenderLayerBacking.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderLayerBacking.cpp; sourceTree = "<group>"; };
+ 0F5B7A5210F65D7A00376302 /* RenderEmbeddedObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderEmbeddedObject.cpp; sourceTree = "<group>"; };
+ 0F5B7A5310F65D7A00376302 /* RenderEmbeddedObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderEmbeddedObject.h; sourceTree = "<group>"; };
0F6ECD430F252F3700BDE271 /* CSSPropertyLonghand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSPropertyLonghand.h; sourceTree = "<group>"; };
0F6ECD440F252F3700BDE271 /* CSSPropertyLonghand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSPropertyLonghand.cpp; sourceTree = "<group>"; };
0F9C6F4B1073EF0400DED9BF /* WebCore.3DRendering.exp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.exports; path = WebCore.3DRendering.exp; sourceTree = "<group>"; };
@@ -15505,6 +15509,8 @@
A871DECD0A1530C700B12A68 /* RenderPartObject.h */,
853CA9EE0AEEC657002372DC /* RenderPath.cpp */,
853CA9EF0AEEC657002372DC /* RenderPath.h */,
+ 0F5B7A5210F65D7A00376302 /* RenderEmbeddedObject.cpp */,
+ 0F5B7A5310F65D7A00376302 /* RenderEmbeddedObject.h */,
A871DFDE0A15376B00B12A68 /* RenderReplaced.cpp */,
A871DFDF0A15376B00B12A68 /* RenderReplaced.h */,
BCA846D40DC67A350026C309 /* RenderReplica.cpp */,
@@ -18313,6 +18319,7 @@
5112247610CFB8E8008099D7 /* ThreadableWebSocketChannelClientWrapper.h in Headers */,
5112247A10CFB8FF008099D7 /* WorkerThreadableWebSocketChannel.h in Headers */,
37C28A6810F659CC008C7813 /* TypesettingFeatures.h in Headers */,
+ 0F5B7A5510F65D7A00376302 /* RenderEmbeddedObject.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -20473,6 +20480,7 @@
0AFDAC3B10F5448300E1F3D2 /* PluginWidgetMac.mm in Sources */,
5112247210CFB8C6008099D7 /* ThreadableWebSocketChannel.cpp in Sources */,
5112247810CFB8F4008099D7 /* WorkerThreadableWebSocketChannel.cpp in Sources */,
+ 0F5B7A5410F65D7A00376302 /* RenderEmbeddedObject.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebCore/html/HTMLEmbedElement.cpp b/WebCore/html/HTMLEmbedElement.cpp
index 81b88a4..6c62848 100644
--- a/WebCore/html/HTMLEmbedElement.cpp
+++ b/WebCore/html/HTMLEmbedElement.cpp
@@ -32,8 +32,8 @@
#include "HTMLNames.h"
#include "HTMLObjectElement.h"
#include "MappedAttribute.h"
+#include "RenderEmbeddedObject.h"
#include "RenderImage.h"
-#include "RenderPartObject.h"
#include "RenderWidget.h"
#include "ScriptController.h"
#include "Settings.h"
@@ -155,7 +155,7 @@ RenderObject* HTMLEmbedElement::createRenderer(RenderArena* arena, RenderStyle*)
{
if (isImageType())
return new (arena) RenderImage(this);
- return new (arena) RenderPartObject(this);
+ return new (arena) RenderEmbeddedObject(this);
}
void HTMLEmbedElement::attach()
@@ -183,7 +183,7 @@ void HTMLEmbedElement::updateWidget()
{
document()->updateStyleIfNeeded();
if (m_needWidgetUpdate && renderer() && !isImageType())
- toRenderPartObject(renderer())->updateWidget(true);
+ toRenderEmbeddedObject(renderer())->updateWidget(true);
}
void HTMLEmbedElement::insertedIntoDocument()
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp
index ba8f219..fd83460 100644
--- a/WebCore/html/HTMLMediaElement.cpp
+++ b/WebCore/html/HTMLMediaElement.cpp
@@ -239,7 +239,7 @@ bool HTMLMediaElement::rendererIsNeeded(RenderStyle* style)
RenderObject* HTMLMediaElement::createRenderer(RenderArena* arena, RenderStyle*)
{
#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
- return new (arena) RenderPartObject(this);
+ return new (arena) RenderEmbeddedObject(this);
#else
return new (arena) RenderMedia(this);
#endif
@@ -1765,7 +1765,7 @@ void HTMLMediaElement::finishParsingChildren()
document()->updateStyleIfNeeded();
if (m_needWidgetUpdate && renderer())
- toRenderPartObject(renderer())->updateWidget(true);
+ toRenderEmbeddedObject(renderer())->updateWidget(true);
}
#endif
diff --git a/WebCore/html/HTMLObjectElement.cpp b/WebCore/html/HTMLObjectElement.cpp
index 7a6a14d..80a5efa 100644
--- a/WebCore/html/HTMLObjectElement.cpp
+++ b/WebCore/html/HTMLObjectElement.cpp
@@ -35,8 +35,8 @@
#include "ScriptEventListener.h"
#include "MIMETypeRegistry.h"
#include "MappedAttribute.h"
+#include "RenderEmbeddedObject.h"
#include "RenderImage.h"
-#include "RenderPartObject.h"
#include "RenderWidget.h"
#include "ScriptController.h"
#include "Text.h"
@@ -140,7 +140,7 @@ RenderObject *HTMLObjectElement::createRenderer(RenderArena* arena, RenderStyle*
return RenderObject::createObject(this, style);
if (isImageType())
return new (arena) RenderImage(this);
- return new (arena) RenderPartObject(this);
+ return new (arena) RenderEmbeddedObject(this);
}
void HTMLObjectElement::attach()
@@ -169,7 +169,7 @@ void HTMLObjectElement::updateWidget()
{
document()->updateStyleIfNeeded();
if (m_needWidgetUpdate && renderer() && !m_useFallbackContent && !isImageType())
- toRenderPartObject(renderer())->updateWidget(true);
+ toRenderEmbeddedObject(renderer())->updateWidget(true);
}
void HTMLObjectElement::finishParsingChildren()
diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp
index 2ccd0d2..145d3f2 100644
--- a/WebCore/page/FrameView.cpp
+++ b/WebCore/page/FrameView.cpp
@@ -46,8 +46,8 @@
#include "HTMLNames.h"
#include "InspectorTimelineAgent.h"
#include "OverflowEvent.h"
+#include "RenderEmbeddedObject.h"
#include "RenderPart.h"
-#include "RenderPartObject.h"
#include "RenderScrollbar.h"
#include "RenderScrollbarPart.h"
#include "RenderTheme.h"
@@ -752,15 +752,15 @@ void FrameView::layout(bool allowSubtree)
m_nestedLayoutCount--;
}
-void FrameView::addWidgetToUpdate(RenderPartObject* object)
+void FrameView::addWidgetToUpdate(RenderEmbeddedObject* object)
{
if (!m_widgetUpdateSet)
- m_widgetUpdateSet.set(new HashSet<RenderPartObject*>);
+ m_widgetUpdateSet.set(new RenderEmbeddedObjectSet);
m_widgetUpdateSet->add(object);
}
-void FrameView::removeWidgetToUpdate(RenderPartObject* object)
+void FrameView::removeWidgetToUpdate(RenderEmbeddedObject* object)
{
if (!m_widgetUpdateSet)
return;
@@ -1346,11 +1346,11 @@ bool FrameView::updateWidgets()
if (m_nestedLayoutCount > 1 || !m_widgetUpdateSet || m_widgetUpdateSet->isEmpty())
return true;
- Vector<RenderPartObject*> objectVector;
+ Vector<RenderEmbeddedObject*> objectVector;
copyToVector(*m_widgetUpdateSet, objectVector);
size_t size = objectVector.size();
for (size_t i = 0; i < size; ++i) {
- RenderPartObject* object = objectVector[i];
+ RenderEmbeddedObject* object = objectVector[i];
object->updateWidget(false);
// updateWidget() can destroy the RenderPartObject, so we need to make sure it's
diff --git a/WebCore/page/FrameView.h b/WebCore/page/FrameView.h
index d6b658c..b27ffd8 100644
--- a/WebCore/page/FrameView.h
+++ b/WebCore/page/FrameView.h
@@ -45,7 +45,7 @@ class Node;
class PlatformMouseEvent;
class RenderLayer;
class RenderObject;
-class RenderPartObject;
+class RenderEmbeddedObject;
class ScheduledEvent;
class String;
@@ -165,8 +165,8 @@ public:
bool wasScrolledByUser() const;
void setWasScrolledByUser(bool);
- void addWidgetToUpdate(RenderPartObject*);
- void removeWidgetToUpdate(RenderPartObject*);
+ void addWidgetToUpdate(RenderEmbeddedObject*);
+ void removeWidgetToUpdate(RenderEmbeddedObject*);
virtual void paintContents(GraphicsContext*, const IntRect& damageRect);
void setPaintBehavior(PaintBehavior);
@@ -256,7 +256,9 @@ private:
IntSize m_size;
IntSize m_margins;
- OwnPtr<HashSet<RenderPartObject*> > m_widgetUpdateSet;
+
+ typedef HashSet<RenderEmbeddedObject*> RenderEmbeddedObjectSet;
+ OwnPtr<RenderEmbeddedObjectSet> m_widgetUpdateSet;
RefPtr<Frame> m_frame;
bool m_doFullRepaint;
diff --git a/WebCore/rendering/RenderEmbeddedObject.cpp b/WebCore/rendering/RenderEmbeddedObject.cpp
new file mode 100644
index 0000000..ad42b04
--- /dev/null
+++ b/WebCore/rendering/RenderEmbeddedObject.cpp
@@ -0,0 +1,332 @@
+/*
+ * Copyright (C) 1999 Lars Knoll (knoll at kde.org)
+ * (C) 2000 Simon Hausmann <hausmann at kde.org>
+ * (C) 2000 Stefan Schimanski (1Stein at gmx.de)
+ * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 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
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "RenderEmbeddedObject.h"
+
+#include "Frame.h"
+#include "FrameLoaderClient.h"
+#include "HTMLEmbedElement.h"
+#include "HTMLIFrameElement.h"
+#include "HTMLNames.h"
+#include "HTMLObjectElement.h"
+#include "HTMLParamElement.h"
+#include "MIMETypeRegistry.h"
+#include "Page.h"
+#include "RenderView.h"
+#include "RenderWidgetProtector.h"
+#include "Text.h"
+
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+#include "HTMLVideoElement.h"
+#endif
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+RenderEmbeddedObject::RenderEmbeddedObject(Element* element)
+ : RenderPartObject(element)
+{
+ view()->frameView()->setIsVisuallyNonEmpty();
+}
+
+RenderEmbeddedObject::~RenderEmbeddedObject()
+{
+ if (frameView())
+ frameView()->removeWidgetToUpdate(this);
+}
+
+static bool isURLAllowed(Document* doc, const String& url)
+{
+ if (doc->frame()->page()->frameCount() >= 200)
+ return false;
+
+ // We allow one level of self-reference because some sites depend on that.
+ // But we don't allow more than one.
+ KURL completeURL = doc->completeURL(url);
+ bool foundSelfReference = false;
+ for (Frame* frame = doc->frame(); frame; frame = frame->tree()->parent()) {
+ if (equalIgnoringFragmentIdentifier(frame->loader()->url(), completeURL)) {
+ if (foundSelfReference)
+ return false;
+ foundSelfReference = true;
+ }
+ }
+ return true;
+}
+
+typedef HashMap<String, String, CaseFoldingHash> ClassIdToTypeMap;
+
+static ClassIdToTypeMap* createClassIdToTypeMap()
+{
+ ClassIdToTypeMap* map = new ClassIdToTypeMap;
+ map->add("clsid:D27CDB6E-AE6D-11CF-96B8-444553540000", "application/x-shockwave-flash");
+ map->add("clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA", "audio/x-pn-realaudio-plugin");
+ map->add("clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B", "video/quicktime");
+ map->add("clsid:166B1BCA-3F9C-11CF-8075-444553540000", "application/x-director");
+ map->add("clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6", "application/x-mplayer2");
+ map->add("clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95", "application/x-mplayer2");
+ return map;
+}
+
+static String serviceTypeForClassId(const String& classId)
+{
+ // Return early if classId is empty (since we won't do anything below).
+ // Furthermore, if classId is null, calling get() below will crash.
+ if (classId.isEmpty())
+ return String();
+
+ static ClassIdToTypeMap* map = createClassIdToTypeMap();
+ return map->get(classId);
+}
+
+static void mapDataParamToSrc(Vector<String>* paramNames, Vector<String>* paramValues)
+{
+ // Some plugins don't understand the "data" attribute of the OBJECT tag (i.e. Real and WMP
+ // require "src" attribute).
+ int srcIndex = -1, dataIndex = -1;
+ for (unsigned int i = 0; i < paramNames->size(); ++i) {
+ if (equalIgnoringCase((*paramNames)[i], "src"))
+ srcIndex = i;
+ else if (equalIgnoringCase((*paramNames)[i], "data"))
+ dataIndex = i;
+ }
+
+ if (srcIndex == -1 && dataIndex != -1) {
+ paramNames->append("src");
+ paramValues->append((*paramValues)[dataIndex]);
+ }
+}
+
+void RenderEmbeddedObject::updateWidget(bool onlyCreateNonNetscapePlugins)
+{
+ String url;
+ String serviceType;
+ Vector<String> paramNames;
+ Vector<String> paramValues;
+ Frame* frame = frameView()->frame();
+
+ // The calls to FrameLoader::requestObject within this function can result in a plug-in being initialized.
+ // This can run cause arbitrary JavaScript to run and may result in this RenderObject being detached from
+ // the render tree and destroyed, causing a crash like <rdar://problem/6954546>. By extending our lifetime
+ // artifically to ensure that we remain alive for the duration of plug-in initialization.
+ RenderWidgetProtector protector(this);
+
+ if (node()->hasTagName(objectTag)) {
+ HTMLObjectElement* objectElement = static_cast<HTMLObjectElement*>(node());
+
+ objectElement->setNeedWidgetUpdate(false);
+ if (!objectElement->isFinishedParsingChildren())
+ return;
+
+ // Check for a child EMBED tag.
+ HTMLEmbedElement* embed = 0;
+ for (Node* child = objectElement->firstChild(); child; ) {
+ if (child->hasTagName(embedTag)) {
+ embed = static_cast<HTMLEmbedElement*>(child);
+ break;
+ }
+
+ if (child->hasTagName(objectTag))
+ child = child->nextSibling(); // Don't descend into nested OBJECT tags
+ else
+ child = child->traverseNextNode(objectElement); // Otherwise descend (EMBEDs may be inside COMMENT tags)
+ }
+
+ // Use the attributes from the EMBED tag instead of the OBJECT tag including WIDTH and HEIGHT.
+ HTMLElement* embedOrObject;
+ if (embed) {
+ embedOrObject = embed;
+ url = embed->url();
+ serviceType = embed->serviceType();
+ } else
+ embedOrObject = objectElement;
+
+ // If there was no URL or type defined in EMBED, try the OBJECT tag.
+ if (url.isEmpty())
+ url = objectElement->url();
+ if (serviceType.isEmpty())
+ serviceType = objectElement->serviceType();
+
+ HashSet<StringImpl*, CaseFoldingHash> uniqueParamNames;
+
+ // Scan the PARAM children.
+ // Get the URL and type from the params if we don't already have them.
+ // Get the attributes from the params if there is no EMBED tag.
+ Node* child = objectElement->firstChild();
+ while (child && (url.isEmpty() || serviceType.isEmpty() || !embed)) {
+ if (child->hasTagName(paramTag)) {
+ HTMLParamElement* p = static_cast<HTMLParamElement*>(child);
+ String name = p->name();
+ if (url.isEmpty() && (equalIgnoringCase(name, "src") || equalIgnoringCase(name, "movie") || equalIgnoringCase(name, "code") || equalIgnoringCase(name, "url")))
+ url = p->value();
+ if (serviceType.isEmpty() && equalIgnoringCase(name, "type")) {
+ serviceType = p->value();
+ int pos = serviceType.find(";");
+ if (pos != -1)
+ serviceType = serviceType.left(pos);
+ }
+ if (!embed && !name.isEmpty()) {
+ uniqueParamNames.add(name.impl());
+ paramNames.append(p->name());
+ paramValues.append(p->value());
+ }
+ }
+ child = child->nextSibling();
+ }
+
+ // When OBJECT is used for an applet via Sun's Java plugin, the CODEBASE attribute in the tag
+ // points to the Java plugin itself (an ActiveX component) while the actual applet CODEBASE is
+ // in a PARAM tag. See <http://java.sun.com/products/plugin/1.2/docs/tags.html>. This means
+ // we have to explicitly suppress the tag's CODEBASE attribute if there is none in a PARAM,
+ // else our Java plugin will misinterpret it. [4004531]
+ String codebase;
+ if (!embed && MIMETypeRegistry::isJavaAppletMIMEType(serviceType)) {
+ codebase = "codebase";
+ uniqueParamNames.add(codebase.impl()); // pretend we found it in a PARAM already
+ }
+
+ // Turn the attributes of either the EMBED tag or OBJECT tag into arrays, but don't override PARAM values.
+ NamedNodeMap* attributes = embedOrObject->attributes();
+ if (attributes) {
+ for (unsigned i = 0; i < attributes->length(); ++i) {
+ Attribute* it = attributes->attributeItem(i);
+ const AtomicString& name = it->name().localName();
+ if (embed || !uniqueParamNames.contains(name.impl())) {
+ paramNames.append(name.string());
+ paramValues.append(it->value().string());
+ }
+ }
+ }
+
+ mapDataParamToSrc(¶mNames, ¶mValues);
+
+ // If we still don't have a type, try to map from a specific CLASSID to a type.
+ if (serviceType.isEmpty())
+ serviceType = serviceTypeForClassId(objectElement->classId());
+
+ if (!isURLAllowed(document(), url))
+ return;
+
+ // Find out if we support fallback content.
+ m_hasFallbackContent = false;
+ for (Node* child = objectElement->firstChild(); child && !m_hasFallbackContent; child = child->nextSibling()) {
+ if ((!child->isTextNode() && !child->hasTagName(embedTag) && !child->hasTagName(paramTag)) // Discount <embed> and <param>
+ || (child->isTextNode() && !static_cast<Text*>(child)->containsOnlyWhitespace()))
+ m_hasFallbackContent = true;
+ }
+
+ if (onlyCreateNonNetscapePlugins) {
+ KURL completedURL;
+ if (!url.isEmpty())
+ completedURL = frame->loader()->completeURL(url);
+
+ if (frame->loader()->client()->objectContentType(completedURL, serviceType) == ObjectContentNetscapePlugin)
+ return;
+ }
+
+ bool success = objectElement->dispatchBeforeLoadEvent(url) && frame->loader()->requestObject(this, url, objectElement->getAttribute(nameAttr), serviceType, paramNames, paramValues);
+ if (!success && m_hasFallbackContent)
+ objectElement->renderFallbackContent();
+
+ } else if (node()->hasTagName(embedTag)) {
+ HTMLEmbedElement* embedElement = static_cast<HTMLEmbedElement*>(node());
+ embedElement->setNeedWidgetUpdate(false);
+ url = embedElement->url();
+ serviceType = embedElement->serviceType();
+
+ if (url.isEmpty() && serviceType.isEmpty())
+ return;
+ if (!isURLAllowed(document(), url))
+ return;
+
+ // add all attributes set on the embed object
+ NamedNodeMap* attributes = embedElement->attributes();
+ if (attributes) {
+ for (unsigned i = 0; i < attributes->length(); ++i) {
+ Attribute* it = attributes->attributeItem(i);
+ paramNames.append(it->name().localName().string());
+ paramValues.append(it->value().string());
+ }
+ }
+
+ if (onlyCreateNonNetscapePlugins) {
+ KURL completedURL;
+ if (!url.isEmpty())
+ completedURL = frame->loader()->completeURL(url);
+
+ if (frame->loader()->client()->objectContentType(completedURL, serviceType) == ObjectContentNetscapePlugin)
+ return;
+ }
+
+ if (embedElement->dispatchBeforeLoadEvent(url))
+ frame->loader()->requestObject(this, url, embedElement->getAttribute(nameAttr), serviceType, paramNames, paramValues);
+ }
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+ else if (node()->hasTagName(videoTag) || node()->hasTagName(audioTag)) {
+ HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(node());
+
+ mediaElement->setNeedWidgetUpdate(false);
+ if (node()->hasTagName(videoTag)) {
+ HTMLVideoElement* vid = static_cast<HTMLVideoElement*>(node());
+ String poster = vid->poster();
+ if (!poster.isEmpty()) {
+ paramNames.append("_media_element_poster_");
+ paramValues.append(poster);
+ }
+ }
+
+ url = mediaElement->initialURL();
+ if (!url.isEmpty()) {
+ paramNames.append("_media_element_src_");
+ paramValues.append(url);
+ }
+
+ serviceType = "application/x-media-element-proxy-plugin";
+
+ if (mediaElement->dispatchBeforeLoadEvent(url))
+ frame->loader()->requestObject(this, url, nullAtom, serviceType, paramNames, paramValues);
+ }
+#endif
+}
+
+void RenderEmbeddedObject::layout()
+{
+ ASSERT(needsLayout());
+
+ calcWidth();
+ calcHeight();
+
+ RenderPart::layout();
+
+ m_overflow.clear();
+ addShadowOverflow();
+
+ if (!widget() && frameView())
+ frameView()->addWidgetToUpdate(this);
+
+ setNeedsLayout(false);
+}
+
+}
diff --git a/WebCore/rendering/RenderEmbeddedObject.h b/WebCore/rendering/RenderEmbeddedObject.h
new file mode 100644
index 0000000..ad1911e
--- /dev/null
+++ b/WebCore/rendering/RenderEmbeddedObject.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 1999 Lars Knoll (knoll at kde.org)
+ * (C) 2000 Simon Hausmann <hausmann at kde.org>
+ * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 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
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef RenderEmbeddedObject_h
+#define RenderEmbeddedObject_h
+
+#include "RenderPartObject.h"
+
+namespace WebCore {
+
+// Renderer for embeds and objects.
+class RenderEmbeddedObject : public RenderPartObject {
+public:
+ RenderEmbeddedObject(Element*);
+ virtual ~RenderEmbeddedObject();
+
+ void updateWidget(bool onlyCreateNonNetscapePlugins);
+
+private:
+ virtual const char* renderName() const { return "RenderEmbeddedObject"; }
+ virtual bool isEmbeddedObject() const { return true; }
+
+ virtual void layout();
+};
+
+inline RenderEmbeddedObject* toRenderEmbeddedObject(RenderObject* object)
+{
+ ASSERT(!object || !strcmp(object->renderName(), "RenderEmbeddedObject"));
+ return static_cast<RenderEmbeddedObject*>(object);
+}
+
+// This will catch anyone doing an unnecessary cast.
+void toRenderEmbeddedObject(const RenderEmbeddedObject*);
+
+} // namespace WebCore
+
+#endif // RenderEmbeddedObject_h
diff --git a/WebCore/rendering/RenderObject.h b/WebCore/rendering/RenderObject.h
index 097e088..b65a036 100644
--- a/WebCore/rendering/RenderObject.h
+++ b/WebCore/rendering/RenderObject.h
@@ -263,6 +263,7 @@ public:
virtual bool isBlockFlow() const { return false; }
virtual bool isBoxModelObject() const { return false; }
virtual bool isCounter() const { return false; }
+ virtual bool isEmbeddedObject() const { return false; }
virtual bool isFieldset() const { return false; }
virtual bool isFileUploadControl() const { return false; }
virtual bool isFrame() const { return false; }
diff --git a/WebCore/rendering/RenderPart.cpp b/WebCore/rendering/RenderPart.cpp
index cb56c0c..5c4a6ec 100644
--- a/WebCore/rendering/RenderPart.cpp
+++ b/WebCore/rendering/RenderPart.cpp
@@ -31,6 +31,7 @@ namespace WebCore {
RenderPart::RenderPart(Element* node)
: RenderWidget(node)
+ , m_hasFallbackContent(false)
{
// init RenderObject attributes
setInline(false);
diff --git a/WebCore/rendering/RenderPart.h b/WebCore/rendering/RenderPart.h
index 08abf99..8303543 100644
--- a/WebCore/rendering/RenderPart.h
+++ b/WebCore/rendering/RenderPart.h
@@ -27,6 +27,10 @@
namespace WebCore {
+// Renderer for frames via RenderPartObject, and plug-ins via RenderEmbeddedObject.
+
+// FIXME: This class is subclassed in RenderPartObject for iframes, which is in turn
+// subclassed in RenderEmbeddedObject for object and embed. This class itself could be removed.
class RenderPart : public RenderWidget {
public:
RenderPart(Element*);
diff --git a/WebCore/rendering/RenderPartObject.cpp b/WebCore/rendering/RenderPartObject.cpp
index e2c8e7d..2870d6c 100644
--- a/WebCore/rendering/RenderPartObject.cpp
+++ b/WebCore/rendering/RenderPartObject.cpp
@@ -48,271 +48,6 @@ using namespace HTMLNames;
RenderPartObject::RenderPartObject(Element* element)
: RenderPart(element)
{
- // init RenderObject attributes
- setInline(true);
- m_hasFallbackContent = false;
-
- if (element->hasTagName(embedTag) || element->hasTagName(objectTag))
- view()->frameView()->setIsVisuallyNonEmpty();
-}
-
-RenderPartObject::~RenderPartObject()
-{
- if (frameView())
- frameView()->removeWidgetToUpdate(this);
-}
-
-static bool isURLAllowed(Document* doc, const String& url)
-{
- if (doc->frame()->page()->frameCount() >= 200)
- return false;
-
- // We allow one level of self-reference because some sites depend on that.
- // But we don't allow more than one.
- KURL completeURL = doc->completeURL(url);
- bool foundSelfReference = false;
- for (Frame* frame = doc->frame(); frame; frame = frame->tree()->parent()) {
- if (equalIgnoringFragmentIdentifier(frame->loader()->url(), completeURL)) {
- if (foundSelfReference)
- return false;
- foundSelfReference = true;
- }
- }
- return true;
-}
-
-typedef HashMap<String, String, CaseFoldingHash> ClassIdToTypeMap;
-
-static ClassIdToTypeMap* createClassIdToTypeMap()
-{
- ClassIdToTypeMap* map = new ClassIdToTypeMap;
- map->add("clsid:D27CDB6E-AE6D-11CF-96B8-444553540000", "application/x-shockwave-flash");
- map->add("clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA", "audio/x-pn-realaudio-plugin");
- map->add("clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B", "video/quicktime");
- map->add("clsid:166B1BCA-3F9C-11CF-8075-444553540000", "application/x-director");
- map->add("clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6", "application/x-mplayer2");
- map->add("clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95", "application/x-mplayer2");
- return map;
-}
-
-static String serviceTypeForClassId(const String& classId)
-{
- // Return early if classId is empty (since we won't do anything below).
- // Furthermore, if classId is null, calling get() below will crash.
- if (classId.isEmpty())
- return String();
-
- static ClassIdToTypeMap* map = createClassIdToTypeMap();
- return map->get(classId);
-}
-
-static void mapDataParamToSrc(Vector<String>* paramNames, Vector<String>* paramValues)
-{
- // Some plugins don't understand the "data" attribute of the OBJECT tag (i.e. Real and WMP
- // require "src" attribute).
- int srcIndex = -1, dataIndex = -1;
- for (unsigned int i = 0; i < paramNames->size(); ++i) {
- if (equalIgnoringCase((*paramNames)[i], "src"))
- srcIndex = i;
- else if (equalIgnoringCase((*paramNames)[i], "data"))
- dataIndex = i;
- }
-
- if (srcIndex == -1 && dataIndex != -1) {
- paramNames->append("src");
- paramValues->append((*paramValues)[dataIndex]);
- }
-}
-
-void RenderPartObject::updateWidget(bool onlyCreateNonNetscapePlugins)
-{
- String url;
- String serviceType;
- Vector<String> paramNames;
- Vector<String> paramValues;
- Frame* frame = frameView()->frame();
-
- // The calls to FrameLoader::requestObject within this function can result in a plug-in being initialized.
- // This can run cause arbitrary JavaScript to run and may result in this RenderObject being detached from
- // the render tree and destroyed, causing a crash like <rdar://problem/6954546>. By extending our lifetime
- // artifically to ensure that we remain alive for the duration of plug-in initialization.
- RenderWidgetProtector protector(this);
-
- if (node()->hasTagName(objectTag)) {
- HTMLObjectElement* o = static_cast<HTMLObjectElement*>(node());
-
- o->setNeedWidgetUpdate(false);
- if (!o->isFinishedParsingChildren())
- return;
-
- // Check for a child EMBED tag.
- HTMLEmbedElement* embed = 0;
- for (Node* child = o->firstChild(); child; ) {
- if (child->hasTagName(embedTag)) {
- embed = static_cast<HTMLEmbedElement*>(child);
- break;
- } else if (child->hasTagName(objectTag))
- child = child->nextSibling(); // Don't descend into nested OBJECT tags
- else
- child = child->traverseNextNode(o); // Otherwise descend (EMBEDs may be inside COMMENT tags)
- }
-
- // Use the attributes from the EMBED tag instead of the OBJECT tag including WIDTH and HEIGHT.
- HTMLElement *embedOrObject;
- if (embed) {
- embedOrObject = (HTMLElement *)embed;
- url = embed->url();
- serviceType = embed->serviceType();
- } else
- embedOrObject = (HTMLElement *)o;
-
- // If there was no URL or type defined in EMBED, try the OBJECT tag.
- if (url.isEmpty())
- url = o->url();
- if (serviceType.isEmpty())
- serviceType = o->serviceType();
-
- HashSet<StringImpl*, CaseFoldingHash> uniqueParamNames;
-
- // Scan the PARAM children.
- // Get the URL and type from the params if we don't already have them.
- // Get the attributes from the params if there is no EMBED tag.
- Node *child = o->firstChild();
- while (child && (url.isEmpty() || serviceType.isEmpty() || !embed)) {
- if (child->hasTagName(paramTag)) {
- HTMLParamElement* p = static_cast<HTMLParamElement*>(child);
- String name = p->name();
- if (url.isEmpty() && (equalIgnoringCase(name, "src") || equalIgnoringCase(name, "movie") || equalIgnoringCase(name, "code") || equalIgnoringCase(name, "url")))
- url = p->value();
- if (serviceType.isEmpty() && equalIgnoringCase(name, "type")) {
- serviceType = p->value();
- int pos = serviceType.find(";");
- if (pos != -1)
- serviceType = serviceType.left(pos);
- }
- if (!embed && !name.isEmpty()) {
- uniqueParamNames.add(name.impl());
- paramNames.append(p->name());
- paramValues.append(p->value());
- }
- }
- child = child->nextSibling();
- }
-
- // When OBJECT is used for an applet via Sun's Java plugin, the CODEBASE attribute in the tag
- // points to the Java plugin itself (an ActiveX component) while the actual applet CODEBASE is
- // in a PARAM tag. See <http://java.sun.com/products/plugin/1.2/docs/tags.html>. This means
- // we have to explicitly suppress the tag's CODEBASE attribute if there is none in a PARAM,
- // else our Java plugin will misinterpret it. [4004531]
- String codebase;
- if (!embed && MIMETypeRegistry::isJavaAppletMIMEType(serviceType)) {
- codebase = "codebase";
- uniqueParamNames.add(codebase.impl()); // pretend we found it in a PARAM already
- }
-
- // Turn the attributes of either the EMBED tag or OBJECT tag into arrays, but don't override PARAM values.
- NamedNodeMap* attributes = embedOrObject->attributes();
- if (attributes) {
- for (unsigned i = 0; i < attributes->length(); ++i) {
- Attribute* it = attributes->attributeItem(i);
- const AtomicString& name = it->name().localName();
- if (embed || !uniqueParamNames.contains(name.impl())) {
- paramNames.append(name.string());
- paramValues.append(it->value().string());
- }
- }
- }
-
- mapDataParamToSrc(¶mNames, ¶mValues);
-
- // If we still don't have a type, try to map from a specific CLASSID to a type.
- if (serviceType.isEmpty())
- serviceType = serviceTypeForClassId(o->classId());
-
- if (!isURLAllowed(document(), url))
- return;
-
- // Find out if we support fallback content.
- m_hasFallbackContent = false;
- for (Node *child = o->firstChild(); child && !m_hasFallbackContent; child = child->nextSibling()) {
- if ((!child->isTextNode() && !child->hasTagName(embedTag) && !child->hasTagName(paramTag)) || // Discount <embed> and <param>
- (child->isTextNode() && !static_cast<Text*>(child)->containsOnlyWhitespace()))
- m_hasFallbackContent = true;
- }
-
- if (onlyCreateNonNetscapePlugins) {
- KURL completedURL;
- if (!url.isEmpty())
- completedURL = frame->loader()->completeURL(url);
-
- if (frame->loader()->client()->objectContentType(completedURL, serviceType) == ObjectContentNetscapePlugin)
- return;
- }
-
- bool success = o->dispatchBeforeLoadEvent(url) &&
- frame->loader()->requestObject(this, url, o->getAttribute(nameAttr), serviceType, paramNames, paramValues);
- if (!success && m_hasFallbackContent)
- o->renderFallbackContent();
- } else if (node()->hasTagName(embedTag)) {
- HTMLEmbedElement *o = static_cast<HTMLEmbedElement*>(node());
- o->setNeedWidgetUpdate(false);
- url = o->url();
- serviceType = o->serviceType();
-
- if (url.isEmpty() && serviceType.isEmpty())
- return;
- if (!isURLAllowed(document(), url))
- return;
-
- // add all attributes set on the embed object
- NamedNodeMap* a = o->attributes();
- if (a) {
- for (unsigned i = 0; i < a->length(); ++i) {
- Attribute* it = a->attributeItem(i);
- paramNames.append(it->name().localName().string());
- paramValues.append(it->value().string());
- }
- }
-
- if (onlyCreateNonNetscapePlugins) {
- KURL completedURL;
- if (!url.isEmpty())
- completedURL = frame->loader()->completeURL(url);
-
- if (frame->loader()->client()->objectContentType(completedURL, serviceType) == ObjectContentNetscapePlugin)
- return;
-
- }
-
- if (o->dispatchBeforeLoadEvent(url))
- frame->loader()->requestObject(this, url, o->getAttribute(nameAttr), serviceType, paramNames, paramValues);
- }
-#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
- else if (node()->hasTagName(videoTag) || node()->hasTagName(audioTag)) {
- HTMLMediaElement* o = static_cast<HTMLMediaElement*>(node());
-
- o->setNeedWidgetUpdate(false);
- if (node()->hasTagName(videoTag)) {
- HTMLVideoElement* vid = static_cast<HTMLVideoElement*>(node());
- String poster = vid->poster();
- if (!poster.isEmpty()) {
- paramNames.append("_media_element_poster_");
- paramValues.append(poster);
- }
- }
-
- url = o->initialURL();
- if (!url.isEmpty()) {
- paramNames.append("_media_element_src_");
- paramValues.append(url);
- }
-
- serviceType = "application/x-media-element-proxy-plugin";
-
- if (o->dispatchBeforeLoadEvent(url))
- frame->loader()->requestObject(this, url, nullAtom, serviceType, paramNames, paramValues);
- }
-#endif
}
void RenderPartObject::layout()
@@ -327,9 +62,6 @@ void RenderPartObject::layout()
m_overflow.clear();
addShadowOverflow();
- if (!widget() && frameView())
- frameView()->addWidgetToUpdate(this);
-
setNeedsLayout(false);
}
diff --git a/WebCore/rendering/RenderPartObject.h b/WebCore/rendering/RenderPartObject.h
index ad956bd..a196273 100644
--- a/WebCore/rendering/RenderPartObject.h
+++ b/WebCore/rendering/RenderPartObject.h
@@ -27,12 +27,10 @@
namespace WebCore {
+// Renderer for iframes. Is subclassed in RenderEmbeddedObject for object and embed.
class RenderPartObject : public RenderPart {
public:
RenderPartObject(Element*);
- virtual ~RenderPartObject();
-
- void updateWidget(bool onlyCreateNonNetscapePlugins);
private:
virtual const char* renderName() const { return "RenderPartObject"; }
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 2f5a913..408c83c 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,11 @@
+2010-01-07 Simon Fraser <simon.fraser at apple.com>
+
+ Reviewed by Darin Adler.
+
+ Add proposed rename of HTMLPlugInImageElement to HTMLEmbeddedObjectElement.
+
+ * Scripts/do-webcore-rename:
+
2010-01-07 Kim Grönholm <kim.gronholm at nomovok.com>
Reviewed by Antti Koivisto.
diff --git a/WebKitTools/Scripts/do-webcore-rename b/WebKitTools/Scripts/do-webcore-rename
index f15a07b..56d8bed 100755
--- a/WebKitTools/Scripts/do-webcore-rename
+++ b/WebKitTools/Scripts/do-webcore-rename
@@ -73,6 +73,8 @@ my %renames = (
);
my %renamesContemplatedForTheFuture = (
+ "HTMLPlugInImageElement" => "HTMLEmbeddedObjectElement",
+
"DOMObject" => "JSDOMObject",
"runtimeObjectGetter" => "pluginElementGetter",
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list