RenderView is null for import documents.

Documents for html imports have separate StyleEngines and separate lists of
pending stylesheets. However, they don't have a RenderView. In r176050 the
repaint was moved from the StyleEngine where non-master documents skipped
the repaint. Trying to do a repaint from a non-master document will crash
without a check for renderView().

I have added a renderView() check with an assert that checks that it happens
if we are in an import document. I did keep the changing of
m_pendingSheetLayout to IgnoreLayoutWithPendingSheets, since we
envidentially do set it to DidLayoutWithPendingSheets for import documents,
even before the r176050 change.

It is possible that the m_pendingSheetLayout machinery does nothing useful
for imported documents, but I frankly don't know how it should work.

I am only able to reproduce the crash in the layout test with --debug.

R=ojan@chromium.org,esprehn@chromium.org
BUG=386564

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176649 bbb929c8-8fbe-4397-9dbb-9b2b20218538
[DevTools] Implement fitWindow for responsive design.

This patch adds offset and scale parameters to protocol method
Page.setDeviceMetricsOverride. Those are applied when fitWindow
mode is off.

In responsive design mode, when checkbox "fit" is on, page
is scaled down to fit space. When dragging to resize, scale
doesn't change until user releases the drag handle.

BUG=327641

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176650 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Handle layer location and transforms in repaint overlay

Previously repaint rects of all layers are combined into a single array.
If a layer has non-zero position or transform, the visualized repaint
rects will be incorrect.

Now convert layer tree into JSON, so that the overlay page script can
understand the whole layer tree.

BTW removed some original features that are not feasible with the new
repaint rect format. These features are also not very useful.

BUG=381221

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176651 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Code cleanup in ImageBuffer::getImageData

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176652 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Fix selection rect rounding issues on Windows

Change rounding logic for selection rects to account for precision loss
and unify rounding behavior for the selection and selection clip rect
calculations.

* Font.cpp
  (FloatRect Font::pixelSnappedSelectionRect)
    Change how selection rects are snapped to device pixels to adjust
    values by epsilon before rounding right edge just as we already do
    for the left edge. This ensures that precision losses doesn't result
    in incorrect rounding.
* InlineTextBox.cpp
  (alignSelectionRectToDevicePixels)
    Change helper function used to pixel snap the clip rect for
    selection paiting to round the right edge just like the rounding
    logic in Font::pixelSnappedSelectionRect.

TEST=fast/selectors/selection-window-inactive.html,
     fast/selectors/shadow-host-div-with-span.html,
     fast/selectors/shadow-host-div-with-text.html
BUG=382817
R=pdr@chromium.org

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

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