diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc index 3372c99..fd03ed7 100644 --- a/chrome/browser/ui/browser_command_controller.cc +++ b/chrome/browser/ui/browser_command_controller.cc
@@ -422,7 +422,7 @@ SavePage(browser_); break; case IDC_BOOKMARK_PAGE: -#if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) +#if BUILDFLAG(ENABLE_DESKTOP_IN_PRODUCT_HELP) feature_engagement::BookmarkTrackerFactory::GetInstance() ->GetForProfile(profile()) ->OnBookmarkAdded(); @@ -430,7 +430,7 @@ BookmarkCurrentPageAllowingExtensionOverrides(browser_); break; case IDC_BOOKMARK_ALL_TABS: -#if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) +#if BUILDFLAG(ENABLE_DESKTOP_IN_PRODUCT_HELP) feature_engagement::BookmarkTrackerFactory::GetInstance() ->GetForProfile(profile()) ->OnBookmarkAdded();
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 2c7641c0e..695eb20 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -2401,12 +2401,16 @@ } if (is_win || is_linux) { sources += [ - "../browser/feature_engagement/incognito_window/incognito_window_tracker_browsertest.cc", - "../browser/feature_engagement/new_tab/new_tab_tracker_browsertest.cc", "../browser/ui/views/ime/input_ime_apitest_nonchromeos.cc", ] } } + if (enable_desktop_in_product_help) { + sources += [ + "../browser/feature_engagement/incognito_window/incognito_window_tracker_browsertest.cc", + "../browser/feature_engagement/new_tab/new_tab_tracker_browsertest.cc", + ] + } if (safe_browsing_mode == 1) { sources += [ "../browser/safe_browsing/certificate_reporting_service_browsertest.cc",
diff --git a/components/feature_engagement/public/feature_list.h b/components/feature_engagement/public/feature_list.h index b9465ee6..d4148eb 100644 --- a/components/feature_engagement/public/feature_list.h +++ b/components/feature_engagement/public/feature_list.h
@@ -95,7 +95,7 @@ VARIATION_ENTRY(kIPHContextualSearchTapFeature), VARIATION_ENTRY(kIPHContextualSearchPanelFeature), VARIATION_ENTRY(kIPHContextualSearchOptInFeature), -#elif defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) +#elif BUILDFLAG(ENABLE_DESKTOP_IN_PRODUCT_HELP) VARIATION_ENTRY(kIPHBookmarkFeature), VARIATION_ENTRY(kIPHIncognitoWindowFeature), VARIATION_ENTRY(kIPHNewTabFeature),
diff --git a/third_party/WebKit/LayoutTests/fast/css-intrinsic-dimensions/height-css-tables-expected.html b/third_party/WebKit/LayoutTests/fast/css-intrinsic-dimensions/height-css-tables-expected.html index 1e3c7f2..a1088ef 100644 --- a/third_party/WebKit/LayoutTests/fast/css-intrinsic-dimensions/height-css-tables-expected.html +++ b/third_party/WebKit/LayoutTests/fast/css-intrinsic-dimensions/height-css-tables-expected.html
@@ -28,10 +28,8 @@ </div> </div> -<!-- crbug.com/690087: We use 99px instead of 100px because we end up discarding 1px when trying - to allocate the spare pixels to the table. --> -<div class="table container" style="display: block; float: left; height: 99px;"> - <div class="td" style="height: 91px;" style="display: block;"> +<div class="table container" style="display: block; float: left; height: 100px;"> + <div class="td" style="height: 92px;" style="display: block;"> <div class="item"></div> </div> </div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/table-two-pass-layout-overpaint-expected.txt b/third_party/WebKit/LayoutTests/paint/invalidation/table-two-pass-layout-overpaint-expected.txt index 71e0a45..b4b031b 100644 --- a/third_party/WebKit/LayoutTests/paint/invalidation/table-two-pass-layout-overpaint-expected.txt +++ b/third_party/WebKit/LayoutTests/paint/invalidation/table-two-pass-layout-overpaint-expected.txt
@@ -7,40 +7,17 @@ "backgroundColor": "#FFFFFF", "paintInvalidations": [ { - "object": "LayoutTable TABLE", - "rect": [8, 106, 106, 1], - "reason": "incremental" - }, - { - "object": "LayoutTableCell TD", - "rect": [10, 104, 102, 1], - "reason": "incremental" - }, - { "object": "LayoutBlockFlow DIV id='target'", - "rect": [11, 45, 100, 25], - "reason": "geometry" - }, - { - "object": "LayoutBlockFlow DIV id='target'", - "rect": [11, 44, 50, 25], - "reason": "geometry" + "rect": [61, 45, 50, 25], + "reason": "incremental" } ] } ], "objectPaintInvalidations": [ { - "object": "LayoutTable TABLE", - "reason": "incremental" - }, - { - "object": "LayoutTableCell TD", - "reason": "incremental" - }, - { "object": "LayoutBlockFlow DIV id='target'", - "reason": "geometry" + "reason": "incremental" } ] }
diff --git a/third_party/WebKit/LayoutTests/platform/linux/tables/mozilla/bugs/bug110566-expected.png b/third_party/WebKit/LayoutTests/platform/linux/tables/mozilla/bugs/bug110566-expected.png index e948432..c0ea76c 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/tables/mozilla/bugs/bug110566-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/tables/mozilla/bugs/bug110566-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/tables/mozilla/bugs/bug11944-expected.png b/third_party/WebKit/LayoutTests/platform/linux/tables/mozilla/bugs/bug11944-expected.png index ae671af..0a9c1143 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/tables/mozilla/bugs/bug11944-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/tables/mozilla/bugs/bug11944-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/tables/mozilla/bugs/bug120364-expected.png b/third_party/WebKit/LayoutTests/platform/linux/tables/mozilla/bugs/bug120364-expected.png index 8e20e33..51a1f7d 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/tables/mozilla/bugs/bug120364-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/tables/mozilla/bugs/bug120364-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/tables/mozilla/bugs/bug126742-expected.png b/third_party/WebKit/LayoutTests/platform/linux/tables/mozilla/bugs/bug126742-expected.png index e89846d5..fb64b571 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/tables/mozilla/bugs/bug126742-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/tables/mozilla/bugs/bug126742-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/tables/mozilla_expected_failures/bugs/bug131020-3-expected.png b/third_party/WebKit/LayoutTests/platform/linux/tables/mozilla_expected_failures/bugs/bug131020-3-expected.png index d3087385..0ebc48d2 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/tables/mozilla_expected_failures/bugs/bug131020-3-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/tables/mozilla_expected_failures/bugs/bug131020-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/tables/mozilla/bugs/bug110566-expected.png b/third_party/WebKit/LayoutTests/platform/mac/tables/mozilla/bugs/bug110566-expected.png index 88ca16e..4e419adb 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/tables/mozilla/bugs/bug110566-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/tables/mozilla/bugs/bug110566-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/tables/mozilla/bugs/bug11944-expected.png b/third_party/WebKit/LayoutTests/platform/mac/tables/mozilla/bugs/bug11944-expected.png index be1ca8a..c23bfb4 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/tables/mozilla/bugs/bug11944-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/tables/mozilla/bugs/bug11944-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/tables/mozilla/bugs/bug120364-expected.png b/third_party/WebKit/LayoutTests/platform/mac/tables/mozilla/bugs/bug120364-expected.png index 4eb4f73..111c2e7 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/tables/mozilla/bugs/bug120364-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/tables/mozilla/bugs/bug120364-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/tables/mozilla/bugs/bug126742-expected.png b/third_party/WebKit/LayoutTests/platform/mac/tables/mozilla/bugs/bug126742-expected.png index 89929f08..b32a5adc 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/tables/mozilla/bugs/bug126742-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/tables/mozilla/bugs/bug126742-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug131020-3-expected.png b/third_party/WebKit/LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug131020-3-expected.png index d884617..09140a7c4 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug131020-3-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug131020-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/tables/mozilla/bugs/bug110566-expected.png b/third_party/WebKit/LayoutTests/platform/win/tables/mozilla/bugs/bug110566-expected.png index ac0f924..8f4f01e 100644 --- a/third_party/WebKit/LayoutTests/platform/win/tables/mozilla/bugs/bug110566-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/tables/mozilla/bugs/bug110566-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/tables/mozilla/bugs/bug11944-expected.png b/third_party/WebKit/LayoutTests/platform/win/tables/mozilla/bugs/bug11944-expected.png index 8f5473c..f5d2916 100644 --- a/third_party/WebKit/LayoutTests/platform/win/tables/mozilla/bugs/bug11944-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/tables/mozilla/bugs/bug11944-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/tables/mozilla/bugs/bug120364-expected.png b/third_party/WebKit/LayoutTests/platform/win/tables/mozilla/bugs/bug120364-expected.png index 6059738b..dd0cc42 100644 --- a/third_party/WebKit/LayoutTests/platform/win/tables/mozilla/bugs/bug120364-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/tables/mozilla/bugs/bug120364-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/tables/mozilla/bugs/bug126742-expected.png b/third_party/WebKit/LayoutTests/platform/win/tables/mozilla/bugs/bug126742-expected.png index f67afd6..386b0dd 100644 --- a/third_party/WebKit/LayoutTests/platform/win/tables/mozilla/bugs/bug126742-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/tables/mozilla/bugs/bug126742-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/tables/mozilla_expected_failures/bugs/bug131020-3-expected.png b/third_party/WebKit/LayoutTests/platform/win/tables/mozilla_expected_failures/bugs/bug131020-3-expected.png index d02fbd85..30a5f4d 100644 --- a/third_party/WebKit/LayoutTests/platform/win/tables/mozilla_expected_failures/bugs/bug131020-3-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/tables/mozilla_expected_failures/bugs/bug131020-3-expected.png Binary files differ
diff --git a/third_party/WebKit/Source/core/BUILD.gn b/third_party/WebKit/Source/core/BUILD.gn index 1e44dc4..ff33ff6 100644 --- a/third_party/WebKit/Source/core/BUILD.gn +++ b/third_party/WebKit/Source/core/BUILD.gn
@@ -1429,6 +1429,7 @@ "dom/MutationObserverTest.cpp", "dom/NodeTest.cpp", "dom/NthIndexCacheTest.cpp", + "dom/PausableObjectTest.cpp", "dom/RangeTest.cpp", "dom/ScriptModuleResolverImplTest.cpp", "dom/ScriptRunnerTest.cpp", @@ -1437,7 +1438,6 @@ "dom/ShadowDOMV0Test.cpp", "dom/SpaceSplitStringTest.cpp", "dom/StaticRangeTest.cpp", - "dom/SuspendableObjectTest.cpp", "dom/TextTest.cpp", "dom/TreeScopeTest.cpp", "dom/UserGestureIndicatorTest.cpp",
diff --git a/third_party/WebKit/Source/core/dom/BUILD.gn b/third_party/WebKit/Source/core/dom/BUILD.gn index b636bb42..bb37c4e 100644 --- a/third_party/WebKit/Source/core/dom/BUILD.gn +++ b/third_party/WebKit/Source/core/dom/BUILD.gn
@@ -213,6 +213,8 @@ "NthIndexCache.h", "ParentNode.h", "ParserContentPolicy.h", + "PausableObject.cpp", + "PausableObject.h", "PendingScript.cpp", "PendingScript.h", "PresentationAttributeStyle.cpp", @@ -263,7 +265,6 @@ "StaticNodeList.h", "StaticRange.cpp", "StaticRange.h", - "SuspendableObject.cpp", "SuspendableObject.h", "SyncReattachContext.cpp", "SyncReattachContext.h",
diff --git a/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.h b/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.h index 08b61bb..09110532 100644 --- a/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.h +++ b/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.h
@@ -34,9 +34,11 @@ namespace blink { -class SuspendableObject; class ContextLifecycleObserver; class ExecutionContext; +class PausableObject; + +using SuspendableObject = PausableObject; class CORE_EXPORT ContextLifecycleNotifier : public LifecycleNotifier<ExecutionContext, ContextLifecycleObserver> {
diff --git a/third_party/WebKit/Source/core/dom/ExecutionContext.h b/third_party/WebKit/Source/core/dom/ExecutionContext.h index 4f8bf4a..93dd8cb 100644 --- a/third_party/WebKit/Source/core/dom/ExecutionContext.h +++ b/third_party/WebKit/Source/core/dom/ExecutionContext.h
@@ -56,11 +56,14 @@ class EventQueue; class EventTarget; class LocalDOMWindow; -class SuspendableObject; +class PausableObject; class PublicURLManager; class ResourceFetcher; class SecurityOrigin; class ScriptState; + +using SuspendableObject = PausableObject; + enum class TaskType : unsigned; enum ReasonForCallingCanExecuteScripts {
diff --git a/third_party/WebKit/Source/core/dom/SuspendableObject.cpp b/third_party/WebKit/Source/core/dom/PausableObject.cpp similarity index 86% rename from third_party/WebKit/Source/core/dom/SuspendableObject.cpp rename to third_party/WebKit/Source/core/dom/PausableObject.cpp index 4f65ac9..922a5309 100644 --- a/third_party/WebKit/Source/core/dom/SuspendableObject.cpp +++ b/third_party/WebKit/Source/core/dom/PausableObject.cpp
@@ -24,14 +24,14 @@ * */ -#include "core/dom/SuspendableObject.h" +#include "core/dom/PausableObject.h" #include "core/dom/ExecutionContext.h" #include "platform/InstanceCounters.h" namespace blink { -SuspendableObject::SuspendableObject(ExecutionContext* execution_context) +PausableObject::PausableObject(ExecutionContext* execution_context) : ContextLifecycleObserver(execution_context, kSuspendableObjectType) #if DCHECK_IS_ON() , @@ -43,7 +43,7 @@ InstanceCounters::kSuspendableObjectCounter); } -SuspendableObject::~SuspendableObject() { +PausableObject::~PausableObject() { InstanceCounters::DecrementCounter( InstanceCounters::kSuspendableObjectCounter); @@ -52,7 +52,7 @@ #endif } -void SuspendableObject::SuspendIfNeeded() { +void PausableObject::SuspendIfNeeded() { #if DCHECK_IS_ON() DCHECK(!suspend_if_needed_called_); suspend_if_needed_called_ = true; @@ -61,12 +61,11 @@ context->SuspendSuspendableObjectIfNeeded(this); } -void SuspendableObject::Suspend() {} +void PausableObject::Suspend() {} -void SuspendableObject::Resume() {} +void PausableObject::Resume() {} -void SuspendableObject::DidMoveToNewExecutionContext( - ExecutionContext* context) { +void PausableObject::DidMoveToNewExecutionContext(ExecutionContext* context) { SetContext(context); if (context->IsContextDestroyed()) {
diff --git a/third_party/WebKit/Source/core/dom/PausableObject.h b/third_party/WebKit/Source/core/dom/PausableObject.h new file mode 100644 index 0000000..ad42ed35 --- /dev/null +++ b/third_party/WebKit/Source/core/dom/PausableObject.h
@@ -0,0 +1,66 @@ +/* + * Copyright (C) 2008 Apple Inc. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef PausableObject_h +#define PausableObject_h + +#include "core/CoreExport.h" +#include "core/dom/ContextLifecycleObserver.h" +#include "platform/wtf/Assertions.h" + +namespace blink { + +class CORE_EXPORT PausableObject : public ContextLifecycleObserver { + public: + explicit PausableObject(ExecutionContext*); + + // suspendIfNeeded() should be called exactly once after object construction + // to synchronize the suspend state with that in ExecutionContext. + void SuspendIfNeeded(); +#if DCHECK_IS_ON() + bool SuspendIfNeededCalled() const { return suspend_if_needed_called_; } +#endif + + // These methods have an empty default implementation so that subclasses + // which don't need special treatment can skip implementation. + // TODO(hajimehoshi): Rename Suspend to Pause (crbug/780378) + virtual void Suspend(); + virtual void Resume(); + + void DidMoveToNewExecutionContext(ExecutionContext*); + + protected: + virtual ~PausableObject(); + + private: +#if DCHECK_IS_ON() + bool suspend_if_needed_called_; +#endif +}; + +} // namespace blink + +#endif // PausableObject_h
diff --git a/third_party/WebKit/Source/core/dom/SuspendableObjectTest.cpp b/third_party/WebKit/Source/core/dom/PausableObjectTest.cpp similarity index 65% rename from third_party/WebKit/Source/core/dom/SuspendableObjectTest.cpp rename to third_party/WebKit/Source/core/dom/PausableObjectTest.cpp index 3117e5be..ef51ac9a 100644 --- a/third_party/WebKit/Source/core/dom/SuspendableObjectTest.cpp +++ b/third_party/WebKit/Source/core/dom/PausableObjectTest.cpp
@@ -28,27 +28,27 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "core/dom/SuspendableObject.h" +#include "core/dom/PausableObject.h" +#include <memory> #include "core/dom/Document.h" #include "core/testing/DummyPageHolder.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#include <memory> namespace blink { -class MockSuspendableObject final - : public GarbageCollectedFinalized<MockSuspendableObject>, - public SuspendableObject { - USING_GARBAGE_COLLECTED_MIXIN(MockSuspendableObject); +class MockPausableObject final + : public GarbageCollectedFinalized<MockPausableObject>, + public PausableObject { + USING_GARBAGE_COLLECTED_MIXIN(MockPausableObject); public: - explicit MockSuspendableObject(ExecutionContext* context) - : SuspendableObject(context) {} + explicit MockPausableObject(ExecutionContext* context) + : PausableObject(context) {} virtual void Trace(blink::Visitor* visitor) { - SuspendableObject::Trace(visitor); + PausableObject::Trace(visitor); } MOCK_METHOD0(Suspend, void()); @@ -56,56 +56,56 @@ MOCK_METHOD1(ContextDestroyed, void(ExecutionContext*)); }; -class SuspendableObjectTest : public ::testing::Test { +class PausableObjectTest : public ::testing::Test { protected: - SuspendableObjectTest(); + PausableObjectTest(); Document& SrcDocument() const { return src_page_holder_->GetDocument(); } Document& DestDocument() const { return dest_page_holder_->GetDocument(); } - MockSuspendableObject& SuspendableObject() { return *suspendable_object_; } + MockPausableObject& PausableObject() { return *pausable_object_; } private: std::unique_ptr<DummyPageHolder> src_page_holder_; std::unique_ptr<DummyPageHolder> dest_page_holder_; - Persistent<MockSuspendableObject> suspendable_object_; + Persistent<MockPausableObject> pausable_object_; }; -SuspendableObjectTest::SuspendableObjectTest() +PausableObjectTest::PausableObjectTest() : src_page_holder_(DummyPageHolder::Create(IntSize(800, 600))), dest_page_holder_(DummyPageHolder::Create(IntSize(800, 600))), - suspendable_object_( - new MockSuspendableObject(&src_page_holder_->GetDocument())) { - suspendable_object_->SuspendIfNeeded(); + pausable_object_( + new MockPausableObject(&src_page_holder_->GetDocument())) { + pausable_object_->SuspendIfNeeded(); } -TEST_F(SuspendableObjectTest, NewContextObserved) { +TEST_F(PausableObjectTest, NewContextObserved) { unsigned initial_src_count = SrcDocument().SuspendableObjectCount(); unsigned initial_dest_count = DestDocument().SuspendableObjectCount(); - EXPECT_CALL(SuspendableObject(), Resume()); - SuspendableObject().DidMoveToNewExecutionContext(&DestDocument()); + EXPECT_CALL(PausableObject(), Resume()); + PausableObject().DidMoveToNewExecutionContext(&DestDocument()); EXPECT_EQ(initial_src_count - 1, SrcDocument().SuspendableObjectCount()); EXPECT_EQ(initial_dest_count + 1, DestDocument().SuspendableObjectCount()); } -TEST_F(SuspendableObjectTest, MoveToActiveDocument) { - EXPECT_CALL(SuspendableObject(), Resume()); - SuspendableObject().DidMoveToNewExecutionContext(&DestDocument()); +TEST_F(PausableObjectTest, MoveToActiveDocument) { + EXPECT_CALL(PausableObject(), Resume()); + PausableObject().DidMoveToNewExecutionContext(&DestDocument()); } -TEST_F(SuspendableObjectTest, MoveToSuspendedDocument) { +TEST_F(PausableObjectTest, MoveToSuspendedDocument) { DestDocument().SuspendScheduledTasks(); - EXPECT_CALL(SuspendableObject(), Suspend()); - SuspendableObject().DidMoveToNewExecutionContext(&DestDocument()); + EXPECT_CALL(PausableObject(), Suspend()); + PausableObject().DidMoveToNewExecutionContext(&DestDocument()); } -TEST_F(SuspendableObjectTest, MoveToStoppedDocument) { +TEST_F(PausableObjectTest, MoveToStoppedDocument) { DestDocument().Shutdown(); - EXPECT_CALL(SuspendableObject(), ContextDestroyed(&DestDocument())); - SuspendableObject().DidMoveToNewExecutionContext(&DestDocument()); + EXPECT_CALL(PausableObject(), ContextDestroyed(&DestDocument())); + PausableObject().DidMoveToNewExecutionContext(&DestDocument()); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/dom/SuspendableObject.h b/third_party/WebKit/Source/core/dom/SuspendableObject.h index abcb5374..15c0fc4 100644 --- a/third_party/WebKit/Source/core/dom/SuspendableObject.h +++ b/third_party/WebKit/Source/core/dom/SuspendableObject.h
@@ -27,38 +27,14 @@ #ifndef SuspendableObject_h #define SuspendableObject_h -#include "core/CoreExport.h" -#include "core/dom/ContextLifecycleObserver.h" -#include "platform/wtf/Assertions.h" +#include "core/dom/PausableObject.h" namespace blink { -class CORE_EXPORT SuspendableObject : public ContextLifecycleObserver { - public: - explicit SuspendableObject(ExecutionContext*); - - // suspendIfNeeded() should be called exactly once after object construction - // to synchronize the suspend state with that in ExecutionContext. - void SuspendIfNeeded(); -#if DCHECK_IS_ON() - bool SuspendIfNeededCalled() const { return suspend_if_needed_called_; } -#endif - - // These methods have an empty default implementation so that subclasses - // which don't need special treatment can skip implementation. - virtual void Suspend(); - virtual void Resume(); - - void DidMoveToNewExecutionContext(ExecutionContext*); - - protected: - virtual ~SuspendableObject(); - - private: -#if DCHECK_IS_ON() - bool suspend_if_needed_called_; -#endif -}; +// SuspendableObject is now just an alias to PausableObject, and all +// SuspendableObject will be replaced with PausableObject in near future. +// See crbug/780378. +using SuspendableObject = PausableObject; } // namespace blink
diff --git a/third_party/WebKit/Source/core/editing/VisibleSelection.cpp b/third_party/WebKit/Source/core/editing/VisibleSelection.cpp index 516a06a..5f11156e 100644 --- a/third_party/WebKit/Source/core/editing/VisibleSelection.cpp +++ b/third_party/WebKit/Source/core/editing/VisibleSelection.cpp
@@ -489,19 +489,11 @@ const EphemeralRangeTemplate<Strategy>&, const PositionTemplate<Strategy>& base); +// TODO(editing-dev): Move this to SelectionAdjuster. template <typename Strategy> -static SelectionTemplate<Strategy> ComputeVisibleSelection( - const SelectionTemplate<Strategy>& passed_selection, +static SelectionTemplate<Strategy> AdjustSelectionRespectingGranularity( + const SelectionTemplate<Strategy>& canonicalized_selection, TextGranularity granularity) { - DCHECK(!NeedsLayoutTreeUpdate(passed_selection.Base())); - DCHECK(!NeedsLayoutTreeUpdate(passed_selection.Extent())); - - const SelectionTemplate<Strategy>& canonicalized_selection = - CanonicalizeSelection(passed_selection); - - if (canonicalized_selection.IsNone()) - return SelectionTemplate<Strategy>(); - const TextAffinity affinity = canonicalized_selection.Affinity(); const PositionTemplate<Strategy> start = @@ -522,6 +514,34 @@ const EphemeralRangeTemplate<Strategy> expanded_range(expanded_start, expanded_end); + typename SelectionTemplate<Strategy>::Builder builder; + return canonicalized_selection.IsBaseFirst() + ? builder.SetAsForwardSelection(expanded_range).Build() + : builder.SetAsBackwardSelection(expanded_range).Build(); +} + +template <typename Strategy> +static SelectionTemplate<Strategy> ComputeVisibleSelection( + const SelectionTemplate<Strategy>& passed_selection, + TextGranularity granularity) { + DCHECK(!NeedsLayoutTreeUpdate(passed_selection.Base())); + DCHECK(!NeedsLayoutTreeUpdate(passed_selection.Extent())); + + const SelectionTemplate<Strategy>& canonicalized_selection = + CanonicalizeSelection(passed_selection); + + if (canonicalized_selection.IsNone()) + return SelectionTemplate<Strategy>(); + + const SelectionTemplate<Strategy>& granularity_adjusted_selection = + AdjustSelectionRespectingGranularity(canonicalized_selection, + granularity); + // TODO(editing-dev): Implement + // const SelectionTemplate<Strategy>& shadow_adjusted_selection = + // AdjustSelectionShadow(granularity_adjusted_selection); + const EphemeralRangeTemplate<Strategy> expanded_range( + granularity_adjusted_selection.ComputeStartPosition(), + granularity_adjusted_selection.ComputeEndPosition()); const EphemeralRangeTemplate<Strategy> shadow_adjusted_range = canonicalized_selection.IsBaseFirst() @@ -535,10 +555,15 @@ AdjustSelectionStartToAvoidCrossingShadowBoundaries( expanded_range), expanded_range.EndPosition()); - + // TODO(editing-dev): Implement + // const SelectionTemplate<Strategy>& editing_adjusted_selection = + // AdjustSelectionEditing(shadow_adjusted_selection); const EphemeralRangeTemplate<Strategy> editing_adjusted_range = AdjustSelectionToAvoidCrossingEditingBoundaries( shadow_adjusted_range, canonicalized_selection.Base()); + // TODO(editing-dev): Implement + // const SelectionTemplate<Strategy>& adjusted_selection = + // AdjustSelectionType(editing_adjusted_range); const SelectionType selection_type = ComputeSelectionType(editing_adjusted_range.StartPosition(), editing_adjusted_range.EndPosition());
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.cpp b/third_party/WebKit/Source/core/layout/LayoutTable.cpp index e481b2a..ca42f5c8e 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
@@ -536,11 +536,7 @@ extra_logical_height -= section->DistributeExtraLogicalHeightToRows(extra_logical_height); - // crbug.com/690087: We really would like to enable this ASSERT to ensure that - // all the extra space has been distributed. - // However our current distribution algorithm does not round properly and thus - // we can have some remaining height. - // DCHECK(!topSection() || !extraLogicalHeight); + DCHECK(!FirstBody() || !extra_logical_height); } void LayoutTable::SimplifiedNormalFlowLayout() {
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp index e2fdb6c0..0dcd17d3 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
@@ -1092,15 +1092,17 @@ if (extra_logical_height <= 0 || !row_pos_[total_rows]) return; - // FIXME: row_pos_[total_rows] - row_pos_[0] is the total rows' size. - int total_row_size = row_pos_[total_rows]; int total_logical_height_added = 0; int previous_row_position = row_pos_[0]; + float total_row_size = row_pos_[total_rows] - previous_row_position; for (unsigned r = 0; r < total_rows; r++) { // weight with the original height - total_logical_height_added += extra_logical_height * - (row_pos_[r + 1] - previous_row_position) / - total_row_size; + float height_to_add = extra_logical_height * + (row_pos_[r + 1] - previous_row_position) / + total_row_size; + total_logical_height_added = + std::min<int>(total_logical_height_added + std::ceil(height_to_add), + extra_logical_height); previous_row_position = row_pos_[r + 1]; row_pos_[r + 1] += total_logical_height_added; }