Title: [187063] branches/safari-601.1-branch/Source

Diff

Modified: branches/safari-601.1-branch/Source/WebCore/ChangeLog (187062 => 187063)


--- branches/safari-601.1-branch/Source/WebCore/ChangeLog	2015-07-21 04:36:55 UTC (rev 187062)
+++ branches/safari-601.1-branch/Source/WebCore/ChangeLog	2015-07-21 04:37:00 UTC (rev 187063)
@@ -1,5 +1,43 @@
 2015-07-20  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r186956. rdar://problem/21643094
+
+    2015-07-17  Tim Horton  <timothy_hor...@apple.com>
+
+            iOS TextIndicators include text that is not supposed to be indicated
+            https://bugs.webkit.org/show_bug.cgi?id=147028
+            <rdar://problem/21643094>
+
+            Reviewed by Sam Weinig.
+
+            Paint the selection and background, but not other foregrounds, for iOS TextIndicators.
+
+            * page/FrameSnapshotting.cpp:
+            (WebCore::snapshotFrameRect):
+            * page/FrameSnapshotting.h:
+            Add a new snapshot option where we'll paint backgrounds and the selected
+            foreground and nothing else.
+            Pass the new snapshot option through as a paint behavior.
+
+            * page/TextIndicator.cpp:
+            (WebCore::TextIndicator::createWithRange):
+            Implement the incantations necessary to make a temporary selection
+            change not get sent to the UI process and actually have WebCore know about it
+            and accurately respond to questions about it.
+
+            (WebCore::TextIndicator::createWithSelectionInFrame):
+            Paint selection and backgrounds on iOS.
+
+            * rendering/PaintPhase.h:
+            * rendering/RenderLayer.cpp:
+            (WebCore::RenderLayer::paintLayerContents):
+            * rendering/RenderElement.cpp:
+            (WebCore::RenderElement::selectionColor):
+            Add a new paint behavior, SelectionAndBackgroundsOnly, which behaves
+            the same as selection only except it allows backgrounds to paint.
+
+2015-07-20  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r186916. rdar://problem/21643094
 
     2015-07-16  Tim Horton  <timothy_hor...@apple.com>

Modified: branches/safari-601.1-branch/Source/WebCore/page/FrameSnapshotting.cpp (187062 => 187063)


--- branches/safari-601.1-branch/Source/WebCore/page/FrameSnapshotting.cpp	2015-07-21 04:36:55 UTC (rev 187062)
+++ branches/safari-601.1-branch/Source/WebCore/page/FrameSnapshotting.cpp	2015-07-21 04:37:00 UTC (rev 187063)
@@ -87,6 +87,8 @@
         paintBehavior |= PaintBehaviorForceBlackText;
     if (options & SnapshotOptionsPaintSelectionOnly)
         paintBehavior |= PaintBehaviorSelectionOnly;
+    if (options & SnapshotOptionsPaintSelectionAndBackgroundsOnly)
+        paintBehavior |= PaintBehaviorSelectionAndBackgroundsOnly;
 
     // Other paint behaviors are set by paintContentsForSnapshot.
     frame.view()->setPaintBehavior(paintBehavior);

Modified: branches/safari-601.1-branch/Source/WebCore/page/FrameSnapshotting.h (187062 => 187063)


--- branches/safari-601.1-branch/Source/WebCore/page/FrameSnapshotting.h	2015-07-21 04:36:55 UTC (rev 187062)
+++ branches/safari-601.1-branch/Source/WebCore/page/FrameSnapshotting.h	2015-07-21 04:37:00 UTC (rev 187063)
@@ -45,6 +45,7 @@
     SnapshotOptionsPaintSelectionOnly = 1 << 1,
     SnapshotOptionsInViewCoordinates = 1 << 2,
     SnapshotOptionsForceBlackText = 1 << 3,
+    SnapshotOptionsPaintSelectionAndBackgroundsOnly = 1 << 4,
 };
 typedef unsigned SnapshotOptions;
 

Modified: branches/safari-601.1-branch/Source/WebCore/page/TextIndicator.cpp (187062 => 187063)


