You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LibWeb: Begin supporting non-image HTMLObjectElement data representation
We currently only supported loading image data from an HTMLObjectElement
node. This adds (some) support for non-image data. A big FIXME is to
actually paint that data. We will need to make FrameBox and
NestedBrowsingContextPaintable work with HTMLObjectElement for this
(they currently only work with HTMLIFrameElement).
// If plugins are being sandboxed, then jump to the step below labeled fallback.
162
172
// Otherwise, the user agent should use the plugin that supports resource type and pass the content of the resource to that plugin. If the plugin reports an error, then jump to the step below labeled fallback.
163
173
164
-
// * FIXME: If the resource type is an XML MIME type, or if the resource type does not start with "image/"
165
-
// If the object element's nested browsing context is null, then create a new nested browsing context for the element.
166
-
// If the URL of the given resource does not match about:blank, then navigate the element's nested browsing context to that resource, with historyHandling set to "replace" and the source browsing context set to the object element's node document's browsing context. (The data attribute of the object element doesn't get updated if the browsing context gets further navigated to other locations.)
167
-
// The object element represents its nested browsing context.
174
+
// * If the resource type is an XML MIME type, or if the resource type does not start with "image/"
175
+
// FIXME: Handle XML MIME types.
176
+
if (!resource_type.starts_with("image/"sv)) {
177
+
// If the object element's nested browsing context is null, then create a new nested browsing context for the element.
178
+
if (!m_nested_browsing_context)
179
+
create_new_nested_browsing_context();
180
+
181
+
// If the URL of the given resource does not match about:blank, then navigate the element's nested browsing context to that resource, with historyHandling set to "replace" and the source browsing context set to the object element's node document's browsing context. (The data attribute of the object element doesn't get updated if the browsing context gets further navigated to other locations.)
182
+
if (autoconst& url = resource()->url(); url != "about:blank"sv)
// 4.10. The element's contents are not part of what the object element represents.
193
217
// 4.11. If the object element does not represent its nested browsing context, then once the resource is completely loaded, queue an element task on the DOM manipulation task source given the object element to fire an event named load at the element.
// 6. Fallback: The object element represents the element's children, ignoring any leading param element children. This is the element's fallback content. If the element has an instantiated plugin, then unload it. If the element's nested browsing context is non-null, then it must be discarded and then set to null.
0 commit comments