CSS Scroll Snap - support snapping to nested elements
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Jun 2015 20:44:18 +0000 (20:44 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Jun 2015 20:44:18 +0000 (20:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=145843
<rdar://problem/21339581>

Reviewed by Darin Adler.

Source/WebCore:

Tested by css3/scroll-snap/nested-elements.html

The Scroll Snap Point implementation was not properly handling nested elements.
This could be resolved by recursively calling 'appendChildSnapOffsets', but this
seemed like an inefficient approach, especially considering how often this method
is called during various scaling and other operations.

Instead, do the following:
(1) Add a new HashSet to RenderView that holds a collection of RenderElements that
    have scroll-snap-coordinates.
(2) During RenderElement::styleWillChange, register all elements that have the
    scroll-snap-coordinates style with the RenderView.
(3) When performing 'appendChildSnapOffsets', refer to the HashSet of elements, select the
    subset of these entries relevant to the current scrolling container, and build up the
    set of scroll-snap-coordinates needed for the current scrolling container.

* page/scrolling/AxisScrollSnapOffsets.cpp:
(WebCore::appendChildSnapOffsets): Check the scroll-snap-coordinate RenderElement HashSet
for the RenderView to find all elements that are children of the current scrolling container.
Add the scroll-snap-coordinates for these RenderElements to the current set of snap points.
* rendering/RenderElement.cpp:
(WebCore::findEnclosingScrollableContainer): New helper function.
(WebCore::RenderElement::styleWillChange): If the current element has scroll-snap-coordinate
defined, remember it for later so we can use it with the relevant scrolling container
after layout completes.
(WebCore::RenderElement::willBeRemovedFromTree): Unregister the current element from the
RenderView.
(WebCore::RenderElement::findEnclosingScrollableContainer): Added. Locate the relevant
scrolling container for the current object.
* rendering/RenderElement.h:
* rendering/RenderView.cpp:
(WebCore::Document::registerRenderElementWithScrollSnapCoordinates): Added.
(WebCore::Document::unregisterRenderElementWithScrollSnapCoordinates): Added.
* rendering/RenderView.h:

LayoutTests:

* css3/scroll-snap/nested-elements-expected.txt: Added.
* css3/scroll-snap/nested-elements.html: Added.
* css3/scroll-snap/scroll-snap-offsets-expected.txt: Updated to
  account for 50%/50% scroll-snap-coordinates.

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

12 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/scroll-snap/nested-elements-expected.txt [new file with mode: 0644]
LayoutTests/css3/scroll-snap/nested-elements.html [new file with mode: 0644]
LayoutTests/css3/scroll-snap/scroll-snap-offsets-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/page/scrolling/AxisScrollSnapOffsets.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/RenderView.h
WebKit.xcworkspace/xcshareddata/xcschemes/All Source (target WebProcess).xcscheme

index 1a730d7..afb7605 100644 (file)
@@ -1,3 +1,16 @@
+2015-06-16  Brent Fulgham  <bfulgham@apple.com>
+
+        CSS Scroll Snap - support snapping to nested elements
+        https://bugs.webkit.org/show_bug.cgi?id=145843
+        <rdar://problem/21339581>
+
+        Reviewed by Darin Adler.
+
+        * css3/scroll-snap/nested-elements-expected.txt: Added.
+        * css3/scroll-snap/nested-elements.html: Added.
+        * css3/scroll-snap/scroll-snap-offsets-expected.txt: Updated to
+          account for 50%/50% scroll-snap-coordinates.
+
 2015-06-16  Brady Eidson  <beidson@apple.com>
 
         [IndexedDB] array index keys are concatenated across cursor lifetime
diff --git a/LayoutTests/css3/scroll-snap/nested-elements-expected.txt b/LayoutTests/css3/scroll-snap/nested-elements-expected.txt
new file mode 100644 (file)
index 0000000..de2daa3
--- /dev/null
@@ -0,0 +1,9 @@
+PASS successfullyParsed is true
+
+TEST COMPLETE
+Scroll-snap offsets for 'container': vertical = { 0, 101, 218, 335, 452, 569, 686, 803, 920, 1037, 1154, 1271, 1388, 1505, 1622, 1739, 1856, 1973, 2090, 2207, 4938 }
+PASS Scroll-snap offsets for 'invalidContainer': UNDEFINED
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/css3/scroll-snap/nested-elements.html b/LayoutTests/css3/scroll-snap/nested-elements.html
new file mode 100644 (file)
index 0000000..478fa09
--- /dev/null
@@ -0,0 +1,155 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>Snap points - nested snap coordinates</title>
+    <style>
+        .scrollable {
+            overflow: scroll;
+            -webkit-overflow-scrolling: touch;
+            border: 1px dashed black;
+            height: 300px;
+            margin: 0 10px;
+        }
+    
+        .center-snap-receiver {
+            -webkit-scroll-snap-type: mandatory;
+            -webkit-scroll-snap-destination: 0 0;
+        }
+    
+        .snap-point {
+            margin-top: 100px;
+            width: 15px;
+            height: 15px;
+            border: 1px solid black;
+            -webkit-scroll-snap-coordinate: 0 0px;
+        }
+    
+        .snap-point::after {
+            font-size: 1em;
+            position: relative;
+            content: '+';
+        }
+    
+        .nested > .snap-point {
+            margin-left: 50px;
+            border: 1px solid red;
+        }
+        .nested > .nested > .snap-point {
+            margin-left: 100px;
+            border: 1px solid blue;
+        }
+    
+        .large-content {
+            height: 3000px;
+            width: 100%;
+        }
+    
+        .small-content {
+            height: 200px;
+            width: 100%;
+        }
+
+        .invalidContainer {
+            border: 1px dashed black;
+            height: 300px;
+            margin: 0 10px;
+            opacity: 0.5;
+            overflow: hidden;
+        }
+    </style>
+        <script src="../../resources/js-test-pre.js"></script>
+        <script>
+        function runTest()
+        {
+            var container = document.getElementById('container');
+            debug("Scroll-snap offsets for 'container': " + window.internals.scrollSnapOffsets(container));
+
+            var invalidContainer = document.getElementById('invalidContainer');
+            try {
+                testFailed("Scroll-snap offsets for 'invalidContainer': " + window.internals.scrollSnapOffsets(invalidContainer));
+            } catch(ex) {
+                testPassed("Scroll-snap offsets for 'invalidContainer': UNDEFINED");
+            }
+
+            finishJSTest();
+            testRunner.notifyDone();
+        }
+
+        function onLoad()
+        {
+            if (window.testRunner) {
+                window.jsTestIsAsync = true;
+                testRunner.dumpAsText();
+                testRunner.waitUntilDone();
+                setTimeout(runTest, 0);
+            }
+        }
+        </script>
+</head>
+<body onload="onLoad();">
+    <div id="container" class="center-snap-receiver scrollable">
+        <div class="snap-point"></div>
+        <div class="nested">
+            <div class="snap-point"></div>
+        </div>
+        <div class="nested">
+            <div class="nested">
+                <div class="snap-point"></div>
+            </div>
+        </div>
+        <div class="snap-point"></div>
+        <div class="snap-point"></div>
+        <div class="nested">
+            <div class="snap-point"></div>
+        </div>
+        <div class="nested">
+            <div class="nested">
+                <div class="snap-point"></div>
+            </div>
+        </div>
+        <div class="nested">
+            <div class="snap-point"></div>
+        </div>
+        <div class="snap-point"></div>
+        <div class="nested">
+            <div class="snap-point"></div>
+        </div>
+        <div class="snap-point"></div>
+        <div class="snap-point"></div>
+        <div class="nested">
+            <div class="snap-point"></div>
+        </div>
+         <div class="snap-point"></div>
+        <div class="nested">
+            <div class="snap-point"></div>
+        </div>
+        <div class="nested">
+            <div class="nested">
+                <div class="snap-point"></div>
+            </div>
+        </div>
+         <div class="snap-point"></div>
+        <div class="nested">
+            <div class="snap-point"></div>
+        </div>
+        <div class="nested">
+            <div class="nested">
+                <div class="snap-point"></div>
+            </div>
+        </div>
+        <div class="large-content"></div>
+    </div>
+    <div id="invalidContainer" class="center-snap-receiver invalidContainer">
+        <div class="snap-point"></div>
+        <div class="nested">
+            <div class="snap-point"></div>
+        </div>
+        <div class="nested">
+            <div class="nested">
+                <div class="snap-point"></div>
+            </div>
+        </div>
+    </div>
+    <script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
index d79f5ee..ef71397 100644 (file)
@@ -2,16 +2,16 @@ Tests that the scroll-snap feature works properly in overflow regions.
  PASS successfullyParsed is true
 
 TEST COMPLETE
-Scroll-snap offsets for horizontalTarget: horizontal = { 0, 30, 60, 90, 120, 150 }, vertical = { 0, 15 }
-Scroll-snap offsets for verticalTarget: horizontal = { 0, 15 }, vertical = { 0, 30, 60, 90, 120, 150 }
-Scroll-snap offsets for horizontalBorderedTarget: horizontal = { 0, 30, 60, 90, 120, 150 }, vertical = { 0, 15 }
-Scroll-snap offsets for verticalBorderedTarget: horizontal = { 0, 15 }, vertical = { 0, 30, 60, 90, 120, 150 }
-Scroll-snap offsets for horizontalPaddedTarget: horizontal = { 0, 30, 60, 90, 120, 150, 170 }, vertical = { 0, 39 }
-Scroll-snap offsets for verticalPaddedTarget: horizontal = { 0, 35 }, vertical = { 0, 30, 60, 90, 120, 150, 174 }
-Scroll-snap offsets for horizontalBorderedPaddedTarget: horizontal = { 0, 30, 60, 90, 120, 150, 170 }, vertical = { 0, 39 }
-Scroll-snap offsets for verticalBorderedPaddedTarget: horizontal = { 0, 35 }, vertical = { 0, 30, 60, 90, 120, 150, 174 }
-Scroll-snap offsets for horizontalRotatedTarget: horizontal = { 0, 30, 60, 90, 120, 150, 170 }, vertical = { 0, 39 }
-Scroll-snap offsets for verticalRotatedTarget: horizontal = { 0, 35 }, vertical = { 0, 30, 60, 90, 120, 150, 174 }
+Scroll-snap offsets for horizontalTarget: horizontal = { 0, 30, 60, 90, 120, 150 }, vertical = { 0, 7, 15 }
+Scroll-snap offsets for verticalTarget: horizontal = { 0, 7, 15 }, vertical = { 0, 30, 60, 90, 120, 150 }
+Scroll-snap offsets for horizontalBorderedTarget: horizontal = { 0, 30, 60, 90, 120, 150 }, vertical = { 0, 7, 15 }
+Scroll-snap offsets for verticalBorderedTarget: horizontal = { 0, 7, 15 }, vertical = { 0, 30, 60, 90, 120, 150 }
+Scroll-snap offsets for horizontalPaddedTarget: horizontal = { 0, 30, 60, 90, 120, 150, 170 }, vertical = { 0, 7, 39 }
+Scroll-snap offsets for verticalPaddedTarget: horizontal = { 0, 7, 35 }, vertical = { 0, 30, 60, 90, 120, 150, 174 }
+Scroll-snap offsets for horizontalBorderedPaddedTarget: horizontal = { 0, 30, 60, 90, 120, 150, 170 }, vertical = { 0, 7, 39 }
+Scroll-snap offsets for verticalBorderedPaddedTarget: horizontal = { 0, 7, 35 }, vertical = { 0, 30, 60, 90, 120, 150, 174 }
+Scroll-snap offsets for horizontalRotatedTarget: horizontal = { 0, 30, 60, 90, 120, 150, 170 }, vertical = { 0, 7, 39 }
+Scroll-snap offsets for verticalRotatedTarget: horizontal = { 0, 7, 35 }, vertical = { 0, 30, 60, 90, 120, 150, 174 }
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 6c1a508..cf78216 100644 (file)
@@ -1,3 +1,46 @@
+2015-06-16  Brent Fulgham  <bfulgham@apple.com>
+
+        CSS Scroll Snap - support snapping to nested elements
+        https://bugs.webkit.org/show_bug.cgi?id=145843
+        <rdar://problem/21339581>
+
+        Reviewed by Darin Adler.
+
+        Tested by css3/scroll-snap/nested-elements.html
+
+        The Scroll Snap Point implementation was not properly handling nested elements.
+        This could be resolved by recursively calling 'appendChildSnapOffsets', but this
+        seemed like an inefficient approach, especially considering how often this method
+        is called during various scaling and other operations.
+        
+        Instead, do the following:
+        (1) Add a new HashSet to RenderView that holds a collection of RenderElements that
+            have scroll-snap-coordinates.
+        (2) During RenderElement::styleWillChange, register all elements that have the
+            scroll-snap-coordinates style with the RenderView.
+        (3) When performing 'appendChildSnapOffsets', refer to the HashSet of elements, select the
+            subset of these entries relevant to the current scrolling container, and build up the
+            set of scroll-snap-coordinates needed for the current scrolling container.
+
+        * page/scrolling/AxisScrollSnapOffsets.cpp:
+        (WebCore::appendChildSnapOffsets): Check the scroll-snap-coordinate RenderElement HashSet
+        for the RenderView to find all elements that are children of the current scrolling container.
+        Add the scroll-snap-coordinates for these RenderElements to the current set of snap points.
+        * rendering/RenderElement.cpp:
+        (WebCore::findEnclosingScrollableContainer): New helper function.
+        (WebCore::RenderElement::styleWillChange): If the current element has scroll-snap-coordinate
+        defined, remember it for later so we can use it with the relevant scrolling container
+        after layout completes.
+        (WebCore::RenderElement::willBeRemovedFromTree): Unregister the current element from the
+        RenderView.
+        (WebCore::RenderElement::findEnclosingScrollableContainer): Added. Locate the relevant
+        scrolling container for the current object.
+        * rendering/RenderElement.h:
+        * rendering/RenderView.cpp:
+        (WebCore::Document::registerRenderElementWithScrollSnapCoordinates): Added.
+        (WebCore::Document::unregisterRenderElementWithScrollSnapCoordinates): Added.
+        * rendering/RenderView.h:
+
 2015-06-16  Brady Eidson  <beidson@apple.com>
 
         [IndexedDB] array index keys are concatenated across cursor lifetime
index 7592630..3cbb2b9 100644 (file)
@@ -31,6 +31,7 @@
 #include "HTMLElement.h"
 #include "Length.h"
 #include "RenderBox.h"
+#include "RenderView.h"
 #include "ScrollableArea.h"
 #include "StyleScrollSnapPoints.h"
 
@@ -40,28 +41,34 @@ namespace WebCore {
 
 static void appendChildSnapOffsets(HTMLElement& parent, bool shouldAddHorizontalChildOffsets, Vector<LayoutUnit>& horizontalSnapOffsetSubsequence, bool shouldAddVerticalChildOffsets, Vector<LayoutUnit>& verticalSnapOffsetSubsequence)
 {
-    // FIXME: Instead of traversing all children, register children with snap coordinates before appending to snapOffsetSubsequence.
-    for (auto& child : childrenOfType<Element>(parent)) {
-        if (RenderBox* box = child.renderBox()) {
-            const auto& scrollSnapCoordinates = box->style().scrollSnapCoordinates();
-            if (scrollSnapCoordinates.isEmpty())
-                continue;
+    RenderElement* scrollContainer = parent.renderer();
+    ASSERT(scrollContainer);
+    
+    RenderView& renderView = scrollContainer->view();
+
+    Vector<const RenderBox*> elements;
+    for (auto& element : renderView.boxesWithScrollSnapCoordinates()) {
+        if (element->findEnclosingScrollableContainer() != scrollContainer)
+            continue;
+
+        elements.append(element);
+    }
 
-            LayoutRect viewSize = box->contentBoxRect();
-            LayoutUnit viewWidth = viewSize.width();
-            LayoutUnit viewHeight = viewSize.height();
-            FloatPoint position = box->localToContainerPoint(FloatPoint(), parent.renderBox());
-            LayoutUnit left = position.x();
-            LayoutUnit top = position.y();
-            for (auto& coordinate : scrollSnapCoordinates) {
-                LayoutUnit lastPotentialSnapPositionX = left + valueForLength(coordinate.width(), viewWidth);
-                if (shouldAddHorizontalChildOffsets && lastPotentialSnapPositionX > 0)
-                    horizontalSnapOffsetSubsequence.append(lastPotentialSnapPositionX);
-
-                LayoutUnit lastPotentialSnapPositionY = top + valueForLength(coordinate.height(), viewHeight);
-                if (shouldAddVerticalChildOffsets && lastPotentialSnapPositionY > 0)
-                    verticalSnapOffsetSubsequence.append(lastPotentialSnapPositionY);
-            }
+    for (auto& box : elements) {
+        auto& scrollSnapCoordinates = box->style().scrollSnapCoordinates();
+        if (scrollSnapCoordinates.isEmpty())
+            continue;
+        
+        LayoutRect viewSize = box->contentBoxRect();
+        FloatPoint position = box->localToContainerPoint(FloatPoint(), parent.renderBox());
+        for (auto& coordinate : scrollSnapCoordinates) {
+            LayoutUnit lastPotentialSnapPositionX = position.x() + valueForLength(coordinate.width(), viewSize.width());
+            if (shouldAddHorizontalChildOffsets && lastPotentialSnapPositionX > 0)
+                horizontalSnapOffsetSubsequence.append(lastPotentialSnapPositionX);
+            
+            LayoutUnit lastPotentialSnapPositionY = position.y() + valueForLength(coordinate.height(), viewSize.height());
+            if (shouldAddVerticalChildOffsets && lastPotentialSnapPositionY > 0)
+                verticalSnapOffsetSubsequence.append(lastPotentialSnapPositionY);
         }
     }
 }
index df1987a..d018ed4 100644 (file)
@@ -4948,4 +4948,14 @@ LayoutUnit RenderBox::offsetFromLogicalTopOfFirstPage() const
     return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop();
 }
 
+const RenderBox* RenderBox::findEnclosingScrollableContainer() const
+{
+    for (auto& candidate : lineageOfType<RenderBox>(*this)) {
+        if (candidate.hasOverflowClip())
+            return &candidate;
+    }
+    
+    return nullptr;
+}
+
 } // namespace WebCore
index 408008f..2a8e992 100644 (file)
@@ -625,6 +625,8 @@ public:
     bool canHaveOutsideRegionRange() const { return !isInFlowRenderFlowThread(); }
     virtual bool needsLayoutAfterRegionRangeChange() const { return false; }
 
+    const RenderBox* findEnclosingScrollableContainer() const;
+
 protected:
     RenderBox(Element&, Ref<RenderStyle>&&, unsigned baseTypeFlags);
     RenderBox(Document&, Ref<RenderStyle>&&, unsigned baseTypeFlags);
index a645d89..d597787 100644 (file)
@@ -3,7 +3,7 @@
  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
  *           (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
  *           (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
- * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2013, 2015 Apple Inc. All rights reserved.
  * Copyright (C) 2010, 2012 Google Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
@@ -904,6 +904,16 @@ void RenderElement::styleWillChange(StyleDifference diff, const RenderStyle& new
         }
     }
 
+#if ENABLE(CSS_SCROLL_SNAP)
+    if (!newStyle.scrollSnapCoordinates().isEmpty() || (oldStyle && !oldStyle->scrollSnapCoordinates().isEmpty())) {
+        ASSERT(is<RenderBox>(this));
+        if (newStyle.scrollSnapCoordinates().isEmpty())
+            view().unregisterBoxWithScrollSnapCoordinates(downcast<RenderBox>(*this));
+        else
+            view().registerBoxWithScrollSnapCoordinates(downcast<RenderBox>(*this));
+    }
+#endif
+
     if (isRoot() || isBody())
         view().frameView().updateExtendBackgroundIfNecessary();
 }
@@ -1058,6 +1068,14 @@ void RenderElement::willBeRemovedFromTree()
     if (auto* containerFlowThread = parent()->renderNamedFlowThreadWrapper())
         containerFlowThread->removeFlowChild(*this);
 
+    
+#if ENABLE(CSS_SCROLL_SNAP)
+    if (!m_style->scrollSnapCoordinates().isEmpty()) {
+        ASSERT(is<RenderBox>(this));
+        view().unregisterBoxWithScrollSnapCoordinates(downcast<RenderBox>(*this));
+    }
+#endif
+
     RenderObject::willBeRemovedFromTree();
 }
 
index 24c7934..eed495e 100644 (file)
@@ -1428,4 +1428,16 @@ unsigned RenderView::pageCount() const
     return 0;
 }
 
+#if ENABLE(CSS_SCROLL_SNAP)
+void RenderView::registerBoxWithScrollSnapCoordinates(const RenderBox& box)
+{
+    m_boxesWithScrollSnapCoordinates.add(&box);
+}
+
+void RenderView::unregisterBoxWithScrollSnapCoordinates(const RenderBox& box)
+{
+    m_boxesWithScrollSnapCoordinates.remove(&box);
+}
+#endif
+
 } // namespace WebCore
