Need to clear viewport dependent units when switching print mode.

Switching between print and screen changes the size of the initial
containing block. Viewport dependent lengths need to be recalculated
and the cache for matched properties cleared.

Normally, notifyResizeForViewportUnits() is called from
performPreLayoutTasks when the initial containing block size changes.
That does not happen when laying out for printing and going back to
screen layout. We skip setting m_lastLayoutSize in
sendResizeEventIfNeeded. We probably do that to avoid triggering resize
events going back and forth between the print (preview) size.

Make sure we clear the matched properties cache from StyleResolver when
updating the media type.

R=mstensho@opera.com
BUG=677799

Review-Url: https://codereview.chromium.org/2613733003
Cr-Commit-Position: refs/heads/master@{#441642}
2 files changed