HTMLStyleElement will not parse a style element created in Javascript until it
is attached to the DOM.
I added a reftest for the given cases:
* a style element is defined in the HTML code,
* a style element is created in Javascript, CSS content is added to the
element and the element is later attached to the document,
* a style element is created in Javascript, attached to the document and
later CSS content is added to the element,
* a style element is created in Javascript, CSS content is added to the
* element but the element is never attached to the document.
This ensures that the layout viewport responds to each type of zoom correctly,
and lays the ground for CSS Media Queries and CSS Device Adaption.
Until we have proper touch support, mobile-style "pinch" zoom can be simulated
by holding Ctrl while scrolling with a mousewheel or trackpad gesture.
We do not currently support the case of a non-callback interface that doesn't
have an interface prototype object. (This case is not allowed by the WebIDL
specification; it was added to Gecko to allow feature-detecting the URL
interface. See <https://bugzilla.mozilla.org/show_bug.cgi?id=1026720>.)
It follows that, if we call CreateInterfaceObjects2 at all, we will call it
with a protoClass argument, so there is no reason to use a nullable pointer
type for that argument.
Moreover, if we had actually supported that case, the returned interface
object would have been stored in the interface prototype object cache, to ill
effect.
We already ensure to fail the task if GetProtoObject returns null, as we don't
have a useful way to handle OOM, and we don't wish to thread the failure
through to some place where we could handle it in a useful way.
Unfortunately, we cannot ensure through the type system that none of those
functions returns null, so we use assertions to check it dynamically.
When creating child layers it is important to consider overflow when
determining the size of the layer. This also means that overflow should
not be too large, so also shrink block width down to the size of their
contained fragment. This means that a block that has been explicitly
sized to width:100px should be 100 pixels wide instead of the width of
its containing block.