index 344a8ee..7160c9d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2006 Apple Inc.
+ * Copyright (C) 2006, 2015 Apple Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -245,6 +245,12 @@ public:
     void protectRenderWidgetUntilLayoutIsDone(RenderWidget& widget) { m_protectedRenderWidgets.append(&widget); }
     void releaseProtectedRenderWidgets() { m_protectedRenderWidgets.clear(); }
 
+#if ENABLE(CSS_SCROLL_SNAP)
+    void registerBoxWithScrollSnapCoordinates(const RenderBox&);
+    void unregisterBoxWithScrollSnapCoordinates(const RenderBox&);
+    const HashSet<const RenderBox*>& boxesWithScrollSnapCoordinates() { return m_boxesWithScrollSnapCoordinates; }
+#endif
+
 protected:
     virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags, bool* wasFixed) const override;
     virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const override;
@@ -367,6 +373,9 @@ private:
 #if ENABLE(SERVICE_CONTROLS)
     SelectionRectGatherer m_selectionRectGatherer;
 #endif
+#if ENABLE(CSS_SCROLL_SNAP)
+    HashSet<const RenderBox*> m_boxesWithScrollSnapCoordinates;
+#endif
 };
 
 // Stack-based class to assist with LayoutState push/pop
index 55aadff..ea8dc6a 100644 (file)
             ReferencedContainer = "container:Source/WebKit2/WebKit2.xcodeproj">
          </BuildableReference>
       </MacroExpansion>
+      <AdditionalOptions>
+      </AdditionalOptions>
    </TestAction>
    <LaunchAction
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       buildConfiguration = "Debug"
       ignoresPersistentStateOnLaunch = "NO"
       debugDocumentVersioning = "YES"
+      debugServiceExtension = "internal"
       allowLocationSimulation = "YES">
-      <BuildableProductRunnable>
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
          <BuildableReference
             BuildableIdentifier = "primary"
             BlueprintIdentifier = "1A50DB1D110A3BDC000D3FE5"