--- branches/safari-601.1-branch/Source/WebCore/page/TextIndicator.cpp	2015-07-21 04:36:55 UTC (rev 187062)
+++ branches/safari-601.1-branch/Source/WebCore/page/TextIndicator.cpp	2015-07-21 04:37:00 UTC (rev 187063)
@@ -27,6 +27,7 @@
 #include "TextIndicator.h"
 
 #include "Document.h"
+#include "Editor.h"
 #include "Frame.h"
 #include "FrameSelection.h"
 #include "FrameSnapshotting.h"
@@ -54,6 +55,11 @@
     if (!frame)
         return nullptr;
 
+#if PLATFORM(IOS)
+    frame->editor().setIgnoreCompositionSelectionChange(true);
+    frame->selection().setUpdateAppearanceEnabled(true);
+#endif
+
     VisibleSelection oldSelection = frame->selection().selection();
     frame->selection().setSelection(range);
 
@@ -63,7 +69,12 @@
 
     if (indicator)
         indicator->setWantsMargin(!areRangesEqual(&range, oldSelection.toNormalizedRange().get()));
-    
+
+#if PLATFORM(IOS)
+    frame->editor().setIgnoreCompositionSelectionChange(false);
+    frame->selection().setUpdateAppearanceEnabled(false);
+#endif
+
     return indicator.release();
 }
 
@@ -120,7 +131,7 @@
 
     // FIXME: We should have TextIndicator options instead of this being platform-specific.
 #if PLATFORM(IOS)
-    SnapshotOptions snapshotOptions = SnapshotOptionsNone;
+    SnapshotOptions snapshotOptions = SnapshotOptionsPaintSelectionAndBackgroundsOnly;
 #else
     SnapshotOptions snapshotOptions = SnapshotOptionsForceBlackText | SnapshotOptionsPaintSelectionOnly;
 #endif

Modified: branches/safari-601.1-branch/Source/WebCore/rendering/PaintPhase.h (187062 => 187063)


--- branches/safari-601.1-branch/Source/WebCore/rendering/PaintPhase.h	2015-07-21 04:36:55 UTC (rev 187062)
+++ branches/safari-601.1-branch/Source/WebCore/rendering/PaintPhase.h	2015-07-21 04:37:00 UTC (rev 187063)
@@ -62,6 +62,7 @@
     PaintBehaviorRenderingSVGMask = 1 << 4,
     PaintBehaviorSkipRootBackground = 1 << 5,
     PaintBehaviorRootBackgroundOnly = 1 << 6,
+    PaintBehaviorSelectionAndBackgroundsOnly = 1 << 7,
 };
 
 typedef unsigned PaintBehavior;

Modified: branches/safari-601.1-branch/Source/WebCore/rendering/RenderElement.cpp (187062 => 187063)


