We use to pass a fake viewport size to the cascade() function. That's used for viewport units. With the work in bug 1331213, the missing piece for this is a binding function that takes it from the pres context. Note we need to take into account scrollbars on some cases, so we should do something similar to what CalcViewportUnitsScale does, checking it's thread safe. : http://searchfox.org/mozilla-central/rev/c477aa8bd99278962998adba1c5e4b15a02c42c7/layout/style/nsRuleNode.cpp#398
Sorry, I don't know how to write, sigh.