[webkit-dev] Making top-level style changes through window.internals

Simon Fraser simon.fraser at apple.com
Thu Sep 29 08:44:50 PDT 2011


On Sep 29, 2011, at 8:41 AM, Adam Roben wrote:

> On Sep 29, 2011, at 11:37 AM, Fady Samuel wrote:
> 
>> pageScaleFactor is a document level CSS scaling style. Often times, we'd like to be able to apply style at the document level when writing layout tests. As far as I'm aware, there's no way to do this in javascript in a layout test? Is this correct? If so, would anyone object to exposing document-level styles to window.internals? If not there, is there anywhere else where this can be exposed for testing purposes?
> 
> In the particular case of pageScaleFactor I believe we already have eventSender.scalePageBy. (I think it's on eventSender rather than layoutTestController because it was first used to simulate Safari's pinch-to-zoom feature.)
> 
> Moving this feature to window.internals and adding other similar features seems fine to me.

Agreed.

Fady, in what other instances do you need to change document-level style?

Don't forget that it's possible to change style on the 'html' element (which is the document element) via

document.documentElement.style.foo =...

Simon



More information about the webkit-dev mailing list