--- branches/safari-601.1-branch/Source/WebCore/rendering/RenderElement.cpp	2015-07-21 04:36:55 UTC (rev 187062)
+++ branches/safari-601.1-branch/Source/WebCore/rendering/RenderElement.cpp	2015-07-21 04:37:00 UTC (rev 187063)
@@ -1575,7 +1575,7 @@
     // If the element is unselectable, or we are only painting the selection,
     // don't override the foreground color with the selection foreground color.
     if (style().userSelect() == SELECT_NONE
-        || (view().frameView().paintBehavior() & PaintBehaviorSelectionOnly))
+        || (view().frameView().paintBehavior() & (PaintBehaviorSelectionOnly | PaintBehaviorSelectionAndBackgroundsOnly)))
         return Color();
 
     if (RefPtr<RenderStyle> pseudoStyle = selectionPseudoStyle()) {

Modified: branches/safari-601.1-branch/Source/WebCore/rendering/RenderLayer.cpp (187062 => 187063)


--- branches/safari-601.1-branch/Source/WebCore/rendering/RenderLayer.cpp	2015-07-21 04:36:55 UTC (rev 187062)
+++ branches/safari-601.1-branch/Source/WebCore/rendering/RenderLayer.cpp	2015-07-21 04:37:00 UTC (rev 187063)
@@ -4275,7 +4275,8 @@
     if (localPaintingInfo.overlapTestRequests && isSelfPaintingLayer)
         performOverlapTests(*localPaintingInfo.overlapTestRequests, localPaintingInfo.rootLayer, this);
 
-    bool selectionOnly  = localPaintingInfo.paintBehavior & PaintBehaviorSelectionOnly;
+    bool selectionAndBackgroundsOnly = localPaintingInfo.paintBehavior & PaintBehaviorSelectionAndBackgroundsOnly;
+    bool selectionOnly = localPaintingInfo.paintBehavior & PaintBehaviorSelectionOnly;
     
     PaintBehavior paintBehavior = PaintBehaviorNormal;
     if (localPaintFlags & PaintLayerPaintingSkipRootBackground)
@@ -4314,7 +4315,7 @@
     if (isPaintingCompositedForeground) {
         if (shouldPaintContent)
             paintForegroundForFragments(layerFragments, context, transparencyLayerContext, paintingInfo.paintDirtyRect, haveTransparency,
-                localPaintingInfo, paintBehavior, subtreePaintRootForRenderer, selectionOnly);
+                localPaintingInfo, paintBehavior, subtreePaintRootForRenderer, selectionOnly || selectionAndBackgroundsOnly);
     }
 
     if (shouldPaintOutline)
@@ -4346,7 +4347,7 @@
     // Make sure that we now use the original transparency context.
     ASSERT(transparencyLayerContext == context);
 
-    if (shouldPaintContent && !selectionOnly) {
+    if (shouldPaintContent && !(selectionOnly || selectionAndBackgroundsOnly)) {
         if (shouldPaintMask(paintingInfo.paintBehavior, localPaintFlags)) {
             // Paint the mask for the fragments.
             paintMaskForFragments(layerFragments, context, localPaintingInfo, subtreePaintRootForRenderer);

Modified: branches/safari-601.1-branch/Source/WebKit2/ChangeLog (187062 => 187063)


--- branches/safari-601.1-branch/Source/WebKit2/ChangeLog	2015-07-21 04:36:55 UTC (rev 187062)
+++ branches/safari-601.1-branch/Source/WebKit2/ChangeLog	2015-07-21 04:37:00 UTC (rev 187063)
@@ -1,5 +1,20 @@
 2015-07-20  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r186956. rdar://problem/21643094
+
+    2015-07-17  Tim Horton  <timothy_hor...@apple.com>
+
+            iOS TextIndicators include text that is not supposed to be indicated
+            https://bugs.webkit.org/show_bug.cgi?id=147028
+            <rdar://problem/21643094>
+
+            Reviewed by Sam Weinig.
+
+            * WebProcess/Plugins/PluginView.cpp:
+            (WebKit::PluginView::shouldCreateTransientPaintingSnapshot):
+
+2015-07-20  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r186916. rdar://problem/21643094
 
     2015-07-16  Tim Horton  <timothy_hor...@apple.com>

Modified: branches/safari-601.1-branch/Source/WebKit2/WebProcess/Plugins/PluginView.cpp (187062 => 187063)


--- branches/safari-601.1-branch/Source/WebKit2/WebProcess/Plugins/PluginView.cpp	2015-07-21 04:36:55 UTC (rev 187062)
+++ branches/safari-601.1-branch/Source/WebKit2/WebProcess/Plugins/PluginView.cpp	2015-07-21 04:37:00 UTC (rev 187063)
@@ -1826,7 +1826,7 @@
         return false;
 
     if (FrameView* frameView = frame()->view()) {
-        if (frameView->paintBehavior() & (PaintBehaviorSelectionOnly | PaintBehaviorForceBlackText)) {
+        if (frameView->paintBehavior() & (PaintBehaviorSelectionOnly | PaintBehaviorSelectionAndBackgroundsOnly | PaintBehaviorForceBlackText)) {
             // This paint behavior is used when drawing the find indicator and there's no need to
             // snapshot plug-ins, because they can never be painted as part of the find indicator.
             return false;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to