CRASH at WebCore::ReplaceSelectionCommand::removeRedundantMarkup
https://bugs.webkit.org/show_bug.cgi?id=84518
<rdar://problem/10714790>

Reviewed by Simon Fraser.

Source/WebCore: 

There are cases where the m_lastNodeInserted is NULL to begin with or
gets deleted by removeRedundantStylesAndKeepStyleSpanInline.
This change handles those cases properly.
        
Tests: editing/pasteboard/paste-sanitize-crash-1.html
       editing/pasteboard/paste-sanitize-crash-2.html

* editing/ReplaceSelectionCommand.h:
(WebCore::ReplaceSelectionCommand::InsertedNodes::pastLastLeaf):
* editing/SimplifyMarkupCommand.cpp:
(WebCore::SimplifyMarkupCommand::doApply):

LayoutTests: 

* editing/pasteboard/paste-sanitize-crash-1-expected.txt: Added.
* editing/pasteboard/paste-sanitize-crash-1.html: Added.
* editing/pasteboard/paste-sanitize-crash-2-expected.txt: Added.
* editing/pasteboard/paste-sanitize-crash-2.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114817 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rebaseline more GTK css1 tests after <http://trac.webkit.org/changeset/114799>. 

* platform/gtk/css1/box_properties/border_width_inline-expected.txt:
* platform/gtk/css1/box_properties/clear-expected.txt:
* platform/gtk/css1/box_properties/clear_float-expected.txt:
* platform/gtk/css1/box_properties/float-expected.txt:
* platform/gtk/css1/box_properties/float_margin-expected.txt:
* platform/gtk/css1/box_properties/float_on_text_elements-expected.txt:
* platform/gtk/css1/box_properties/height-expected.txt:
* platform/gtk/css1/box_properties/margin-expected.txt:
* platform/gtk/css1/box_properties/margin_bottom-expected.txt:
* platform/gtk/css1/box_properties/margin_bottom_inline-expected.txt:
* platform/gtk/css1/box_properties/margin_inline-expected.txt:
* platform/gtk/css1/box_properties/margin_left-expected.txt:
* platform/gtk/css1/box_properties/margin_left_inline-expected.txt:
* platform/gtk/css1/box_properties/margin_right-expected.txt:
* platform/gtk/css1/box_properties/margin_right_inline-expected.txt:
* platform/gtk/css1/box_properties/margin_top-expected.txt:
* platform/gtk/css1/box_properties/margin_top_inline-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114818 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rebasing fast/background results after r114799.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114819 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rebaseline GTK fast/block tests after <http://trac.webkit.org/changeset/114799>. 

* platform/gtk/fast/block/float/001-expected.txt:
* platform/gtk/fast/block/float/002-expected.txt:
* platform/gtk/fast/block/float/003-expected.txt:
* platform/gtk/fast/block/float/004-expected.txt:
* platform/gtk/fast/block/float/005-expected.txt:
* platform/gtk/fast/block/float/006-expected.txt:
* platform/gtk/fast/block/float/007-expected.txt:
* platform/gtk/fast/block/float/010-expected.txt:
* platform/gtk/fast/block/float/011-expected.txt:
* platform/gtk/fast/block/float/012-expected.txt:
* platform/gtk/fast/block/float/013-expected.txt:
* platform/gtk/fast/block/float/014-expected.txt:
* platform/gtk/fast/block/float/015-expected.txt:
* platform/gtk/fast/block/float/016-expected.txt:
* platform/gtk/fast/block/float/017-expected.txt:
* platform/gtk/fast/block/float/018-expected.txt:
* platform/gtk/fast/block/margin-collapse/001-expected.txt:
* platform/gtk/fast/block/margin-collapse/002-expected.txt:
* platform/gtk/fast/block/margin-collapse/003-expected.txt:
* platform/gtk/fast/block/margin-collapse/004-expected.txt:
* platform/gtk/fast/block/margin-collapse/005-expected.txt:
* platform/gtk/fast/block/margin-collapse/006-expected.txt:
* platform/gtk/fast/block/margin-collapse/block-inside-inline/001-expected.txt:
* platform/gtk/fast/block/margin-collapse/block-inside-inline/002-expected.txt:
* platform/gtk/fast/block/margin-collapse/block-inside-inline/003-expected.txt:
* platform/gtk/fast/block/margin-collapse/block-inside-inline/004-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114820 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rebaseline more GTK css3 and editing tests after <http://trac.webkit.org/changeset/114799>.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rebaseline more GTK css2.1 tests after <http://trac.webkit.org/changeset/114799>.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114822 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rebaseline more GTK css1 tests after <http://trac.webkit.org/changeset/114799>.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114823 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rebaseline more GTK fast/block tests after <http://trac.webkit.org/changeset/114799>.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rebaseline more GTK CSS3 tests after <http://trac.webkit.org/changeset/114799>.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114825 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rebaseline more GTK editing, dom, fast tests after <http://trac.webkit.org/changeset/114799>.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114826 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Refactor opaque content transform out of Skia context
https://bugs.webkit.org/show_bug.cgi?id=83608

Reviewed by James Robinson.

Source/WebCore:

Having PlatformContextSkia know about the transform into content space
for a layer is a layering violation. This change lets the
PlatformContextSkia deal with opaque rects in its own space and lets
the caller handle transforming it into its own space. This also
prevents a matrix multiply per draw into the Skia canvas and does it
just once at the end to transform the final rect.

This is an incremental refactoring so that additional tracking for
text rects can be added and use the same space as opaque rects.

Tests: LayerTextureUpdaterTest.testPartialOpaqueRectNoTransform
       LayerTextureUpdaterTest.testPartialOpaqueRectTranslation
       LayerTextureUpdaterTest.testPartialOpaqueRectScale

* platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.cpp:
(WebCore::BitmapCanvasLayerTextureUpdater::prepareToUpdate):
* platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h:
(BitmapCanvasLayerTextureUpdater):
* platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.cpp:
(WebCore::BitmapSkPictureCanvasLayerTextureUpdater::prepareToUpdate):
* platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h:
(BitmapSkPictureCanvasLayerTextureUpdater):
* platform/graphics/chromium/CanvasLayerTextureUpdater.cpp:
(WebCore::CanvasLayerTextureUpdater::paintContents):
* platform/graphics/chromium/CanvasLayerTextureUpdater.h:
(CanvasLayerTextureUpdater):
* platform/graphics/chromium/LayerTextureUpdater.h:
(WebCore::LayerTextureUpdater::prepareToUpdate):
* platform/graphics/chromium/SkPictureCanvasLayerTextureUpdater.cpp:
(WebCore::SkPictureCanvasLayerTextureUpdater::prepareToUpdate):
* platform/graphics/chromium/SkPictureCanvasLayerTextureUpdater.h:
(SkPictureCanvasLayerTextureUpdater):
* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore::TiledLayerChromium::updateTiles):
* platform/graphics/skia/OpaqueRegionSkia.cpp:
(WebCore::OpaqueRegionSkia::didDrawRect):
(WebCore::OpaqueRegionSkia::didDrawPath):
(WebCore::OpaqueRegionSkia::didDrawPoints):
(WebCore::OpaqueRegionSkia::didDrawBounded):
(WebCore::OpaqueRegionSkia::didDraw):
* platform/graphics/skia/OpaqueRegionSkia.h:
(OpaqueRegionSkia):
* platform/graphics/skia/PlatformContextSkia.cpp:
(WebCore::PlatformContextSkia::didDrawRect):
(WebCore::PlatformContextSkia::didDrawPath):
(WebCore::PlatformContextSkia::didDrawPoints):
(WebCore::PlatformContextSkia::didDrawBounded):
* platform/graphics/skia/PlatformContextSkia.h:
(PlatformContextSkia):

Source/WebKit/chromium:

Add tests for opaque tracking in LayerTextureUpdater, since the
transform logic has moved there.

* tests/CCTiledLayerTestCommon.cpp:
(WebKitTests::FakeLayerTextureUpdater::prepareToUpdate):
* tests/CCTiledLayerTestCommon.h:
(FakeLayerTextureUpdater):
* tests/LayerTextureUpdaterTest.cpp:
(WebCore::PaintFillPartialOpaque::PaintFillPartialOpaque):
(PaintFillPartialOpaque):
(WebCore::PaintFillPartialOpaque::operator()):
(WebCore):
(WebCore::TEST):
* tests/PlatformContextSkiaTest.cpp:
(WebCore::TEST):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114827 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rebaseline more GTK CSS2.1 tests after <http://trac.webkit.org/changeset/114799>.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rebaseline more GTK CSS3 and animation tests after <http://trac.webkit.org/changeset/114799>.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114829 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rebaseline more GTK editing, fast tests after <http://trac.webkit.org/changeset/114799>.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rebaseline more GTK CSS2.1 tests after <http://trac.webkit.org/changeset/114799>.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114831 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rebaseline more GTK CSS3 and editing tests after <http://trac.webkit.org/changeset/114799>.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114832 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rebaseline more GTK fast tests after <http://trac.webkit.org/changeset/114799>.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114833 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Undoing undesired changes.

* fast/block/float/008-expected.txt:
* fast/block/float/019-expected.txt:
* fast/block/float/035-expected.txt:
* fast/block/float/relative-painted-twice-expected.txt:
* fast/block/positioning/negative-rel-position-expected.txt:
* fast/canvas/canvas-bg-expected.txt:
* fast/css-generated-content/table-parts-before-and-after-expected.txt:
* fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* fast/flexbox/flex-hang-expected.txt:
* fast/forms/file/get-file-upload-expected.txt:
* fast/forms/select/listbox-in-multi-column-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make the Web Inspector be the first responder when opening docked.

<rdar://problem/11294217>

Reviewed by Brian Weinstein.

Source/WebKit/mac:

* WebCoreSupport/WebInspectorClient.mm:
(-[WebInspectorWindowController showWindow:]): Call makeFirstResponder: on
the window and pass the Inspector's WebView.

Source/WebKit2:

* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformAttach): Call makeFirstResponder: on
the window and pass the Inspector's WKView.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114835 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rebaseline more GTK tests after <http://trac.webkit.org/changeset/114799>.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114836 268f45cc-cd09-0410-ab3c-d52691b4dbfc