RenderLayer::hasVisibleContent should ASSERT(!m_visibleContentStatusDirty)

This CL makes RenderLayer::hasVisibleContent ASSERT that the state it reads
isn't dirty. This CL also fixes a couple callers that were reading the state
while it was dirty.

R=skobes@chromium.org

Review URL: https://codereview.chromium.org/453113002

git-svn-id: svn://svn.chromium.org/blink/trunk@179990 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Fix MQEvaluator::mediaType() related perf regressions.

When we stopped storing the mediaType as a string on m_medium on StyleResolver, 
we started calling FrameView::mediaType() every time that the mediaType as required.
In the related bug's test case, mediaType() was being called a lot, 
in order to compare it to "print" to see which default style sheet should be used.
Since mediaType() calls also call InspectorInstrumentation::applyEmulatedMedia(), 
they have a certain overhead, that impacted the benchmark's results.

I've changed it so that the mediaType() call and the comparison to "print"
would be done once, and the result cached.

BUG=394275

Review URL: https://codereview.chromium.org/405953002

git-svn-id: svn://svn.chromium.org/blink/trunk@179991 bbb929c8-8fbe-4397-9dbb-9b2b20218538