diff --git a/DEPS b/DEPS index 9dd07c7..64bd4ba 100644 --- a/DEPS +++ b/DEPS
@@ -44,7 +44,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': '3ed8063bc7c7c2e5081ef65ebd5bede0715733b6', + 'v8_revision': '5a8c6513ce4fe43af51c3aecef0f0bd8cdf864b5', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other. @@ -52,7 +52,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': '61bd9fe145af97dff38bca07c2f51fd6be0d21d6', + 'angle_revision': 'ccab69d64c2040d7bdd1b368699b3ddbaa3ca2e3', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling build tools # and whatever else without interference from each other.
diff --git a/android_webview/ui/grit_strings_whitelist.txt b/android_webview/ui/grit_strings_whitelist.txt index 8d34d4e..ae19234 100644 --- a/android_webview/ui/grit_strings_whitelist.txt +++ b/android_webview/ui/grit_strings_whitelist.txt
@@ -18,5 +18,3 @@ IDS_PHISHING_V4_PRIMARY_PARAGRAPH IDS_PHISHING_V4_EXPLANATION_PARAGRAPH IDS_PHISHING_V4_PROCEED_AND_REPORT_PARAGRAPH -IDS_SAFE_BROWSING_WHITEPAPER_URL -IDS_SAFE_BROWSING_PRIVACY_POLICY_URL
diff --git a/ash/display/display_configuration_controller.cc b/ash/display/display_configuration_controller.cc index d65cdbb6..2dac9593 100644 --- a/ash/display/display_configuration_controller.cc +++ b/ash/display/display_configuration_controller.cc
@@ -153,7 +153,6 @@ void DisplayConfigurationController::SetDisplayLayoutImpl( std::unique_ptr<display::DisplayLayout> layout) { - // TODO(oshima/stevenjb): Add support for 3+ displays. display_manager_->SetLayoutForCurrentDisplays(std::move(layout)); if (display_animator_) display_animator_->StartFadeInAnimation();
diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc index e6d7313..3668e51 100644 --- a/ash/display/display_manager_unittest.cc +++ b/ash/display/display_manager_unittest.cc
@@ -362,7 +362,11 @@ display_manager()->GetDisplayAt(0).bounds().ToString()); EXPECT_EQ("-320,10 320x200", display_manager()->GetDisplayAt(1).bounds().ToString()); - EXPECT_EQ("-310,-290 400x300", + + // The above layout causes an overlap between [P] and [2], making [2]'s + // bounds be "-310,-290 400x300" if the overlap is not fixed. The overlap + // must be detected and fixed and [2] is shifted up to remove the overlap. + EXPECT_EQ("-310,-300 400x300", display_manager()->GetDisplayAt(2).bounds().ToString()); } { @@ -451,6 +455,438 @@ } } +// Makes sure that layouts with overlapped displays are detected and fixed when +// applied. +TEST_P(DisplayManagerTest, NoOverlappedDisplays) { + int64_t primary_id = display::Screen::GetScreen()->GetPrimaryDisplay().id(); + { + // Layout with multiple overlaps and special cases: + // + // +-----+ + // +----+-+6 | + // | 5 | | | + // +----+----+ | | + // | 7 | | | | + // +----+----+-+---+---+-+---------+ + // | | P | | 2 | + // +------+ | | +----------+ + // | | | | 3 | + // | | | | | + // +--+----+-+-+-+-----+--+ | + // | 1 | | 4 | | | + // | | | +--+-------+ + // | | | | + // +--------+ +--------+ + + display::DisplayIdList list = display::test::CreateDisplayIdListN( + 8, primary_id, primary_id + 1, primary_id + 2, primary_id + 3, + primary_id + 4, primary_id + 5, primary_id + 6, primary_id + 7); + display::DisplayLayoutBuilder builder(primary_id); + builder.AddDisplayPlacement(list[1], primary_id, + display::DisplayPlacement::BOTTOM, 50); + builder.AddDisplayPlacement(list[2], list[1], + display::DisplayPlacement::TOP, 300); + builder.AddDisplayPlacement(list[3], list[2], + display::DisplayPlacement::RIGHT, 30); + builder.AddDisplayPlacement(list[4], list[2], + display::DisplayPlacement::BOTTOM, 400); + builder.AddDisplayPlacement(list[5], primary_id, + display::DisplayPlacement::LEFT, -300); + builder.AddDisplayPlacement(list[6], primary_id, + display::DisplayPlacement::TOP, -250); + builder.AddDisplayPlacement(list[7], list[6], + display::DisplayPlacement::LEFT, 250); + display_manager()->layout_store()->RegisterLayoutForDisplayIdList( + list, builder.Build()); + + UpdateDisplay( + "480x400,480x400,480x400,480x400,480x400,480x400,480x400,530x150"); + + // The resulting layout after overlaps had been removed: + // + // + // +---------+ + // | 7 +-----+ + // +-+-------+ 6 | + // | 5 | | + // | | | + // | | | + // | |-+---+----+---------+ + // | | | P | 2 | + // +-------+ | | +----------+ + // | | | 3 | + // | | | | + // +--+-----+-+-------+ | + // | 1 | | | + // | | +----+---+------+ + // | | | 4 | + // +-------+ | | + // | | + // +--------+ + + EXPECT_EQ(8U, display_manager()->GetNumDisplays()); + + EXPECT_EQ("0,0 480x400", + display_manager()->GetDisplayAt(0).bounds().ToString()); + EXPECT_EQ("50,400 480x400", + display_manager()->GetDisplayAt(1).bounds().ToString()); + EXPECT_EQ("480,0 480x400", + display_manager()->GetDisplayAt(2).bounds().ToString()); + EXPECT_EQ("960,30 480x400", + display_manager()->GetDisplayAt(3).bounds().ToString()); + EXPECT_EQ("730,430 480x400", + display_manager()->GetDisplayAt(4).bounds().ToString()); + EXPECT_EQ("-730,-300 480x400", + display_manager()->GetDisplayAt(5).bounds().ToString()); + EXPECT_EQ("-250,-400 480x400", + display_manager()->GetDisplayAt(6).bounds().ToString()); + EXPECT_EQ("-780,-450 530x150", + display_manager()->GetDisplayAt(7).bounds().ToString()); + + // Expect that the displays have been reparented correctly, such that a + // child is always touching its parent. + display::DisplayLayoutBuilder expected_layout_builder(primary_id); + expected_layout_builder.AddDisplayPlacement( + list[1], primary_id, display::DisplayPlacement::BOTTOM, 50); + expected_layout_builder.AddDisplayPlacement( + list[2], list[1], display::DisplayPlacement::TOP, 430); + expected_layout_builder.AddDisplayPlacement( + list[3], list[2], display::DisplayPlacement::RIGHT, 30); + // [4] became a child of [3] instead of [2] as they no longer touch. + expected_layout_builder.AddDisplayPlacement( + list[4], list[3], display::DisplayPlacement::BOTTOM, -230); + // [5] became a child of [6] instead of [P] as they no longer touch. + expected_layout_builder.AddDisplayPlacement( + list[5], list[6], display::DisplayPlacement::LEFT, 100); + expected_layout_builder.AddDisplayPlacement( + list[6], primary_id, display::DisplayPlacement::TOP, -250); + expected_layout_builder.AddDisplayPlacement( + list[7], list[6], display::DisplayPlacement::LEFT, -50); + + const display::DisplayLayout& layout = + display_manager()->GetCurrentResolvedDisplayLayout(); + + EXPECT_TRUE( + layout.HasSamePlacementList(*(expected_layout_builder.Build()))); + } + + { + // The following is a special case where a child display is closer to the + // origin than its parent. Test that we can handle it successfully without + // introducing a circular dependency. + // + // +---------+ + // | P | +---------+ + // | | | 3 | + // | | | | + // | | | | + // +------+--+----+ | + // | 1 | | 2 +---------+ + // | | | | + // | | | | + // | | | | + // +------+--+----+ + // + + display::DisplayIdList list = display::test::CreateDisplayIdListN( + 4, primary_id, primary_id + 1, primary_id + 2, primary_id + 3); + display::DisplayLayoutBuilder builder(primary_id); + builder.AddDisplayPlacement(list[1], primary_id, + display::DisplayPlacement::BOTTOM, 0); + builder.AddDisplayPlacement(list[2], primary_id, + display::DisplayPlacement::BOTTOM, 464); + builder.AddDisplayPlacement(list[3], list[2], + display::DisplayPlacement::RIGHT, -700); + display_manager()->layout_store()->RegisterLayoutForDisplayIdList( + list, builder.Build()); + UpdateDisplay("696x800,696x800,300x800,696x800"); + + // The expected layout should be: + // + // +---------+ + // | P | +---------+ + // | | | 3 | + // | | | | + // | | | | + // +---------+-------+ | + // | 1 | 2 +---------+ + // | | | + // | | | + // | | | + // +---------+-------+ + // + // + + EXPECT_EQ(4U, display_manager()->GetNumDisplays()); + EXPECT_EQ("0,0 696x800", + display_manager()->GetDisplayAt(0).bounds().ToString()); + EXPECT_EQ("0,800 696x800", + display_manager()->GetDisplayAt(1).bounds().ToString()); + EXPECT_EQ("696,800 300x800", + display_manager()->GetDisplayAt(2).bounds().ToString()); + EXPECT_EQ("996,100 696x800", + display_manager()->GetDisplayAt(3).bounds().ToString()); + + // This case if not handled correctly might lead to a cyclic dependency. + // Make sure this doesn't happen. + display::DisplayLayoutBuilder expected_layout_builder(primary_id); + expected_layout_builder.AddDisplayPlacement( + list[1], primary_id, display::DisplayPlacement::BOTTOM, 0); + expected_layout_builder.AddDisplayPlacement( + list[2], primary_id, display::DisplayPlacement::BOTTOM, 696); + expected_layout_builder.AddDisplayPlacement( + list[3], list[2], display::DisplayPlacement::RIGHT, -700); + + const display::DisplayLayout& layout = + display_manager()->GetCurrentResolvedDisplayLayout(); + EXPECT_TRUE( + layout.HasSamePlacementList(*(expected_layout_builder.Build()))); + } + + { + // The following is a layout with an overlap to the left of the primary + // display. + // + // +---------+---------+ + // | 1 | P | + // | | | + // +---------+ | + // | | | + // +---------+---------+ + // | 2 | + // | | + // +---------+ + + display::DisplayIdList list = display::test::CreateDisplayIdListN( + 3, primary_id, primary_id + 1, primary_id + 2); + display::DisplayLayoutBuilder builder(primary_id); + builder.AddDisplayPlacement(list[1], primary_id, + display::DisplayPlacement::LEFT, 0); + builder.AddDisplayPlacement(list[2], primary_id, + display::DisplayPlacement::LEFT, 250); + display_manager()->layout_store()->RegisterLayoutForDisplayIdList( + list, builder.Build()); + UpdateDisplay("696x500,696x500,696x500"); + + // The expected layout should be: + // + // +---------+---------+ + // | 1 | P | + // | | | + // | | | + // | | | + // +---------+---------+ + // | 2 | + // | | + // | | + // | | + // +---------+ + + EXPECT_EQ(3U, display_manager()->GetNumDisplays()); + EXPECT_EQ("0,0 696x500", + display_manager()->GetDisplayAt(0).bounds().ToString()); + EXPECT_EQ("-696,0 696x500", + display_manager()->GetDisplayAt(1).bounds().ToString()); + EXPECT_EQ("-696,500 696x500", + display_manager()->GetDisplayAt(2).bounds().ToString()); + } + + { + // The following is a layout with an overlap occuring above the primary + // display. + // + // +------+--+------+ + // | 2 | | 1 | + // | | | | + // | | | | + // | | | | + // +------+--+------+ + // | P | + // | | + // | | + // | | + // +---------+ + // + + display::DisplayIdList list = display::test::CreateDisplayIdListN( + 3, primary_id, primary_id + 1, primary_id + 2); + display::DisplayLayoutBuilder builder(primary_id); + builder.AddDisplayPlacement(list[1], primary_id, + display::DisplayPlacement::TOP, 0); + builder.AddDisplayPlacement(list[2], primary_id, + display::DisplayPlacement::TOP, -348); + display_manager()->layout_store()->RegisterLayoutForDisplayIdList( + list, builder.Build()); + UpdateDisplay("696x500,696x500,696x500"); + + // The expected layout should be: + // + // +---------+---------+ + // | 2 | 1 | + // | | | + // | | | + // | | | + // +---------+---------+ + // | P | + // | | + // | | + // | | + // +---------+ + // + + EXPECT_EQ(3U, display_manager()->GetNumDisplays()); + EXPECT_EQ("0,0 696x500", + display_manager()->GetDisplayAt(0).bounds().ToString()); + EXPECT_EQ("0,-500 696x500", + display_manager()->GetDisplayAt(1).bounds().ToString()); + EXPECT_EQ("-696,-500 696x500", + display_manager()->GetDisplayAt(2).bounds().ToString()); + } +} + +TEST_P(DisplayManagerTest, NoOverlappedDisplaysNotFitBetweenTwo) { + // +------+--+----+--+------+ + // | 1 | | 2 | | 3 | + // | | | | | | + // | | | | | | + // | | | | | | + // +-+----+--+----+--+---+--+ + // | P | + // | | + // | | + // | | + // +-------------------+ + // + + int64_t primary_id = display::Screen::GetScreen()->GetPrimaryDisplay().id(); + display::DisplayIdList list = display::test::CreateDisplayIdListN( + 4, primary_id, primary_id + 1, primary_id + 2, primary_id + 3); + display::DisplayLayoutBuilder builder(primary_id); + builder.AddDisplayPlacement(list[1], primary_id, + display::DisplayPlacement::TOP, -110); + builder.AddDisplayPlacement(list[2], primary_id, + display::DisplayPlacement::TOP, 300); + builder.AddDisplayPlacement(list[3], primary_id, + display::DisplayPlacement::TOP, 600); + display_manager()->layout_store()->RegisterLayoutForDisplayIdList( + list, builder.Build()); + UpdateDisplay("1200x500,600x500,600x500,600x500"); + + // The expected layout should be: + // + // +---------+---------+---------+ + // | 1 | 2 | 3 | + // | | | | + // | | | | + // | | | | + // +-+-------+---------+-+-------+ + // | P | + // | | + // | | + // | | + // +-------------------+ + // + + EXPECT_EQ(4U, display_manager()->GetNumDisplays()); + EXPECT_EQ("0,0 1200x500", + display_manager()->GetDisplayAt(0).bounds().ToString()); + EXPECT_EQ("-110,-500 600x500", + display_manager()->GetDisplayAt(1).bounds().ToString()); + EXPECT_EQ("490,-500 600x500", + display_manager()->GetDisplayAt(2).bounds().ToString()); + EXPECT_EQ("1090,-500 600x500", + display_manager()->GetDisplayAt(3).bounds().ToString()); +} + +TEST_P(DisplayManagerTest, NoOverlappedDisplaysAfterResolutionChange) { + // Starting with a good layout with no overlaps, test that if the resolution + // of one of the displays is changed, it won't result in any overlaps. + // + // +-------------------+ + // | 4 | + // | | + // | | + // | | + // +----+----+---------+----+----+ + // | 1 | 2 | 3 | + // | | | | + // | | | | + // | | | | + // +----+----+---------+----+----+ + // | p | + // | | + // | | + // | | + // +-------------------+ + // + + int64_t primary_id = display::Screen::GetScreen()->GetPrimaryDisplay().id(); + display::DisplayIdList list = display::test::CreateDisplayIdListN( + 5, primary_id, primary_id + 1, primary_id + 2, primary_id + 3, + primary_id + 4); + display::DisplayLayoutBuilder builder(primary_id); + builder.AddDisplayPlacement(list[1], primary_id, + display::DisplayPlacement::TOP, -250); + builder.AddDisplayPlacement(list[2], primary_id, + display::DisplayPlacement::TOP, 250); + builder.AddDisplayPlacement(list[3], primary_id, + display::DisplayPlacement::TOP, 750); + builder.AddDisplayPlacement(list[4], list[1], display::DisplayPlacement::TOP, + 250); + display_manager()->layout_store()->RegisterLayoutForDisplayIdList( + list, builder.Build()); + UpdateDisplay("1000x500,500x500,500x500,500x500,1000x500"); + + // There should be no overlap at all. + EXPECT_EQ(5U, display_manager()->GetNumDisplays()); + EXPECT_EQ("0,0 1000x500", + display_manager()->GetDisplayAt(0).bounds().ToString()); + EXPECT_EQ("-250,-500 500x500", + display_manager()->GetDisplayAt(1).bounds().ToString()); + EXPECT_EQ("250,-500 500x500", + display_manager()->GetDisplayAt(2).bounds().ToString()); + EXPECT_EQ("750,-500 500x500", + display_manager()->GetDisplayAt(3).bounds().ToString()); + EXPECT_EQ("0,-1000 1000x500", + display_manager()->GetDisplayAt(4).bounds().ToString()); + + // Change the resolution of display (2) and expect the following layout. + // + // +-------------------+ + // | 4 | + // | | + // | | + // | | + // +----+-------------++ + // | 2 | + // +---------+ +---------+ + // | 1 | | 3 | + // | | | | + // | | | | + // | | | | + // +----+----+-------------++--------+ + // | p | + // | | + // | | + // | | + // +-------------------+ + // + + UpdateDisplay("1000x500,500x500,600x600,500x500,1000x500"); + + EXPECT_EQ(5U, display_manager()->GetNumDisplays()); + EXPECT_EQ("0,0 1000x500", + display_manager()->GetDisplayAt(0).bounds().ToString()); + EXPECT_EQ("-250,-500 500x500", + display_manager()->GetDisplayAt(1).bounds().ToString()); + EXPECT_EQ("250,-600 600x600", + display_manager()->GetDisplayAt(2).bounds().ToString()); + EXPECT_EQ("850,-500 500x500", + display_manager()->GetDisplayAt(3).bounds().ToString()); + EXPECT_EQ("0,-1100 1000x500", + display_manager()->GetDisplayAt(4).bounds().ToString()); +} + TEST_P(DisplayManagerTest, NoMirrorInThreeDisplays) { UpdateDisplay("640x480,320x200,400x300"); ash::Shell::GetInstance()->display_configuration_controller()->SetMirrorMode(
diff --git a/base/metrics/statistics_recorder.cc b/base/metrics/statistics_recorder.cc index 4828450..ba2101b 100644 --- a/base/metrics/statistics_recorder.cc +++ b/base/metrics/statistics_recorder.cc
@@ -87,6 +87,7 @@ histograms_ = existing_histograms_.release(); callbacks_ = existing_callbacks_.release(); ranges_ = existing_ranges_.release(); + providers_ = existing_providers_.release(); } // static @@ -113,6 +114,12 @@ } // static +void StatisticsRecorder::RegisterHistogramProvider( + const WeakPtr<HistogramProvider>& provider) { + providers_->push_back(provider); +} + +// static HistogramBase* StatisticsRecorder::RegisterOrDeleteDuplicate( HistogramBase* histogram) { HistogramBase* histogram_to_delete = nullptr; @@ -307,6 +314,20 @@ } // static +void StatisticsRecorder::ImportProvidedHistograms() { + if (!providers_) + return; + + // Merge histogram data from each provider in turn. + for (const WeakPtr<HistogramProvider>& provider : *providers_) { + // Weak-pointer may be invalid if the provider was destructed, though they + // generally never are. + if (provider) + provider->MergeHistogramDeltas(); + } +} + +// static StatisticsRecorder::HistogramIterator StatisticsRecorder::begin( bool include_persistent) { DCHECK(histograms_); @@ -346,6 +367,8 @@ if (!histograms_) return; + ImportGlobalPersistentHistograms(); + for (const auto& entry : *histograms_) { if (entry.second->histogram_name().find(query) != std::string::npos) snapshot->push_back(entry.second); @@ -458,10 +481,12 @@ existing_histograms_.reset(histograms_); existing_callbacks_.reset(callbacks_); existing_ranges_.reset(ranges_); + existing_providers_.reset(providers_); histograms_ = new HistogramMap; callbacks_ = new CallbackMap; ranges_ = new RangesMap; + providers_ = new HistogramProviders; InitLogOnShutdownWithoutLock(); } @@ -479,14 +504,17 @@ std::unique_ptr<HistogramMap> histograms_deleter; std::unique_ptr<CallbackMap> callbacks_deleter; std::unique_ptr<RangesMap> ranges_deleter; + std::unique_ptr<HistogramProviders> providers_deleter; { base::AutoLock auto_lock(lock_.Get()); histograms_deleter.reset(histograms_); callbacks_deleter.reset(callbacks_); ranges_deleter.reset(ranges_); + providers_deleter.reset(providers_); histograms_ = nullptr; callbacks_ = nullptr; ranges_ = nullptr; + providers_ = nullptr; } // We are going to leak the histograms and the ranges. } @@ -506,6 +534,8 @@ // static StatisticsRecorder::RangesMap* StatisticsRecorder::ranges_ = nullptr; // static +StatisticsRecorder::HistogramProviders* StatisticsRecorder::providers_; +// static base::LazyInstance<base::Lock>::Leaky StatisticsRecorder::lock_ = LAZY_INSTANCE_INITIALIZER;
diff --git a/base/metrics/statistics_recorder.h b/base/metrics/statistics_recorder.h index 6deddae..193bad79 100644 --- a/base/metrics/statistics_recorder.h +++ b/base/metrics/statistics_recorder.h
@@ -23,6 +23,7 @@ #include "base/gtest_prod_util.h" #include "base/lazy_instance.h" #include "base/macros.h" +#include "base/memory/weak_ptr.h" #include "base/metrics/histogram_base.h" #include "base/strings/string_piece.h" #include "base/synchronization/lock.h" @@ -62,8 +63,17 @@ } }; + // An interface class that allows the StatisticsRecorder to forcibly merge + // histograms from providers when necessary. + class HistogramProvider { + public: + // Merges all histogram information into the global versions. + virtual void MergeHistogramDeltas() = 0; + }; + typedef std::map<StringKey, HistogramBase*> HistogramMap; typedef std::vector<HistogramBase*> Histograms; + typedef std::vector<WeakPtr<HistogramProvider>> HistogramProviders; // A class for iterating over the histograms held within this global resource. class BASE_EXPORT HistogramIterator { @@ -101,6 +111,12 @@ // Find out if histograms can now be registered into our list. static bool IsActive(); + // Register a provider of histograms that can be called to merge those into + // the global StatisticsRecorder. Calls to ImportProvidedHistograms() will + // fetch from registered providers. + static void RegisterHistogramProvider( + const WeakPtr<HistogramProvider>& provider); + // Register, or add a new histogram to the collection of statistics. If an // identically named histogram is already registered, then the argument // |histogram| will deleted. The returned value is always the registered @@ -134,6 +150,9 @@ // safe. It returns NULL if a matching histogram is not found. static HistogramBase* FindHistogram(base::StringPiece name); + // Imports histograms from providers. This must be called on the UI thread. + static void ImportProvidedHistograms(); + // Support for iterating over known histograms. static HistogramIterator begin(bool include_persistent); static HistogramIterator end(); @@ -220,6 +239,7 @@ std::unique_ptr<HistogramMap> existing_histograms_; std::unique_ptr<CallbackMap> existing_callbacks_; std::unique_ptr<RangesMap> existing_ranges_; + std::unique_ptr<HistogramProviders> existing_providers_; bool vlog_initialized_ = false; @@ -229,6 +249,7 @@ static HistogramMap* histograms_; static CallbackMap* callbacks_; static RangesMap* ranges_; + static HistogramProviders* providers_; // Lock protects access to above maps. This is a LazyInstance to avoid races // when the above methods are used before Initialize(). Previously each method
diff --git a/base/metrics/statistics_recorder_unittest.cc b/base/metrics/statistics_recorder_unittest.cc index 65e2c98..48b6df3 100644 --- a/base/metrics/statistics_recorder_unittest.cc +++ b/base/metrics/statistics_recorder_unittest.cc
@@ -12,6 +12,7 @@ #include "base/bind.h" #include "base/json/json_reader.h" #include "base/logging.h" +#include "base/memory/weak_ptr.h" #include "base/metrics/histogram_macros.h" #include "base/metrics/persistent_histogram_allocator.h" #include "base/metrics/sparse_histogram.h" @@ -656,4 +657,74 @@ EXPECT_TRUE(VLogInitialized()); } +class TestHistogramProvider : public StatisticsRecorder::HistogramProvider { + public: + TestHistogramProvider(std::unique_ptr<PersistentHistogramAllocator> allocator) + : allocator_(std::move(allocator)), weak_factory_(this) { + StatisticsRecorder::RegisterHistogramProvider(weak_factory_.GetWeakPtr()); + } + + void MergeHistogramDeltas() override { + PersistentHistogramAllocator::Iterator hist_iter(allocator_.get()); + while (true) { + std::unique_ptr<base::HistogramBase> histogram = hist_iter.GetNext(); + if (!histogram) + break; + allocator_->MergeHistogramDeltaToStatisticsRecorder(histogram.get()); + } + } + + private: + std::unique_ptr<PersistentHistogramAllocator> allocator_; + WeakPtrFactory<TestHistogramProvider> weak_factory_; + + DISALLOW_COPY_AND_ASSIGN(TestHistogramProvider); +}; + +TEST_P(StatisticsRecorderTest, ImportHistogramsTest) { + // Create a second SR to create some histograms for later import. + std::unique_ptr<StatisticsRecorder> temp_sr = + StatisticsRecorder::CreateTemporaryForTesting(); + + // Extract any existing global allocator so a new one can be created. + std::unique_ptr<GlobalHistogramAllocator> old_allocator = + GlobalHistogramAllocator::ReleaseForTesting(); + + // Create a histogram inside a new allocator for testing. + GlobalHistogramAllocator::CreateWithLocalMemory(kAllocatorMemorySize, 0, ""); + HistogramBase* histogram = LinearHistogram::FactoryGet("Foo", 1, 10, 11, 0); + histogram->Add(3); + + // Undo back to the starting point. + std::unique_ptr<GlobalHistogramAllocator> new_allocator = + GlobalHistogramAllocator::ReleaseForTesting(); + GlobalHistogramAllocator::Set(std::move(old_allocator)); + temp_sr.reset(); + + // Create a provider that can supply histograms to the current SR. + TestHistogramProvider provider(std::move(new_allocator)); + + // Verify that the created histogram is no longer known. + ASSERT_FALSE(StatisticsRecorder::FindHistogram(histogram->histogram_name())); + + // Now test that it merges. + StatisticsRecorder::ImportProvidedHistograms(); + HistogramBase* found = + StatisticsRecorder::FindHistogram(histogram->histogram_name()); + ASSERT_TRUE(found); + EXPECT_NE(histogram, found); + std::unique_ptr<HistogramSamples> snapshot = found->SnapshotSamples(); + EXPECT_EQ(1, snapshot->TotalCount()); + EXPECT_EQ(1, snapshot->GetCount(3)); + + // Finally, verify that updates can also be merged. + histogram->Add(3); + histogram->Add(5); + StatisticsRecorder::ImportProvidedHistograms(); + snapshot = found->SnapshotSamples(); + EXPECT_EQ(3, snapshot->TotalCount()); + EXPECT_EQ(2, snapshot->GetCount(3)); + EXPECT_EQ(1, snapshot->GetCount(5)); +} + } // namespace base
diff --git a/build/config/sanitizers/sanitizers.gni b/build/config/sanitizers/sanitizers.gni index a0e9940..512b44b 100644 --- a/build/config/sanitizers/sanitizers.gni +++ b/build/config/sanitizers/sanitizers.gni
@@ -139,7 +139,7 @@ asan_globals = !is_mac } -if (use_afl && sanitizer_coverage_flags == "") { +if ((use_afl || use_libfuzzer) && sanitizer_coverage_flags == "") { sanitizer_coverage_flags = "trace-pc-guard" } else if (use_sanitizer_coverage && sanitizer_coverage_flags == "") { sanitizer_coverage_flags = "edge,indirect-calls,8bit-counters"
diff --git a/build/secondary/third_party/android_tools/BUILD.gn b/build/secondary/third_party/android_tools/BUILD.gn index a28fad5d..bd899243 100644 --- a/build/secondary/third_party/android_tools/BUILD.gn +++ b/build/secondary/third_party/android_tools/BUILD.gn
@@ -125,6 +125,14 @@ ] } +android_aar_prebuilt("android_support_v7_gridlayout_java") { + deps = [ + ":android_support_v7_appcompat_java", + ] + _lib_name = "gridlayout-v7" + aar_path = "$lib_path/$_lib_name/$lib_version/$_lib_name-$lib_version.aar" +} + android_aar_prebuilt("android_support_v7_mediarouter_java") { deps = [ ":android_support_v7_appcompat_java",
diff --git a/cc/output/in_process_context_provider.cc b/cc/output/in_process_context_provider.cc index c98a4f1..9fd6d18 100644 --- a/cc/output/in_process_context_provider.cc +++ b/cc/output/in_process_context_provider.cc
@@ -40,7 +40,7 @@ gpu::gles2::ContextCreationAttribHelper attributes; attributes.alpha_size = -1; attributes.depth_size = 0; - attributes.stencil_size = 0; + attributes.stencil_size = 8; attributes.samples = 0; attributes.sample_buffers = 0; attributes.fail_if_major_perf_caveat = false;
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index 8989d1cfe..101078b 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn
@@ -210,6 +210,7 @@ "//third_party/android_tools:android_support_design_java", "//third_party/android_tools:android_support_v13_java", "//third_party/android_tools:android_support_v7_appcompat_java", + "//third_party/android_tools:android_support_v7_gridlayout_java", "//third_party/android_tools:android_support_v7_mediarouter_java", "//third_party/android_tools:android_support_v7_recyclerview_java", "//third_party/cacheinvalidation:cacheinvalidation_javalib",
diff --git a/chrome/android/java/res/values/dimens.xml b/chrome/android/java/res/values/dimens.xml index bb18753..2aa5c62 100644 --- a/chrome/android/java/res/values/dimens.xml +++ b/chrome/android/java/res/values/dimens.xml
@@ -362,12 +362,10 @@ <dimen name="payments_section_checking_spacing">6dp</dimen> <dimen name="payments_section_descriptive_item_spacing">40dp</dimen> <dimen name="payments_section_separator_height">1dp</dimen> - <dimen name="payments_section_logo_height">36dp</dimen> - <dimen name="payments_section_logo_width">56dp</dimen> + <dimen name="payments_section_logo_width">38dp</dimen> <dimen name="payments_section_add_button_height">48dp</dimen> <dimen name="payments_ui_max_dialog_width">0dp</dimen> <dimen name="payments_ui_translation">100dp</dimen> - <dimen name="payments_editor_icon_list_size">38dp</dimen> <dimen name="payments_favicon_size">24dp</dimen> <!-- Preferences dimensions
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java index 5cd73bf..a15c2f9 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java
@@ -44,7 +44,6 @@ import org.chromium.chrome.browser.omaha.RequestGenerator; import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomizations; import org.chromium.chrome.browser.physicalweb.PhysicalWebBleClient; -import org.chromium.chrome.browser.physicalweb.PhysicalWebEnvironment; import org.chromium.chrome.browser.policy.PolicyAuditor; import org.chromium.chrome.browser.preferences.LocationSettings; import org.chromium.chrome.browser.preferences.PreferencesLauncher; @@ -318,13 +317,6 @@ return new PhysicalWebBleClient(); } - /** - * @return A new {@link PhysicalWebEnvironment} instance. - */ - public PhysicalWebEnvironment createPhysicalWebEnvironment() { - return new PhysicalWebEnvironment(); - } - public InstantAppsHandler createInstantAppsHandler() { return new InstantAppsHandler(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadManagerToolbar.java b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadManagerToolbar.java index 90c1eed..b3878ba 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadManagerToolbar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadManagerToolbar.java
@@ -84,6 +84,12 @@ @Override public void onManagerDestroyed() { } + @Override + public void hideSearchView() { + super.hideSearchView(); + updateTitle(); + } + private void updateTitle() { if (mFilter == DownloadFilter.FILTER_ALL) { setTitle(R.string.menu_downloads);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorIconsField.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorIconsField.java index f41ea7c..afce857 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorIconsField.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorIconsField.java
@@ -38,8 +38,8 @@ ((TextView) mLayout.findViewById(R.id.label)).setText(fieldModel.getLabel()); LinearLayout container = (LinearLayout) mLayout.findViewById(R.id.icons_container); - int size = context.getResources().getDimensionPixelSize( - R.dimen.payments_editor_icon_list_size); + int size = + context.getResources().getDimensionPixelSize(R.dimen.payments_section_logo_width); int margin = context.getResources().getDimensionPixelSize( R.dimen.payments_section_small_spacing); LinearLayout.LayoutParams layoutParams =
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestSection.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestSection.java index 96eb965c..7f98299 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestSection.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestSection.java
@@ -11,6 +11,7 @@ import android.graphics.drawable.Drawable; import android.os.Handler; import android.support.v4.view.animation.LinearOutSlowInInterpolator; +import android.support.v7.widget.GridLayout; import android.text.SpannableStringBuilder; import android.text.TextUtils; import android.text.TextUtils.TruncateAt; @@ -25,7 +26,6 @@ import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.widget.Button; -import android.widget.GridLayout; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; @@ -173,7 +173,7 @@ // Create the main content. mMainSection = prepareMainSection(sectionName); - mLogoView = isLogoNecessary() ? createAndAddLogoView(this, 0, mLargeSpacing) : null; + mLogoView = isLogoNecessary() ? createAndAddLogoView(this, mLargeSpacing) : null; mEditButtonView = createAndAddEditButton(this); mChevronView = createAndAddChevron(this); mIsLayoutInitialized = true; @@ -183,11 +183,18 @@ /** * Sets what logo should be displayed. * - * @param logo The logo to display. + * @param logo The logo to display. + * @param drawBorder Whether draw border background for the logo. */ - protected void setLogoDrawable(Drawable logo) { + protected void setLogoDrawable(Drawable logo, boolean drawBorder) { assert isLogoNecessary(); mLogo = logo; + + if (drawBorder) { + mLogoView.setBackgroundResource(R.drawable.payments_ui_logo_bg); + } else { + mLogoView.setBackgroundResource(0); + } mLogoView.setImageDrawable(mLogo); } @@ -374,16 +381,15 @@ return mainSectionLayout; } - private static ImageView createAndAddLogoView( - ViewGroup parent, int resourceId, int startMargin) { + private static ImageView createAndAddLogoView(ViewGroup parent, int startMargin) { ImageView view = new ImageView(parent.getContext()); - view.setBackgroundResource(R.drawable.payments_ui_logo_bg); - if (resourceId != 0) view.setImageResource(resourceId); + view.setMaxWidth(parent.getContext().getResources().getDimensionPixelSize( + R.dimen.payments_section_logo_width)); + view.setAdjustViewBounds(true); // The logo has a pre-defined height and width. - LayoutParams params = new LayoutParams( - parent.getResources().getDimensionPixelSize(R.dimen.payments_section_logo_width), - parent.getResources().getDimensionPixelSize(R.dimen.payments_section_logo_height)); + LayoutParams params = + new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); ApiCompatibilityUtils.setMarginStart(params, startMargin); parent.addView(view, params); return view; @@ -1019,9 +1025,9 @@ // The label spans two columns if no option or edit icon, or spans three columns if // no option and edit icons. Setting the view width to 0 forces it to stretch. - GridLayout.LayoutParams labelParams = new GridLayout.LayoutParams( - GridLayout.spec(rowIndex, 1, GridLayout.CENTER), - GridLayout.spec(columnStart, columnSpan, GridLayout.FILL)); + GridLayout.LayoutParams labelParams = + new GridLayout.LayoutParams(GridLayout.spec(rowIndex, 1, GridLayout.CENTER), + GridLayout.spec(columnStart, columnSpan, GridLayout.FILL, 1f)); labelParams.topMargin = mVerticalMargin; labelParams.width = 0; if (optionIconExists) { @@ -1042,15 +1048,21 @@ // The icon has a pre-defined width. ImageView optionIcon = new ImageView(parent.getContext()); optionIcon.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); - optionIcon.setBackgroundResource(R.drawable.payments_ui_logo_bg); + if (mOption.isEditable()) { + // Draw border background for the icon if the option is editable. + optionIcon.setBackgroundResource(R.drawable.payments_ui_logo_bg); + optionIcon.setMaxWidth(mEditableOptionIconMaxWidth); + } else { + optionIcon.setMaxWidth(mNonEditableOptionIconMaxWidth); + } + optionIcon.setAdjustViewBounds(true); optionIcon.setImageDrawable(mOption.getDrawableIcon()); - optionIcon.setMaxWidth(mIconMaxWidth); // Place option icon at column three if no edit icon. int columnStart = editIconExists ? 2 : 3; - GridLayout.LayoutParams iconParams = new GridLayout.LayoutParams( - GridLayout.spec(rowIndex, 1, GridLayout.CENTER), - GridLayout.spec(columnStart, 1)); + GridLayout.LayoutParams iconParams = + new GridLayout.LayoutParams(GridLayout.spec(rowIndex, 1, GridLayout.CENTER), + GridLayout.spec(columnStart, 1, GridLayout.CENTER)); iconParams.topMargin = mVerticalMargin; parent.addView(optionIcon, iconParams); @@ -1063,8 +1075,9 @@ .inflate(R.layout.payment_option_edit_icon, null); // The icon floats to the right of everything. - GridLayout.LayoutParams iconParams = new GridLayout.LayoutParams( - GridLayout.spec(rowIndex, 1, GridLayout.CENTER), GridLayout.spec(3, 1)); + GridLayout.LayoutParams iconParams = + new GridLayout.LayoutParams(GridLayout.spec(rowIndex, 1, GridLayout.CENTER), + GridLayout.spec(3, 1, GridLayout.CENTER)); iconParams.topMargin = mVerticalMargin; parent.addView(editorIcon, iconParams); @@ -1079,8 +1092,11 @@ /** All the possible PaymentOptions in Layout form, then one row for adding new options. */ private final ArrayList<OptionRow> mOptionRows = new ArrayList<>(); - /** Width that the icon takes. */ - private final int mIconMaxWidth; + /** Width that the editable option icon takes. */ + private final int mEditableOptionIconMaxWidth; + + /** Width that the non editable option icon takes. */ + private final int mNonEditableOptionIconMaxWidth; /** Layout containing all the {@link OptionRow}s. */ private GridLayout mOptionLayout; @@ -1107,8 +1123,10 @@ super(context, sectionName, delegate); mVerticalMargin = context.getResources().getDimensionPixelSize( R.dimen.payments_section_small_spacing); - mIconMaxWidth = context.getResources().getDimensionPixelSize( + mEditableOptionIconMaxWidth = context.getResources().getDimensionPixelSize( R.dimen.payments_section_logo_width); + mNonEditableOptionIconMaxWidth = + context.getResources().getDimensionPixelSize(R.dimen.payments_favicon_size); setSummaryText(null, null); } @@ -1280,11 +1298,11 @@ private void updateSelectedItem(PaymentOption selectedItem) { if (selectedItem == null) { - setLogoDrawable(null); + setLogoDrawable(null, false); setIsSummaryAllowed(false); setSummaryText(null, null); } else { - setLogoDrawable(selectedItem.getDrawableIcon()); + setLogoDrawable(selectedItem.getDrawableIcon(), selectedItem.isEditable()); setSummaryText( convertOptionToString(selectedItem, false /* useBoldLabel */, mSummaryInSingleLine),
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java index 6a9f4c3..d19dca7 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java
@@ -24,9 +24,7 @@ public class PhysicalWeb { public static final int OPTIN_NOTIFY_MAX_TRIES = 1; private static final String PREF_PHYSICAL_WEB_NOTIFY_COUNT = "physical_web_notify_count"; - private static final String PREF_IGNORE_OTHER_CLIENTS = "physical_web_ignore_other_clients"; private static final String FEATURE_NAME = "PhysicalWeb"; - private static final String IGNORE_OTHER_CLIENTS_FEATURE_NAME = "PhysicalWebIgnoreOtherClients"; private static final int MIN_ANDROID_VERSION = 18; /** @@ -85,15 +83,6 @@ } /** - * Returns true if we should fire notifications regardless of the existence of other Physical - * Web clients. - * This method is for use when the native library is not available. - */ - public static boolean shouldIgnoreOtherClients() { - return ContextUtils.getAppSharedPreferences().getBoolean(PREF_IGNORE_OTHER_CLIENTS, false); - } - - /** * Increments a value tracking how many times we've shown the Physical Web * opt-in notification. */ @@ -128,11 +117,6 @@ } if (isPhysicalWebPreferenceEnabled()) { - boolean ignoreOtherClients = - ChromeFeatureList.isEnabled(IGNORE_OTHER_CLIENTS_FEATURE_NAME); - ContextUtils.getAppSharedPreferences().edit() - .putBoolean(PREF_IGNORE_OTHER_CLIENTS, ignoreOtherClients) - .apply(); startPhysicalWeb(); // The PhysicalWebUma call in this method should be called only when the native library // is loaded. This is always the case on chrome startup.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebEnvironment.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebEnvironment.java deleted file mode 100644 index fe235b21..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebEnvironment.java +++ /dev/null
@@ -1,38 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.browser.physicalweb; - -import org.chromium.chrome.browser.ChromeApplication; - -/** - * Tool that reports information about conflicting clients. - */ -public class PhysicalWebEnvironment { - private static final Object INSTANCE_LOCK = new Object(); - private static PhysicalWebEnvironment sInstance; - - /** - * Get a singleton instance of this class. - * @param chromeApplication An instance of {@link ChromeApplication}, used to get the - * appropriate PhysicalWebEnvironment implementation. - * @return an instance of this class (or subclass) as decided by the application parameter - */ - public static PhysicalWebEnvironment getInstance(ChromeApplication chromeApplication) { - synchronized (INSTANCE_LOCK) { - if (sInstance == null) { - sInstance = chromeApplication.createPhysicalWebEnvironment(); - } - } - return sInstance; - } - - /** - * Reports whether the environment has another notification-based Physical Web client enabled. - * @return true if there is another notification-based Physical Web client enabled. - */ - public boolean hasNotificationBasedClient() { - return false; - } -}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/UrlManager.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/UrlManager.java index 90c6ced..e0ce3f9c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/UrlManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/UrlManager.java
@@ -331,6 +331,8 @@ .remove("org.chromium.chrome.browser.physicalweb.VERSION") .remove("org.chromium.chrome.browser.physicalweb" + ".BOTTOM_BAR_DISPLAY_COUNT") + // This clean up code can be deleted in m60 + .remove("physical_web_ignore_other_clients") .apply(); return null; }
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni index 6bb282b..43b1bfa 100644 --- a/chrome/android/java_sources.gni +++ b/chrome/android/java_sources.gni
@@ -742,7 +742,6 @@ "java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java", "java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebBleClient.java", "java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebDiagnosticsPage.java", - "java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebEnvironment.java", "java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebUma.java", "java/src/org/chromium/chrome/browser/physicalweb/PwCollection.java", "java/src/org/chromium/chrome/browser/physicalweb/PwsClient.java",
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestExpiredLocalCardTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestExpiredLocalCardTest.java index b75deaa32..fa1ed17 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestExpiredLocalCardTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestExpiredLocalCardTest.java
@@ -7,6 +7,7 @@ import android.content.DialogInterface; import android.support.test.filters.MediumTest; +import org.chromium.base.test.util.DisabledTest; import org.chromium.base.test.util.Feature; import org.chromium.chrome.R; import org.chromium.chrome.browser.autofill.AutofillTestHelper; @@ -116,8 +117,10 @@ /** * Tests the different card unmask error messages for an expired card. */ - @MediumTest - @Feature({"Payments"}) + // @MediumTest + // @Feature({"Payments"}) + // See: crbug.com/687438. + @DisabledTest public void testPromptErrorMessages() throws InterruptedException, ExecutionException, TimeoutException { // Click pay to get to the card unmask prompt.
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 2ceed93..a969e90 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -3412,6 +3412,9 @@ <message name="IDS_TASK_MANAGER_MEMORY_STATE_COLUMN" desc="Task manager memory state column. Shows the memory coordinator's state of a process"> Memory state </message> + <message name="IDS_TASK_MANAGER_KEEPALIVE_COUNT_COLUMN" desc="Task manager keepalive count column. Specific to Chrome extension processes, and only to those which use 'lazy' event pages, this indicates how many activities are making use of the extension, and therefore causing it to be kept alive."> + Keepalive count + </message> </if> <if expr="use_titlecase"> <message name="IDS_TASK_MANAGER_KILL" desc="The caption of the Task Manager kill button"> @@ -3489,6 +3492,9 @@ <message name="IDS_TASK_MANAGER_MEMORY_STATE_COLUMN" desc="Task manager memory state column. Shows the memory coordinator's state of a process"> Memory State </message> + <message name="IDS_TASK_MANAGER_KEEPALIVE_COUNT_COLUMN" desc="Task manager keepalive count column. Specific to Chrome extension processes, and only to those which use 'lazy' event pages, this indicates how many activities are making use of the extension, and therefore causing it to be kept alive."> + Keepalive Count + </message> </if> <message name="IDS_TASK_MANAGER_MEM_CELL_TEXT" desc="The value displayed in the memory usage cells."> <ph name="NUM_KILOBYTES">$1<ex>5,000</ex></ph>K @@ -3634,8 +3640,8 @@ </message> </if> <if expr="is_win"> - <message name="IDS_UTILITY_PROCESS_EMF_CONVERTOR_NAME" desc="The name of the utility process used for converting PDFs to EMFs."> - EMF Convertor + <message name="IDS_UTILITY_PROCESS_PDF_CONVERTOR_NAME" desc="The name of the utility process used for converting PDFs to a different format."> + PDF Convertor </message> <message name="IDS_UTILITY_PROCESS_FILE_DIALOG_NAME" desc="The name of the utility process used for handling a file open/save dialog."> File Open/Save Dialog @@ -15669,6 +15675,15 @@ If enabled, Chrome will draw the titlebar and caption buttons instead of deferring to Windows. </message> </if> + + <if expr="is_win"> + <message name="IDS_FLAGS_POSTSCRIPT_PRINTING" desc="Name of the flag that enables postscript printing."> + PostScript Printing + </message> + <message name="IDS_FLAGS_POSTSCRIPT_PRINTING_DESCRIPTION" desc="Description of the flag that enables postscript printing."> + Enable postscript generation in place of emf generation when printing to postscript capable printers. + </message> + </if> </messages> </release> </grit>
diff --git a/chrome/app/mash/BUILD.gn b/chrome/app/mash/BUILD.gn index 5473d23..c738779 100644 --- a/chrome/app/mash/BUILD.gn +++ b/chrome/app/mash/BUILD.gn
@@ -16,8 +16,9 @@ "//base:i18n", "//components/tracing:startup_tracing", "//content/public/common", + "//mash/common", "//mash/package", - "//mash/session/public/interfaces:constants", + "//mash/quick_launch/public/interfaces:constants", "//services/catalog/public/interfaces", "//services/service_manager", "//services/service_manager/background:lib", @@ -58,7 +59,6 @@ "//ash/touch_hud/mus:manifest", "//mash/catalog_viewer:manifest", "//mash/quick_launch:manifest", - "//mash/session:manifest", "//mash/task_viewer:manifest", "//services/ui:manifest", "//services/ui/ime/test_ime_driver:manifest",
diff --git a/chrome/app/mash/chrome_mash_manifest.json b/chrome/app/mash/chrome_mash_manifest.json index 2e0d846d..f550255 100644 --- a/chrome/app/mash/chrome_mash_manifest.json +++ b/chrome/app/mash/chrome_mash_manifest.json
@@ -16,8 +16,9 @@ }, "requires": { "service_manager": [ "service_manager:instance_per_child" ], - "mash_session": [ "app" ], - "catalog": [ "control" ] + "catalog": [ "control" ], + "ash": [ "app" ], + "quick_launch": [ "app" ] } } }
diff --git a/chrome/app/mash/mash_runner.cc b/chrome/app/mash/mash_runner.cc index f4720fb0..cf7c891 100644 --- a/chrome/app/mash/mash_runner.cc +++ b/chrome/app/mash/mash_runner.cc
@@ -32,8 +32,9 @@ #include "components/tracing/common/tracing_switches.h" #include "content/public/common/content_switches.h" #include "content/public/common/service_names.mojom.h" +#include "mash/common/config.h" #include "mash/package/mash_packaged_service.h" -#include "mash/session/public/interfaces/constants.mojom.h" +#include "mash/quick_launch/public/interfaces/constants.mojom.h" #include "mojo/edk/embedder/embedder.h" #include "mojo/edk/embedder/scoped_ipc_support.h" #include "mojo/public/cpp/bindings/binding_set.h" @@ -146,6 +147,25 @@ } #endif // defined(OS_CHROMEOS) +// Quits |run_loop| if the |identity| of the quitting service is critical to the +// system (e.g. the window manager). Used in the main process. +void OnInstanceQuitInMain(base::RunLoop* run_loop, + int* exit_value, + const service_manager::Identity& identity) { + DCHECK(exit_value); + DCHECK(run_loop); + + // TODO(jamescook): Also shut down if the window server dies. + if (identity.name() != mash::common::GetWindowManagerServiceName()) + return; + + if (!run_loop->running()) + return; + + *exit_value = 1; + run_loop->Quit(); +} + } // namespace MashRunner::MashRunner() {} @@ -158,11 +178,11 @@ if (IsChild()) return RunChild(); - RunMain(); - return 0; + + return RunMain(); } -void MashRunner::RunMain() { +int MashRunner::RunMain() { base::SequencedWorkerPool::EnableWithRedirectionToTaskSchedulerForProcess(); mojo::edk::Init(); @@ -174,6 +194,14 @@ ipc_thread.task_runner(), mojo::edk::ScopedIPCSupport::ShutdownPolicy::FAST); + int exit_value = RunServiceManagerInMain(); + + ipc_thread.Stop(); + base::TaskScheduler::GetInstance()->Shutdown(); + return exit_value; +} + +int MashRunner::RunServiceManagerInMain() { // TODO(sky): refactor BackgroundServiceManager so can supply own context, we // shouldn't we using context as it has a lot of stuff we don't really want // in chrome. @@ -189,11 +217,22 @@ kChromeMashServiceName, service_manager::mojom::kRootUserID), std::move(service), nullptr); - // Ping mash_session to ensure an instance is brought up - context_->connector()->Connect(mash::session::mojom::kServiceName); - base::RunLoop().Run(); + // Quit the main process if an important child (e.g. window manager) dies. + // On Chrome OS the OS-level session_manager will restart the main process. + base::RunLoop run_loop; + int exit_value = 0; + background_service_manager.SetInstanceQuitCallback( + base::Bind(&OnInstanceQuitInMain, &run_loop, &exit_value)); - base::TaskScheduler::GetInstance()->Shutdown(); + // Ping services that we know we want to launch on startup. + // TODO(jamescook): Start the window server / ui service explicitly. + context_->connector()->Connect(mash::common::GetWindowManagerServiceName()); + context_->connector()->Connect(mash::quick_launch::mojom::kServiceName); + + run_loop.Run(); + + context_.reset(); + return exit_value; } int MashRunner::RunChild() { @@ -213,10 +252,13 @@ // going to be mojo:ui at this point. So always create a TYPE_UI message loop // for now. base::MessageLoop message_loop(base::MessageLoop::TYPE_UI); + base::RunLoop run_loop; context_.reset(new service_manager::ServiceContext( base::MakeUnique<mash::MashPackagedService>(), std::move(service_request))); - base::RunLoop().Run(); + // Quit the child process if it loses its connection to service manager. + context_->SetConnectionLostClosure(run_loop.QuitClosure()); + run_loop.Run(); } int MashMain() {
diff --git a/chrome/app/mash/mash_runner.h b/chrome/app/mash/mash_runner.h index deaea41..75ffd0fb 100644 --- a/chrome/app/mash/mash_runner.h +++ b/chrome/app/mash/mash_runner.h
@@ -25,7 +25,13 @@ int Run(); private: - void RunMain(); + // Runs the main process, including the service manager. Returns the exit + // value for the process. + int RunMain(); + + // Runs a background service manager in the main process. Returns the exit + // value for the process. + int RunServiceManagerInMain(); // Returns 0 if the child process was initialized correctly, or error code on // failure. @@ -33,6 +39,7 @@ void StartChildApp(service_manager::mojom::ServiceRequest service_request); + // Context for service manager in the main process. std::unique_ptr<service_manager::ServiceContext> context_; DISALLOW_COPY_AND_ASSIGN(MashRunner);
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 561d9e3..78ebb3d 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -2221,10 +2221,13 @@ #endif // defined(OS_CHROMEOS) #if defined(OS_WIN) - {"gdi-text-printing", IDS_FLAGS_GDI_TEXT_PRINTING, - IDS_FLAGS_GDI_TEXT_PRINTING_DESCRIPTION, kOsWin, - FEATURE_VALUE_TYPE(features::kGdiTextPrinting)} -#endif + {"gdi-text-printing", IDS_FLAGS_GDI_TEXT_PRINTING, + IDS_FLAGS_GDI_TEXT_PRINTING_DESCRIPTION, kOsWin, + FEATURE_VALUE_TYPE(features::kGdiTextPrinting)}, + {"postscript-printing", IDS_FLAGS_POSTSCRIPT_PRINTING, + IDS_FLAGS_POSTSCRIPT_PRINTING_DESCRIPTION, kOsWin, + FEATURE_VALUE_TYPE(features::kPostScriptPrinting)}, +#endif // defined(OS_WIN) #if defined(OS_CHROMEOS) {"show-arc-files-app", IDS_FLAGS_SHOW_ARC_FILES_APP_NAME,
diff --git a/chrome/browser/android/chrome_feature_list.cc b/chrome/browser/android/chrome_feature_list.cc index c2886e3..593b2ca1 100644 --- a/chrome/browser/android/chrome_feature_list.cc +++ b/chrome/browser/android/chrome_feature_list.cc
@@ -54,7 +54,6 @@ &kNTPOfflinePagesFeature, &kNTPSuggestionsStandaloneUIFeature, &kPhysicalWebFeature, - &kPhysicalWebIgnoreOtherClientsFeature, &kSpecialLocaleFeature, &kSpecialLocaleWrapper, &kTabsInCBD, @@ -123,9 +122,6 @@ const base::Feature kPhysicalWebFeature{"PhysicalWeb", base::FEATURE_ENABLED_BY_DEFAULT}; -const base::Feature kPhysicalWebIgnoreOtherClientsFeature{ - "PhysicalWebIgnoreOtherClients", base::FEATURE_DISABLED_BY_DEFAULT}; - const base::Feature kSpecialLocaleFeature{"SpecialLocale", base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/chrome/browser/android/chrome_feature_list.h b/chrome/browser/android/chrome_feature_list.h index 00fff86..c702a3c6 100644 --- a/chrome/browser/android/chrome_feature_list.h +++ b/chrome/browser/android/chrome_feature_list.h
@@ -28,7 +28,6 @@ extern const base::Feature kNTPOfflinePagesFeature; extern const base::Feature kNTPSuggestionsStandaloneUIFeature; extern const base::Feature kPhysicalWebFeature; -extern const base::Feature kPhysicalWebIgnoreOtherClientsFeature; extern const base::Feature kSpecialLocaleFeature; extern const base::Feature kSpecialLocaleWrapper; extern const base::Feature kTabsInCBD;
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc index 638c2e8..d61b3e7 100644 --- a/chrome/browser/browser_about_handler.cc +++ b/chrome/browser/browser_about_handler.cc
@@ -109,7 +109,7 @@ } else if (host == chrome::kChromeUISettingsHost) { if (base::FeatureList::IsEnabled(features::kMaterialDesignSettings)) { return true; // Prevent further rewriting - this is a valid URL. - } else if (::switches::AboutInSettingsEnabled()) { + } else if (::switches::SettingsWindowEnabled()) { host = chrome::kChromeUISettingsFrameHost; } else { host = chrome::kChromeUIUberHost; @@ -119,7 +119,7 @@ } else if (host == chrome::kChromeUIHelpHost) { if (base::FeatureList::IsEnabled(features::kMaterialDesignSettings)) { return false; // Handled in the HandleWebUI handler. - } else if (::switches::AboutInSettingsEnabled()) { + } else if (::switches::SettingsWindowEnabled()) { host = chrome::kChromeUISettingsFrameHost; if (url->path().empty() || url->path() == "/") path = chrome::kChromeUIHelpHost;
diff --git a/chrome/browser/chrome_content_browser_client_browsertest.cc b/chrome/browser/chrome_content_browser_client_browsertest.cc index 4377d8f..fa57c299 100644 --- a/chrome/browser/chrome_content_browser_client_browsertest.cc +++ b/chrome/browser/chrome_content_browser_client_browsertest.cc
@@ -34,7 +34,7 @@ #if defined(OS_CHROMEOS) void SetUpCommandLine(base::CommandLine* command_line) override { - command_line->AppendSwitch(switches::kDisableAboutInSettings); + command_line->AppendSwitch(switches::kDisableSettingsWindow); } #endif };
diff --git a/chrome/browser/chromeos/arc/arc_util_unittest.cc b/chrome/browser/chromeos/arc/arc_util_unittest.cc index 9c7bd6e..7f6d8bc 100644 --- a/chrome/browser/chromeos/arc/arc_util_unittest.cc +++ b/chrome/browser/chromeos/arc/arc_util_unittest.cc
@@ -171,6 +171,7 @@ GetFakeUserManager()->SetUserFlow( manager_id, new chromeos::SupervisedUserCreationFlow(manager_id)); EXPECT_FALSE(IsArcAllowedForProfile(profile())); + GetFakeUserManager()->ResetUserFlow(manager_id); } // TODO(hidehiko): Add test for Ephemeral users. There seems no way to easily
diff --git a/chrome/browser/chromeos/options/DEPS b/chrome/browser/chromeos/options/DEPS index 9ca8436..cc08204 100644 --- a/chrome/browser/chromeos/options/DEPS +++ b/chrome/browser/chromeos/options/DEPS
@@ -1,6 +1,6 @@ include_rules = [ - # TODO(xdai): Remove this DEPS file after layout_delegate.h/cc is moved to a - # better place. + # TODO(xdai): Remove these rules after bugs 687340 and 687349 are fixed. "!chrome/browser/ui/views/harmony/layout_delegate.h", + "!chrome/browser/ui/views/layout_utils.h", ]
diff --git a/chrome/browser/chromeos/options/wifi_config_view.cc b/chrome/browser/chromeos/options/wifi_config_view.cc index 3dc1be8..fc80816 100644 --- a/chrome/browser/chromeos/options/wifi_config_view.cc +++ b/chrome/browser/chromeos/options/wifi_config_view.cc
@@ -15,6 +15,7 @@ #include "chrome/browser/chromeos/options/passphrase_textfield.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/layout_utils.h" #include "chrome/grit/generated_resources.h" #include "chrome/grit/theme_resources.h" #include "chromeos/login/login_state.h" @@ -934,18 +935,8 @@ ParseUIProperty(&passphrase_ui_data_, network, ::onc::wifi::kPassphrase); } - views::GridLayout* layout = new views::GridLayout(this); + views::GridLayout* layout = layout_utils::CreatePanelLayout(this); LayoutDelegate* delegate = LayoutDelegate::Get(); - layout->SetInsets(gfx::Insets( - delegate->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType::PANEL_HORIZ_MARGIN), - delegate->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType::PANEL_VERT_MARGIN), - delegate->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType::BUTTON_VEDGE_MARGIN_NEW), - delegate->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType::BUTTON_HEDGE_MARGIN_NEW))); - this->SetLayoutManager(layout); const int column_view_set_id = 0; views::ColumnSet* column_set = layout->AddColumnSet(column_view_set_id); @@ -955,21 +946,21 @@ column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 1, views::GridLayout::USE_PREF, 0, kLabelMinWidth); column_set->AddPaddingColumn( - 0, delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_HORIZONTAL_SPACING)); + 0, delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING)); // Textfield, combobox. column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, views::GridLayout::USE_PREF, 0, ChildNetworkConfigView::kInputFieldMinWidth); column_set->AddPaddingColumn( - 0, delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_HORIZONTAL_SPACING)); + 0, delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING)); // Password visible button / policy indicator. column_set->AddColumn(views::GridLayout::CENTER, views::GridLayout::FILL, 0, views::GridLayout::FIXED, kPasswordVisibleWidth, 0); column_set->AddPaddingColumn( - 0, delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_HORIZONTAL_SPACING)); + 0, delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING)); // SSID input if (!network || network->type() != shill::kTypeEthernet) { @@ -991,8 +982,8 @@ layout->AddView(label); } layout->AddPaddingRow( - 0, delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_VERTICAL_SPACING)); + 0, delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); } // Security select @@ -1010,8 +1001,8 @@ ChildNetworkConfigView::kInputFieldHeight); layout->AddView(security_combobox_); layout->AddPaddingRow( - 0, delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_VERTICAL_SPACING)); + 0, delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); } // Only enumerate certificates in the data model for 802.1X networks. @@ -1035,8 +1026,8 @@ ChildNetworkConfigView::kInputFieldHeight); layout->AddView(new ControlledSettingIndicatorView(eap_method_ui_data_)); layout->AddPaddingRow( - 0, delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_VERTICAL_SPACING)); + 0, delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); // Phase 2 authentication layout->StartRow(0, column_view_set_id); @@ -1057,8 +1048,8 @@ ChildNetworkConfigView::kInputFieldHeight); layout->AddView(new ControlledSettingIndicatorView(phase_2_auth_ui_data_)); layout->AddPaddingRow( - 0, delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_VERTICAL_SPACING)); + 0, delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); // Server CA certificate layout->StartRow(0, column_view_set_id); @@ -1081,8 +1072,8 @@ layout->AddView( new ControlledSettingIndicatorView(server_ca_cert_ui_data_)); layout->AddPaddingRow( - 0, delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_VERTICAL_SPACING)); + 0, delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); // Subject Match layout->StartRow(0, column_view_set_id); @@ -1097,8 +1088,8 @@ views::GridLayout::FILL, 0, ChildNetworkConfigView::kInputFieldHeight); layout->AddPaddingRow( - 0, delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_VERTICAL_SPACING)); + 0, delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); // User certificate layout->StartRow(0, column_view_set_id); @@ -1117,8 +1108,8 @@ ChildNetworkConfigView::kInputFieldHeight); layout->AddView(new ControlledSettingIndicatorView(user_cert_ui_data_)); layout->AddPaddingRow( - 0, delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_VERTICAL_SPACING)); + 0, delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); // Identity layout->StartRow(0, column_view_set_id); @@ -1135,8 +1126,8 @@ ChildNetworkConfigView::kInputFieldHeight); layout->AddView(new ControlledSettingIndicatorView(identity_ui_data_)); layout->AddPaddingRow( - 0, delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_VERTICAL_SPACING)); + 0, delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); } // Passphrase input @@ -1192,8 +1183,8 @@ } layout->AddPaddingRow( - 0, delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_VERTICAL_SPACING)); + 0, delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); if (show_8021x) { // Anonymous identity @@ -1212,14 +1203,14 @@ layout->AddView( new ControlledSettingIndicatorView(identity_anonymous_ui_data_)); layout->AddPaddingRow( - 0, delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_VERTICAL_SPACING)); + 0, delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); } // We need a little bit more padding before Checkboxes. layout->AddPaddingRow( - 0, delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_VERTICAL_SPACING)); + 0, delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); // Checkboxes. @@ -1247,8 +1238,8 @@ layout->AddView(share_network_checkbox_); } layout->AddPaddingRow( - 0, delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_VERTICAL_SPACING)); + 0, delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); // Create an error label. layout->StartRow(0, column_view_set_id);
diff --git a/chrome/browser/extensions/display_info_provider_chromeos.cc b/chrome/browser/extensions/display_info_provider_chromeos.cc index aba27aa2..8053677 100644 --- a/chrome/browser/extensions/display_info_provider_chromeos.cc +++ b/chrome/browser/extensions/display_info_provider_chromeos.cc
@@ -515,7 +515,7 @@ display::DisplayManager* display_manager = ash::Shell::GetInstance()->display_manager(); display::DisplayLayoutBuilder builder( - display_manager->GetCurrentDisplayLayout()); + display_manager->GetCurrentResolvedDisplayLayout()); bool have_root = false; builder.ClearPlacements(); @@ -626,7 +626,7 @@ DisplayLayoutList result; for (const display::Display& display : displays) { const display::DisplayPlacement placement = - display_manager->GetCurrentDisplayLayout().FindPlacementById( + display_manager->GetCurrentResolvedDisplayLayout().FindPlacementById( display.id()); if (placement.display_id == display::kInvalidDisplayId) continue;
diff --git a/chrome/browser/metrics/chrome_metrics_service_client.cc b/chrome/browser/metrics/chrome_metrics_service_client.cc index d2aa299..7d0e51a 100644 --- a/chrome/browser/metrics/chrome_metrics_service_client.cc +++ b/chrome/browser/metrics/chrome_metrics_service_client.cc
@@ -20,6 +20,7 @@ #include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" #include "base/metrics/persistent_histogram_allocator.h" +#include "base/metrics/statistics_recorder.h" #include "base/path_service.h" #include "base/rand_util.h" #include "base/strings/string16.h" @@ -765,11 +766,6 @@ details->StartFetch(); } -void ChromeMetricsServiceClient::MergeHistogramDeltas() { - DCHECK(GetMetricsService()); - GetMetricsService()->MergeHistogramDeltas(); -} - void ChromeMetricsServiceClient::OnMemoryDetailCollectionDone() { DCHECK(thread_checker_.CalledOnValidThread()); @@ -804,10 +800,8 @@ // Merge histograms from metrics providers into StatisticsRecorder. content::BrowserThread::PostTaskAndReply( - content::BrowserThread::UI, - FROM_HERE, - base::Bind(&ChromeMetricsServiceClient::MergeHistogramDeltas, - weak_ptr_factory_.GetWeakPtr()), + content::BrowserThread::UI, FROM_HERE, + base::Bind(&base::StatisticsRecorder::ImportProvidedHistograms), callback); // Set up the callback task to call after we receive histograms from all
diff --git a/chrome/browser/metrics/chrome_metrics_service_client.h b/chrome/browser/metrics/chrome_metrics_service_client.h index bf7e3b6..11dff40f 100644 --- a/chrome/browser/metrics/chrome_metrics_service_client.h +++ b/chrome/browser/metrics/chrome_metrics_service_client.h
@@ -122,7 +122,6 @@ // Callbacks for various stages of final log info collection. Do not call // these directly. void CollectFinalHistograms(); - void MergeHistogramDeltas(); void OnMemoryDetailCollectionDone(); void OnHistogramSynchronizationDone();
diff --git a/chrome/browser/metrics/subprocess_metrics_provider.cc b/chrome/browser/metrics/subprocess_metrics_provider.cc index d36e847f0..bb5ecca 100644 --- a/chrome/browser/metrics/subprocess_metrics_provider.cc +++ b/chrome/browser/metrics/subprocess_metrics_provider.cc
@@ -30,6 +30,8 @@ SubprocessMetricsProvider::SubprocessMetricsProvider() : scoped_observer_(this), weak_ptr_factory_(this) { + base::StatisticsRecorder::RegisterHistogramProvider( + weak_ptr_factory_.GetWeakPtr()); content::BrowserChildProcessObserver::Add(this); registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CREATED, content::NotificationService::AllBrowserContextsAndSources());
diff --git a/chrome/browser/metrics/subprocess_metrics_provider.h b/chrome/browser/metrics/subprocess_metrics_provider.h index 2bb5bf5..2d753a43 100644 --- a/chrome/browser/metrics/subprocess_metrics_provider.h +++ b/chrome/browser/metrics/subprocess_metrics_provider.h
@@ -11,6 +11,7 @@ #include "base/gtest_prod_util.h" #include "base/id_map.h" #include "base/memory/weak_ptr.h" +#include "base/metrics/statistics_recorder.h" #include "base/scoped_observer.h" #include "base/threading/thread_checker.h" #include "components/metrics/metrics_provider.h" @@ -27,10 +28,12 @@ // memory segments between processes. Merging occurs when a process exits, // when metrics are being collected for upload, or when something else needs // combined metrics (such as the chrome://histograms page). -class SubprocessMetricsProvider : public metrics::MetricsProvider, - public content::BrowserChildProcessObserver, - public content::NotificationObserver, - public content::RenderProcessHostObserver { +class SubprocessMetricsProvider + : public metrics::MetricsProvider, + public base::StatisticsRecorder::HistogramProvider, + public content::BrowserChildProcessObserver, + public content::NotificationObserver, + public content::RenderProcessHostObserver { public: SubprocessMetricsProvider(); ~SubprocessMetricsProvider() override;
diff --git a/chrome/browser/permissions/permission_request_manager.cc b/chrome/browser/permissions/permission_request_manager.cc index 37ceabf..3ef93e58 100644 --- a/chrome/browser/permissions/permission_request_manager.cc +++ b/chrome/browser/permissions/permission_request_manager.cc
@@ -16,7 +16,7 @@ #include "chrome/common/chrome_features.h" #include "chrome/common/chrome_switches.h" #include "content/public/browser/browser_thread.h" -#include "content/public/browser/navigation_details.h" +#include "content/public/browser/navigation_handle.h" #include "content/public/browser/user_metrics.h" #include "url/origin.h" @@ -267,11 +267,13 @@ return nullptr; } -void PermissionRequestManager::DidNavigateMainFrame( - const content::LoadCommittedDetails& details, - const content::FrameNavigateParams& params) { - if (details.is_in_page) +void PermissionRequestManager::DidFinishNavigation( + content::NavigationHandle* navigation_handle) { + if (!navigation_handle->IsInMainFrame() || + !navigation_handle->HasCommitted() || + navigation_handle->IsSamePage()) { return; + } CancelPendingQueues(); FinalizeBubble();
diff --git a/chrome/browser/permissions/permission_request_manager.h b/chrome/browser/permissions/permission_request_manager.h index 0348ab1..2c28ef0 100644 --- a/chrome/browser/permissions/permission_request_manager.h +++ b/chrome/browser/permissions/permission_request_manager.h
@@ -121,9 +121,8 @@ explicit PermissionRequestManager(content::WebContents* web_contents); // WebContentsObserver: - void DidNavigateMainFrame( - const content::LoadCommittedDetails& details, - const content::FrameNavigateParams& params) override; + void DidFinishNavigation( + content::NavigationHandle* navigation_handle) override; void DocumentOnLoadCompletedInMainFrame() override; void DocumentLoadedInFrame( content::RenderFrameHost* render_frame_host) override;
diff --git a/chrome/browser/printing/pdf_to_emf_converter.cc b/chrome/browser/printing/pdf_to_emf_converter.cc index 64dfd014..84a9c21 100644 --- a/chrome/browser/printing/pdf_to_emf_converter.cc +++ b/chrome/browser/printing/pdf_to_emf_converter.cc
@@ -91,6 +91,21 @@ DISALLOW_COPY_AND_ASSIGN(LazyEmf); }; +// Postscript metafile subclass to override SafePlayback. +class PostScriptMetaFile : public LazyEmf { + public: + PostScriptMetaFile(const scoped_refptr<RefCountedTempDir>& temp_dir, + ScopedTempFile file) + : LazyEmf(temp_dir, std::move(file)) {} + ~PostScriptMetaFile() override; + + protected: + // MetafilePlayer: + bool SafePlayback(HDC hdc) const override; + + DISALLOW_COPY_AND_ASSIGN(PostScriptMetaFile); +}; + // Class for converting PDF to another format for printing (Emf, Postscript). // Class uses 3 threads: UI, IO and FILE. // Internal workflow is following: @@ -160,18 +175,20 @@ ~PdfConverterUtilityProcessHostClient() override; + bool OnMessageReceived(const IPC::Message& message) override; + // Helper functions: must be overridden by subclasses // Set the process name - virtual base::string16 GetName() const = 0; + virtual base::string16 GetName() const; // Create a metafileplayer subclass file from a temporary file. virtual std::unique_ptr<MetafilePlayer> GetFileFromTemp( std::unique_ptr<base::File, content::BrowserThread::DeleteOnFileThread> - temp_file) = 0; + temp_file); // Send the messages to Start, GetPage, and Stop. - virtual void SendStartMessage(IPC::PlatformFileForTransit transit) = 0; + virtual void SendStartMessage(IPC::PlatformFileForTransit transit); virtual void SendGetPageMessage(int page_number, - IPC::PlatformFileForTransit transit) = 0; - virtual void SendStopMessage() = 0; + IPC::PlatformFileForTransit transit); + virtual void SendStopMessage(); // Message handlers: void OnPageCount(int page_count); @@ -182,6 +199,10 @@ void OnTempFileReady(GetPageCallbackData* callback_data, ScopedTempFile temp_file); + // Additional message handler needed for Pdf to Emf + void OnPreCacheFontCharacters(const LOGFONT& log_font, + const base::string16& characters); + scoped_refptr<RefCountedTempDir> temp_dir_; // Used to suppress callbacks after PdfConverter is deleted. @@ -199,36 +220,21 @@ // Use containers that keeps element pointers valid after push() and pop(). using GetPageCallbacks = std::queue<GetPageCallbackData>; GetPageCallbacks get_page_callbacks_; + + DISALLOW_COPY_AND_ASSIGN(PdfConverterUtilityProcessHostClient); }; -// Converts PDF into Emf. -class PdfToEmfUtilityProcessHostClient - : public PdfConverterUtilityProcessHostClient { - public: - PdfToEmfUtilityProcessHostClient(base::WeakPtr<PdfConverterImpl> converter, - const PdfRenderSettings& settings) - : PdfConverterUtilityProcessHostClient(converter, settings) {} - - bool OnMessageReceived(const IPC::Message& message) override; - - private: - ~PdfToEmfUtilityProcessHostClient() override; - // Helpers to send messages and set process name - base::string16 GetName() const override; - std::unique_ptr<MetafilePlayer> GetFileFromTemp( - std::unique_ptr<base::File, content::BrowserThread::DeleteOnFileThread> - temp_file) override; - void SendStartMessage(IPC::PlatformFileForTransit transit) override; - void SendGetPageMessage(int page_number, - IPC::PlatformFileForTransit transit) override; - void SendStopMessage() override; - - // Additional message handler needed for Pdf to Emf - void OnPreCacheFontCharacters(const LOGFONT& log_font, - const base::string16& characters); - - DISALLOW_COPY_AND_ASSIGN(PdfToEmfUtilityProcessHostClient); -}; +std::unique_ptr<MetafilePlayer> +PdfConverterUtilityProcessHostClient::GetFileFromTemp( + std::unique_ptr<base::File, content::BrowserThread::DeleteOnFileThread> + temp_file) { + if (settings_.mode == PdfRenderSettings::Mode::POSTSCRIPT_LEVEL2 || + settings_.mode == PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3) { + return base::MakeUnique<PostScriptMetaFile>(temp_dir_, + std::move(temp_file)); + } + return base::MakeUnique<LazyEmf>(temp_dir_, std::move(temp_file)); +} class PdfConverterImpl : public PdfConverter { public: @@ -236,9 +242,13 @@ ~PdfConverterImpl() override; + base::WeakPtr<PdfConverterImpl> GetWeakPtr() { + return weak_ptr_factory_.GetWeakPtr(); + } + void Start(const scoped_refptr<base::RefCountedMemory>& data, const PdfRenderSettings& conversion_settings, - const StartCallback& start_callback) override; + const StartCallback& start_callback); void GetPage(int page_number, const GetPageCallback& get_page_callback) override; @@ -246,29 +256,19 @@ // Helps to cancel callbacks if this object is destroyed. void RunCallback(const base::Closure& callback); - protected: + void Start( + const scoped_refptr<PdfConverterUtilityProcessHostClient>& utility_client, + const scoped_refptr<base::RefCountedMemory>& data, + const StartCallback& start_callback); + + private: scoped_refptr<PdfConverterUtilityProcessHostClient> utility_client_; - private: + base::WeakPtrFactory<PdfConverterImpl> weak_ptr_factory_; + DISALLOW_COPY_AND_ASSIGN(PdfConverterImpl); }; -class PdfToEmfConverterImpl : public PdfConverterImpl { - public: - PdfToEmfConverterImpl(); - - ~PdfToEmfConverterImpl() override; - - void Start(const scoped_refptr<base::RefCountedMemory>& data, - const PdfRenderSettings& conversion_settings, - const StartCallback& start_callback) override; - - private: - base::WeakPtrFactory<PdfToEmfConverterImpl> weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(PdfToEmfConverterImpl); -}; - ScopedTempFile CreateTempFile(scoped_refptr<RefCountedTempDir>* temp_dir) { if (!temp_dir->get()) *temp_dir = new RefCountedTempDir(); @@ -347,6 +347,40 @@ return emf->InitFromData(data.data(), data.size()); } +PostScriptMetaFile::~PostScriptMetaFile() { +} + +bool PostScriptMetaFile::SafePlayback(HDC hdc) const { + // TODO(thestig): Fix destruction of metafiles. For some reasons + // instances of Emf are not deleted. https://crbug.com/260806 + // It's known that the Emf going to be played just once to a printer. So just + // release |file_| before returning. + Emf emf; + if (!LoadEmf(&emf)) { + Close(); + return false; + } + + { + // Ensure enumerator destruction before calling Close() below. + Emf::Enumerator emf_enum(emf, nullptr, nullptr); + for (const Emf::Record& record : emf_enum) { + auto* emf_record = record.record(); + if (emf_record->iType != EMR_GDICOMMENT) + continue; + + const EMRGDICOMMENT* comment = + reinterpret_cast<const EMRGDICOMMENT*>(emf_record); + const char* data = reinterpret_cast<const char*>(comment->Data); + const uint16_t* ptr = reinterpret_cast<const uint16_t*>(data); + int ret = ExtEscape(hdc, PASSTHROUGH, 2 + *ptr, data, 0, nullptr); + DCHECK_EQ(*ptr, ret); + } + } + Close(); + return true; +} + PdfConverterUtilityProcessHostClient::PdfConverterUtilityProcessHostClient( base::WeakPtr<PdfConverterImpl> converter, const PdfRenderSettings& settings) @@ -464,7 +498,7 @@ if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, - base::Bind(&PdfToEmfUtilityProcessHostClient::Stop, this)); + base::Bind(&PdfConverterUtilityProcessHostClient::Stop, this)); return; } SendStopMessage(); @@ -495,10 +529,8 @@ utility_process_host_.reset(); } -// PDF to Emf -PdfToEmfUtilityProcessHostClient::~PdfToEmfUtilityProcessHostClient() {} -void PdfToEmfUtilityProcessHostClient::OnPreCacheFontCharacters( +void PdfConverterUtilityProcessHostClient::OnPreCacheFontCharacters( const LOGFONT& font, const base::string16& str) { // TODO(scottmg): pdf/ppapi still require the renderer to be able to precache @@ -530,10 +562,10 @@ DeleteEnhMetaFile(metafile); } -bool PdfToEmfUtilityProcessHostClient::OnMessageReceived( +bool PdfConverterUtilityProcessHostClient::OnMessageReceived( const IPC::Message& message) { bool handled = true; - IPC_BEGIN_MESSAGE_MAP(PdfToEmfUtilityProcessHostClient, message) + IPC_BEGIN_MESSAGE_MAP(PdfConverterUtilityProcessHostClient, message) IPC_MESSAGE_HANDLER( ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageCount, OnPageCount) IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageDone, @@ -545,42 +577,44 @@ return handled; } -base::string16 PdfToEmfUtilityProcessHostClient::GetName() const { - return l10n_util::GetStringUTF16(IDS_UTILITY_PROCESS_EMF_CONVERTOR_NAME); +base::string16 PdfConverterUtilityProcessHostClient::GetName() const { + return l10n_util::GetStringUTF16(IDS_UTILITY_PROCESS_PDF_CONVERTOR_NAME); } -std::unique_ptr<MetafilePlayer> -PdfToEmfUtilityProcessHostClient::GetFileFromTemp( - std::unique_ptr<base::File, content::BrowserThread::DeleteOnFileThread> - temp_file) { - return base::MakeUnique<LazyEmf>(temp_dir_, std::move(temp_file)); -} - -void PdfToEmfUtilityProcessHostClient::SendGetPageMessage( +void PdfConverterUtilityProcessHostClient::SendGetPageMessage( int page_number, IPC::PlatformFileForTransit transit) { Send(new ChromeUtilityMsg_RenderPDFPagesToMetafiles_GetPage(page_number, transit)); } -void PdfToEmfUtilityProcessHostClient::SendStartMessage( +void PdfConverterUtilityProcessHostClient::SendStartMessage( IPC::PlatformFileForTransit transit) { Send(new ChromeUtilityMsg_RenderPDFPagesToMetafiles(transit, settings_)); } -void PdfToEmfUtilityProcessHostClient::SendStopMessage() { +void PdfConverterUtilityProcessHostClient::SendStopMessage() { Send(new ChromeUtilityMsg_RenderPDFPagesToMetafiles_Stop()); } - +/*void PdfToPostScriptUtilityProcessHostClient::OnPageDone(bool success) { + PdfConverterUtilityProcessHostClient::OnPageDone(success, 0.0f); +} +*/ // Pdf Converter Impl and subclasses -PdfConverterImpl::PdfConverterImpl() {} +PdfConverterImpl::PdfConverterImpl() : weak_ptr_factory_(this) {} -PdfConverterImpl::~PdfConverterImpl() {} +PdfConverterImpl::~PdfConverterImpl() { + if (utility_client_.get()) + utility_client_->Stop(); +} -void PdfConverterImpl::Start(const scoped_refptr<base::RefCountedMemory>& data, - const PdfRenderSettings& conversion_settings, - const StartCallback& start_callback) { - DCHECK(!utility_client_.get()); +void PdfConverterImpl::Start( + const scoped_refptr<PdfConverterUtilityProcessHostClient>& utility_client, + const scoped_refptr<base::RefCountedMemory>& data, + const StartCallback& start_callback) { + DCHECK(!utility_client_); + utility_client_ = utility_client; + utility_client_->Start(data, start_callback); } void PdfConverterImpl::GetPage(int page_number, @@ -593,30 +627,22 @@ callback.Run(); } -PdfToEmfConverterImpl::PdfToEmfConverterImpl() : weak_ptr_factory_(this) {} - -PdfToEmfConverterImpl::~PdfToEmfConverterImpl() { - if (utility_client_.get()) - utility_client_->Stop(); -} - -void PdfToEmfConverterImpl::Start( - const scoped_refptr<base::RefCountedMemory>& data, - const PdfRenderSettings& conversion_settings, - const StartCallback& start_callback) { - DCHECK(!utility_client_.get()); - utility_client_ = new PdfToEmfUtilityProcessHostClient( - weak_ptr_factory_.GetWeakPtr(), conversion_settings); - utility_client_->Start(data, start_callback); -} - } // namespace PdfConverter::~PdfConverter() {} // static -std::unique_ptr<PdfConverter> PdfConverter::CreatePdfToEmfConverter() { - return base::MakeUnique<PdfToEmfConverterImpl>(); +std::unique_ptr<PdfConverter> PdfConverter::StartPdfConverter( + const scoped_refptr<base::RefCountedMemory>& data, + const PdfRenderSettings& conversion_settings, + const StartCallback& start_callback) { + std::unique_ptr<PdfConverterImpl> converter = + base::MakeUnique<PdfConverterImpl>(); + converter->Start( + new PdfConverterUtilityProcessHostClient(converter->GetWeakPtr(), + conversion_settings), + data, start_callback); + return std::move(converter); } } // namespace printing
diff --git a/chrome/browser/printing/pdf_to_emf_converter.h b/chrome/browser/printing/pdf_to_emf_converter.h index 76c9e0a..9990400a 100644 --- a/chrome/browser/printing/pdf_to_emf_converter.h +++ b/chrome/browser/printing/pdf_to_emf_converter.h
@@ -22,16 +22,14 @@ base::Callback<void(int page_number, float scale_factor, std::unique_ptr<MetafilePlayer> file)>; - virtual ~PdfConverter(); - static std::unique_ptr<PdfConverter> CreatePdfToEmfConverter(); - // Starts conversion of PDF provided as |data|. Calls |start_callback| // with positive |page_count|. |page_count| is 0 if initialization failed. - virtual void Start(const scoped_refptr<base::RefCountedMemory>& data, - const PdfRenderSettings& conversion_settings, - const StartCallback& start_callback) = 0; + static std::unique_ptr<PdfConverter> StartPdfConverter( + const scoped_refptr<base::RefCountedMemory>& data, + const PdfRenderSettings& conversion_settings, + const StartCallback& start_callback); // Requests conversion of the page. |page_number| is 0-base page number in // PDF provided in Start() call. @@ -40,7 +38,6 @@ virtual void GetPage(int page_number, const GetPageCallback& get_page_callback) = 0; }; - } // namespace printing #endif // CHROME_BROWSER_PRINTING_PDF_TO_EMF_CONVERTER_H_
diff --git a/chrome/browser/printing/print_job.cc b/chrome/browser/printing/print_job.cc index 294fcb1..5f616b42 100644 --- a/chrome/browser/printing/print_job.cc +++ b/chrome/browser/printing/print_job.cc
@@ -224,20 +224,18 @@ #if defined(OS_WIN) class PrintJob::PdfConversionState { public: - PdfConversionState(gfx::Size page_size, - gfx::Rect content_area, - std::unique_ptr<PdfConverter> converter) + PdfConversionState(gfx::Size page_size, gfx::Rect content_area) : page_count_(0), current_page_(0), pages_in_progress_(0), page_size_(page_size), - content_area_(content_area), - converter_(std::move(converter)) {} + content_area_(content_area) {} void Start(const scoped_refptr<base::RefCountedMemory>& data, const PdfRenderSettings& conversion_settings, const PdfConverter::StartCallback& start_callback) { - converter_->Start(data, conversion_settings, start_callback); + converter_ = PdfConverter::StartPdfConverter( + data, conversion_settings, start_callback); } void GetMorePages(const PdfConverter::GetPageCallback& get_page_callback) { @@ -281,16 +279,14 @@ bool print_text_with_gdi) { DCHECK(!pdf_conversion_state_); pdf_conversion_state_ = - base::MakeUnique<PdfConversionState>(page_size, content_area, - PdfConverter::CreatePdfToEmfConverter()); + base::MakeUnique<PdfConversionState>(page_size, content_area); const int kPrinterDpi = settings().dpi(); PdfRenderSettings settings( - content_area, kPrinterDpi, /*autorotate=*/true, + content_area, gfx::Point(0,0), kPrinterDpi, /*autorotate=*/true, print_text_with_gdi ? PdfRenderSettings::Mode::GDI_TEXT : PdfRenderSettings::Mode::NORMAL); pdf_conversion_state_->Start( - bytes, settings, - base::Bind(&PrintJob::OnPdfConversionStarted, this)); + bytes, settings, base::Bind(&PrintJob::OnPdfConversionStarted, this)); } void PrintJob::OnPdfConversionStarted(int page_count) { @@ -323,6 +319,23 @@ pdf_conversion_state_->GetMorePages( base::Bind(&PrintJob::OnPdfPageConverted, this)); } + +void PrintJob::StartPdfToPostScriptConversion( + const scoped_refptr<base::RefCountedMemory>& bytes, + const gfx::Rect& content_area, + const gfx::Point& physical_offsets, + bool ps_level2) { + DCHECK(!pdf_conversion_state_); + pdf_conversion_state_ = base::MakeUnique<PdfConversionState>( + gfx::Size(), gfx::Rect()); + const int kPrinterDpi = settings().dpi(); + PdfRenderSettings settings( + content_area, physical_offsets, kPrinterDpi, true /* autorotate? */, + ps_level2 ? PdfRenderSettings::Mode::POSTSCRIPT_LEVEL2 + : PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3); + pdf_conversion_state_->Start( + bytes, settings, base::Bind(&PrintJob::OnPdfConversionStarted, this)); +} #endif // defined(OS_WIN) void PrintJob::UpdatePrintedDocument(PrintedDocument* new_document) {
diff --git a/chrome/browser/printing/print_job.h b/chrome/browser/printing/print_job.h index 0dfca6f9..b6a9b5c 100644 --- a/chrome/browser/printing/print_job.h +++ b/chrome/browser/printing/print_job.h
@@ -99,6 +99,12 @@ const gfx::Size& page_size, const gfx::Rect& content_area, bool print_text_with_gdi); + + void StartPdfToPostScriptConversion( + const scoped_refptr<base::RefCountedMemory>& bytes, + const gfx::Rect& content_area, + const gfx::Point& physical_offset, + bool ps_level2); #endif // defined(OS_WIN) protected: @@ -128,7 +134,7 @@ void OnPdfConversionStarted(int page_count); void OnPdfPageConverted(int page_number, float scale_factor, - std::unique_ptr<MetafilePlayer> emf); + std::unique_ptr<MetafilePlayer> metafile); #endif // defined(OS_WIN) content::NotificationRegistrar registrar_;
diff --git a/chrome/browser/printing/print_preview_pdf_generated_browsertest.cc b/chrome/browser/printing/print_preview_pdf_generated_browsertest.cc index 57c64e6..58c1104 100644 --- a/chrome/browser/printing/print_preview_pdf_generated_browsertest.cc +++ b/chrome/browser/printing/print_preview_pdf_generated_browsertest.cc
@@ -50,6 +50,7 @@ #include "printing/pdf_render_settings.h" #include "printing/units.h" #include "ui/gfx/codec/png_codec.h" +#include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/rect.h" #include "url/gurl.h" @@ -370,7 +371,7 @@ total_height_in_pixels += height_in_pixels; gfx::Rect rect(width_in_pixels, height_in_pixels); - PdfRenderSettings settings(rect, kDpi, true, + PdfRenderSettings settings(rect, gfx::Point(0, 0), kDpi, true, PdfRenderSettings::Mode::NORMAL); int int_max = std::numeric_limits<int>::max();
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc index 964aef9d..df47130 100644 --- a/chrome/browser/printing/print_view_manager_base.cc +++ b/chrome/browser/printing/print_view_manager_base.cc
@@ -182,24 +182,39 @@ #if defined(OS_WIN) print_job_->AppendPrintedPage(params.page_number); if (metafile_must_be_valid) { - // TODO(thestig): Figure out why rendering text with GDI results in random - // missing characters for some users. https://crbug.com/658606 - bool print_text_with_gdi = - document->settings().print_text_with_gdi() && - !document->settings().printer_is_xps() && - base::FeatureList::IsEnabled(features::kGdiTextPrinting); scoped_refptr<base::RefCountedBytes> bytes = new base::RefCountedBytes( reinterpret_cast<const unsigned char*>(shared_buf->memory()), params.data_size); - document->DebugDumpData(bytes.get(), FILE_PATH_LITERAL(".pdf")); - print_job_->StartPdfToEmfConversion( - bytes, params.page_size, params.content_area, - print_text_with_gdi); + + const auto& settings = document->settings(); + if ((settings.printer_is_ps2() || settings.printer_is_ps3()) && + base::FeatureList::IsEnabled(features::kPostScriptPrinting)) { + print_job_->StartPdfToPostScriptConversion(bytes, params.content_area, + params.physical_offsets, + settings.printer_is_ps2()); + } else { + // TODO(thestig): Figure out why rendering text with GDI results in random + // missing characters for some users. https://crbug.com/658606 + // Update : The missing letters seem to have been caused by the same + // problem as https://crbug.com/659604 which was resolved. GDI printing + // seems to work with the fix for this bug applied. + bool print_text_with_gdi = settings.print_text_with_gdi() && + !settings.printer_is_xps() && + base::FeatureList::IsEnabled( + features::kGdiTextPrinting); + print_job_->StartPdfToEmfConversion( + bytes, params.page_size, params.content_area, print_text_with_gdi); + } } #else // Update the rendered document. It will send notifications to the listener. - document->SetPage(params.page_number, std::move(metafile), params.page_size, + document->SetPage(params.page_number, + std::move(metafile), +#if defined(OS_WIN) + 0.0f /* dummy shrink_factor */, +#endif + params.page_size, params.content_area); ShouldQuitFromInnerMessageLoop();
diff --git a/chrome/browser/printing/pwg_raster_converter.cc b/chrome/browser/printing/pwg_raster_converter.cc index 4e02959..1636bdd 100644 --- a/chrome/browser/printing/pwg_raster_converter.cc +++ b/chrome/browser/printing/pwg_raster_converter.cc
@@ -301,7 +301,7 @@ // by autorotate. gfx::Rect area(std::min(page_size.width(), page_size.height()) * scale, std::max(page_size.width(), page_size.height()) * scale); - return PdfRenderSettings(area, dpi, /*autorotate=*/true, + return PdfRenderSettings(area, gfx::Point(0,0), dpi, /*autorotate=*/true, PdfRenderSettings::Mode::NORMAL); }
diff --git a/chrome/browser/printing/pwg_raster_converter.h b/chrome/browser/printing/pwg_raster_converter.h index c7d6998..4a975ee 100644 --- a/chrome/browser/printing/pwg_raster_converter.h +++ b/chrome/browser/printing/pwg_raster_converter.h
@@ -9,6 +9,7 @@ #include "base/callback.h" #include "base/memory/ref_counted_memory.h" +#include "printing/pdf_render_settings.h" namespace base { class FilePath;
diff --git a/chrome/browser/resources/options/browser_options.js b/chrome/browser/resources/options/browser_options.js index 82ca7dd1..96283c3d 100644 --- a/chrome/browser/resources/options/browser_options.js +++ b/chrome/browser/resources/options/browser_options.js
@@ -197,7 +197,7 @@ $('advanced-settings').addEventListener('webkitTransitionEnd', this.updateAdvancedSettingsExpander_.bind(this)); - if (loadTimeData.getBoolean('showAbout')) { + if (loadTimeData.valueExists('aboutOverlayTabTitle')) { $('about-button').hidden = false; $('about-button').addEventListener('click', function() { PageManager.showPageByName('help');
diff --git a/chrome/browser/resources/options/options.js b/chrome/browser/resources/options/options.js index 4ec7806c..821d7ea 100644 --- a/chrome/browser/resources/options/options.js +++ b/chrome/browser/resources/options/options.js
@@ -182,7 +182,7 @@ BrowserOptions.getInstance()); // </if> - if (loadTimeData.getBoolean('showAbout')) { + if (loadTimeData.valueExists('aboutOverlayTabTitle')) { PageManager.registerOverlay(help.HelpPage.getInstance(), BrowserOptions.getInstance()); if (help.ChannelChangePage) {
diff --git a/chrome/browser/resources/settings/a11y_page/a11y_page.html b/chrome/browser/resources/settings/a11y_page/a11y_page.html index 808671a..1d4e3dd 100644 --- a/chrome/browser/resources/settings/a11y_page/a11y_page.html +++ b/chrome/browser/resources/settings/a11y_page/a11y_page.html
@@ -1,14 +1,14 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../settings_shared_css.html"> <if expr="chromeos"> <link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-animatable.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-toggle-button/paper-toggle-button.html"> -<link rel="import" href="/a11y_page/manage_a11y_page.html"> -<link rel="import" href="/settings_page/settings_animated_pages.html"> -<link rel="import" href="/settings_page/settings_subpage.html"> +<link rel="import" href="manage_a11y_page.html"> +<link rel="import" href="../settings_page/settings_animated_pages.html"> +<link rel="import" href="../settings_page/settings_subpage.html"> </if> <dom-module id="settings-a11y-page">
diff --git a/chrome/browser/resources/settings/a11y_page/manage_a11y_page.html b/chrome/browser/resources/settings/a11y_page/manage_a11y_page.html index 3ae34bf..993090b 100644 --- a/chrome/browser/resources/settings/a11y_page/manage_a11y_page.html +++ b/chrome/browser/resources/settings/a11y_page/manage_a11y_page.html
@@ -1,10 +1,10 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> -<link rel="import" href="/controls/settings_toggle_button.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/settings_vars_css.html"> +<link rel="import" href="../controls/settings_toggle_button.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="../settings_vars_css.html"> <dom-module id="settings-manage-a11y-page"> <template>
diff --git a/chrome/browser/resources/settings/about_page/about_page.html b/chrome/browser/resources/settings/about_page/about_page.html index 1c124b8c..b3005df 100644 --- a/chrome/browser/resources/settings/about_page/about_page.html +++ b/chrome/browser/resources/settings/about_page/about_page.html
@@ -1,14 +1,14 @@ <link rel="import" href="chrome://resources/html/polymer.html"> -<link rel="import" href="/about_page/about_page_browser_proxy.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/icons.html"> -<link rel="import" href="/lifetime_browser_proxy.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_page/main_page_behavior.html"> -<link rel="import" href="/settings_page/settings_animated_pages.html"> -<link rel="import" href="/settings_page/settings_section.html"> -<link rel="import" href="/settings_page_css.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="about_page_browser_proxy.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../icons.html"> +<link rel="import" href="../lifetime_browser_proxy.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_page/main_page_behavior.html"> +<link rel="import" href="../settings_page/settings_animated_pages.html"> +<link rel="import" href="../settings_page/settings_section.html"> +<link rel="import" href="../settings_page_css.html"> +<link rel="import" href="../settings_shared_css.html"> <link rel="import" href="chrome://resources/cr_elements/icons.html"> <link rel="import" href="chrome://resources/html/assert.html"> <link rel="import" href="chrome://resources/html/i18n_behavior.html"> @@ -18,8 +18,8 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <if expr="chromeos"> -<link rel="import" href="/about_page/detailed_build_info.html"> -<link rel="import" href="/settings_page/settings_subpage.html"> +<link rel="import" href="detailed_build_info.html"> +<link rel="import" href="../settings_page/settings_subpage.html"> </if> <if expr="_google_chrome and is_macosx">
diff --git a/chrome/browser/resources/settings/about_page/channel_switcher_dialog.html b/chrome/browser/resources/settings/about_page/channel_switcher_dialog.html index 479f2f0..bcb5b9a0 100644 --- a/chrome/browser/resources/settings/about_page/channel_switcher_dialog.html +++ b/chrome/browser/resources/settings/about_page/channel_switcher_dialog.html
@@ -4,8 +4,8 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-radio-button/paper-radio-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-radio-group/paper-radio-group.html"> -<link rel="import" href="/about_page/about_page_browser_proxy.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="about_page_browser_proxy.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-channel-switcher-dialog"> <template>
diff --git a/chrome/browser/resources/settings/about_page/detailed_build_info.html b/chrome/browser/resources/settings/about_page/detailed_build_info.html index 5ac6d63..ee8be1c 100644 --- a/chrome/browser/resources/settings/about_page/detailed_build_info.html +++ b/chrome/browser/resources/settings/about_page/detailed_build_info.html
@@ -1,8 +1,8 @@ <link rel="import" href="chrome://resources/html/polymer.html"> -<link rel="import" href="/about_page/about_page_browser_proxy.html"> -<link rel="import" href="/about_page/channel_switcher_dialog.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="about_page_browser_proxy.html"> +<link rel="import" href="channel_switcher_dialog.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../settings_shared_css.html"> <link rel="import" href="chrome://resources/cr_elements/icons.html"> <link rel="import" href="chrome://resources/html/i18n_behavior.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
diff --git a/chrome/browser/resources/settings/android_apps_page/android_apps_page.html b/chrome/browser/resources/settings/android_apps_page/android_apps_page.html index 6843f2f..9a38e20 100644 --- a/chrome/browser/resources/settings/android_apps_page/android_apps_page.html +++ b/chrome/browser/resources/settings/android_apps_page/android_apps_page.html
@@ -1,11 +1,11 @@ <link rel="import" href="chrome://resources/html/i18n_behavior.html"> <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> -<link rel="import" href="/android_apps_page/android_apps_browser_proxy.html"> -<link rel="import" href="/controls/settings_toggle_button.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/prefs/prefs_behavior.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="android_apps_browser_proxy.html"> +<link rel="import" href="../controls/settings_toggle_button.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../prefs/prefs_behavior.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-android-apps-page"> <template>
diff --git a/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html b/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html index fcb43a65..d1d2345 100644 --- a/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html +++ b/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html
@@ -3,10 +3,10 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> -<link rel="import" href="/appearance_page/fonts_browser_proxy.html"> -<link rel="import" href="/controls/settings_dropdown_menu.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="fonts_browser_proxy.html"> +<link rel="import" href="../controls/settings_dropdown_menu.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-appearance-fonts-page"> <template>
diff --git a/chrome/browser/resources/settings/appearance_page/appearance_page.html b/chrome/browser/resources/settings/appearance_page/appearance_page.html index 3cb9b8f..4d84842 100644 --- a/chrome/browser/resources/settings/appearance_page/appearance_page.html +++ b/chrome/browser/resources/settings/appearance_page/appearance_page.html
@@ -5,18 +5,18 @@ <link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-animatable.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> -<link rel="import" href="/appearance_page/appearance_browser_proxy.html"> -<link rel="import" href="/controls/controlled_radio_button.html"> -<link rel="import" href="/controls/extension_controlled_indicator.html"> -<link rel="import" href="/controls/settings_dropdown_menu.html"> -<link rel="import" href="/controls/settings_input.html"> -<link rel="import" href="/controls/settings_radio_group.html"> -<link rel="import" href="/controls/settings_toggle_button.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_page/settings_animated_pages.html"> -<link rel="import" href="/settings_page/settings_subpage.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/settings_vars_css.html"> +<link rel="import" href="appearance_browser_proxy.html"> +<link rel="import" href="../controls/controlled_radio_button.html"> +<link rel="import" href="../controls/extension_controlled_indicator.html"> +<link rel="import" href="../controls/settings_dropdown_menu.html"> +<link rel="import" href="../controls/settings_input.html"> +<link rel="import" href="../controls/settings_radio_group.html"> +<link rel="import" href="../controls/settings_toggle_button.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_page/settings_animated_pages.html"> +<link rel="import" href="../settings_page/settings_subpage.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="../settings_vars_css.html"> <link rel="import" href="appearance_fonts_page.html"> <dom-module id="settings-appearance-page">
diff --git a/chrome/browser/resources/settings/basic_page/basic_page.html b/chrome/browser/resources/settings/basic_page/basic_page.html index 51554a1e..d56f44b1 100644 --- a/chrome/browser/resources/settings/basic_page/basic_page.html +++ b/chrome/browser/resources/settings/basic_page/basic_page.html
@@ -1,33 +1,33 @@ <link rel="import" href="chrome://resources/html/polymer.html"> -<link rel="import" href="/a11y_page/a11y_page.html"> -<link rel="import" href="/appearance_page/appearance_page.html"> -<link rel="import" href="/downloads_page/downloads_page.html"> -<link rel="import" href="/languages_page/languages_page.html"> -<link rel="import" href="/on_startup_page/on_startup_page.html"> -<link rel="import" href="/passwords_and_forms_page/passwords_and_forms_page.html"> -<link rel="import" href="/people_page/people_page.html"> -<link rel="import" href="/printing_page/printing_page.html"> -<link rel="import" href="/privacy_page/privacy_page.html"> -<link rel="import" href="/reset_page/reset_page.html"> -<link rel="import" href="/reset_page/reset_profile_banner.html"> -<link rel="import" href="/search_page/search_page.html"> -<link rel="import" href="/settings_page/main_page_behavior.html"> -<link rel="import" href="/settings_page/settings_page_visibility.html"> -<link rel="import" href="/settings_page/settings_section.html"> -<link rel="import" href="/settings_page_css.html"> -<link rel="import" href="/settings_vars_css.html"> +<link rel="import" href="../a11y_page/a11y_page.html"> +<link rel="import" href="../appearance_page/appearance_page.html"> +<link rel="import" href="../downloads_page/downloads_page.html"> +<link rel="import" href="../languages_page/languages_page.html"> +<link rel="import" href="../on_startup_page/on_startup_page.html"> +<link rel="import" href="../passwords_and_forms_page/passwords_and_forms_page.html"> +<link rel="import" href="../people_page/people_page.html"> +<link rel="import" href="../printing_page/printing_page.html"> +<link rel="import" href="../privacy_page/privacy_page.html"> +<link rel="import" href="../reset_page/reset_page.html"> +<link rel="import" href="../reset_page/reset_profile_banner.html"> +<link rel="import" href="../search_page/search_page.html"> +<link rel="import" href="../settings_page/main_page_behavior.html"> +<link rel="import" href="../settings_page/settings_page_visibility.html"> +<link rel="import" href="../settings_page/settings_section.html"> +<link rel="import" href="../settings_page_css.html"> +<link rel="import" href="../settings_vars_css.html"> <if expr="chromeos"> -<link rel="import" href="/android_apps_page/android_apps_page.html"> -<link rel="import" href="/bluetooth_page/bluetooth_page.html"> -<link rel="import" href="/date_time_page/date_time_page.html"> -<link rel="import" href="/device_page/device_page.html"> -<link rel="import" href="/internet_page/internet_page.html"> +<link rel="import" href="../android_apps_page/android_apps_page.html"> +<link rel="import" href="../bluetooth_page/bluetooth_page.html"> +<link rel="import" href="../date_time_page/date_time_page.html"> +<link rel="import" href="../device_page/device_page.html"> +<link rel="import" href="../internet_page/internet_page.html"> </if> <if expr="not chromeos"> -<link rel="import" href="/default_browser_page/default_browser_page.html"> -<link rel="import" href="/system_page/system_page.html"> +<link rel="import" href="../default_browser_page/default_browser_page.html"> +<link rel="import" href="../system_page/system_page.html"> </if> <!-- TODO(michaelpg): Rename to something better than "basic" now that this page
diff --git a/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_dialog.html b/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_dialog.html index 94f0df2..bb110e8 100644 --- a/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_dialog.html +++ b/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_dialog.html
@@ -7,8 +7,8 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner.html"> -<link rel="import" href="/bluetooth_page/bluetooth_device_list_item.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../bluetooth_page/bluetooth_device_list_item.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="bluetooth-device-dialog"> <template>
diff --git a/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.html b/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.html index 07766b11..396b7bcc 100644 --- a/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.html +++ b/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.html
@@ -5,7 +5,7 @@ <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classes/iron-flex-layout.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="bluetooth-device-list-item"> <style include="settings-shared">
diff --git a/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.html b/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.html index 74de61b..6ce436e8 100644 --- a/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.html +++ b/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.html
@@ -4,11 +4,11 @@ <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classes/iron-flex-layout.html"> <link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-animatable.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> -<link rel="import" href="/icons.html"> -<link rel="import" href="/prefs/prefs.html"> -<link rel="import" href="/settings_page/settings_animated_pages.html"> -<link rel="import" href="/settings_page/settings_subpage.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../icons.html"> +<link rel="import" href="../prefs/prefs.html"> +<link rel="import" href="../settings_page/settings_animated_pages.html"> +<link rel="import" href="../settings_page/settings_subpage.html"> +<link rel="import" href="../settings_shared_css.html"> <link rel="import" href="bluetooth_subpage.html"> <dom-module id="settings-bluetooth-page">
diff --git a/chrome/browser/resources/settings/certificate_manager_page/ca_trust_edit_dialog.html b/chrome/browser/resources/settings/certificate_manager_page/ca_trust_edit_dialog.html index 28365763..d8e1a23 100644 --- a/chrome/browser/resources/settings/certificate_manager_page/ca_trust_edit_dialog.html +++ b/chrome/browser/resources/settings/certificate_manager_page/ca_trust_edit_dialog.html
@@ -3,9 +3,9 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-checkbox/paper-checkbox.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/certificate_manager_page/certificates_browser_proxy.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="certificates_browser_proxy.html"> <dom-module id="settings-ca-trust-edit-dialog"> <template>
diff --git a/chrome/browser/resources/settings/certificate_manager_page/certificate_delete_confirmation_dialog.html b/chrome/browser/resources/settings/certificate_manager_page/certificate_delete_confirmation_dialog.html index 81dd358..b20af21 100644 --- a/chrome/browser/resources/settings/certificate_manager_page/certificate_delete_confirmation_dialog.html +++ b/chrome/browser/resources/settings/certificate_manager_page/certificate_delete_confirmation_dialog.html
@@ -1,9 +1,9 @@ <link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html"> <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/certificate_manager_page/certificates_browser_proxy.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="certificates_browser_proxy.html"> <dom-module id="settings-certificate-delete-confirmation-dialog"> <template>
diff --git a/chrome/browser/resources/settings/certificate_manager_page/certificate_entry.html b/chrome/browser/resources/settings/certificate_manager_page/certificate_entry.html index 9620696..ee0f93a 100644 --- a/chrome/browser/resources/settings/certificate_manager_page/certificate_entry.html +++ b/chrome/browser/resources/settings/certificate_manager_page/certificate_entry.html
@@ -1,9 +1,9 @@ <link rel="import" href="chrome://resources/html/polymer.html"> -<link rel="import" href="/certificate_manager_page/certificates_browser_proxy.html"> <link rel="import" href="chrome://resources/cr_elements/cr_expand_button/cr_expand_button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-collapse/iron-collapse.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/certificate_manager_page/certificate_subentry.html"> +<link rel="import" href="certificates_browser_proxy.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="certificate_subentry.html"> <dom-module id="settings-certificate-entry"> <template>
diff --git a/chrome/browser/resources/settings/certificate_manager_page/certificate_list.html b/chrome/browser/resources/settings/certificate_manager_page/certificate_list.html index 08343d4..77a75f1f 100644 --- a/chrome/browser/resources/settings/certificate_manager_page/certificate_list.html +++ b/chrome/browser/resources/settings/certificate_manager_page/certificate_list.html
@@ -1,11 +1,11 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/assert.html"> <link rel="import" href="chrome://resources/html/i18n_behavior.html"> -<link rel="import" href="/certificate_manager_page/certificate_entry.html"> -<link rel="import" href="/certificate_manager_page/certificate_manager_types.html"> -<link rel="import" href="/certificate_manager_page/certificates_browser_proxy.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="certificate_entry.html"> +<link rel="import" href="certificate_manager_types.html"> +<link rel="import" href="certificates_browser_proxy.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-certificate-list"> <template>
diff --git a/chrome/browser/resources/settings/certificate_manager_page/certificate_manager_page.html b/chrome/browser/resources/settings/certificate_manager_page/certificate_manager_page.html index 029eddf..c6f01a1 100644 --- a/chrome/browser/resources/settings/certificate_manager_page/certificate_manager_page.html +++ b/chrome/browser/resources/settings/certificate_manager_page/certificate_manager_page.html
@@ -2,14 +2,14 @@ <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-tabs/paper-tabs.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-pages/iron-pages.html"> -<link rel="import" href="/certificate_manager_page/ca_trust_edit_dialog.html"> -<link rel="import" href="/certificate_manager_page/certificate_delete_confirmation_dialog.html"> -<link rel="import" href="/certificate_manager_page/certificate_list.html"> -<link rel="import" href="/certificate_manager_page/certificate_manager_types.html"> -<link rel="import" href="/certificate_manager_page/certificate_password_decryption_dialog.html"> -<link rel="import" href="/certificate_manager_page/certificate_password_encryption_dialog.html"> -<link rel="import" href="/certificate_manager_page/certificates_browser_proxy.html"> -<link rel="import" href="/certificate_manager_page/certificates_error_dialog.html"> +<link rel="import" href="ca_trust_edit_dialog.html"> +<link rel="import" href="certificate_delete_confirmation_dialog.html"> +<link rel="import" href="certificate_list.html"> +<link rel="import" href="certificate_manager_types.html"> +<link rel="import" href="certificate_password_decryption_dialog.html"> +<link rel="import" href="certificate_password_encryption_dialog.html"> +<link rel="import" href="certificates_browser_proxy.html"> +<link rel="import" href="certificates_error_dialog.html"> <dom-module id="settings-certificate-manager-page"> <template>
diff --git a/chrome/browser/resources/settings/certificate_manager_page/certificate_password_decryption_dialog.html b/chrome/browser/resources/settings/certificate_manager_page/certificate_password_decryption_dialog.html index 5d36e7e1..1d5716fc 100644 --- a/chrome/browser/resources/settings/certificate_manager_page/certificate_password_decryption_dialog.html +++ b/chrome/browser/resources/settings/certificate_manager_page/certificate_password_decryption_dialog.html
@@ -2,9 +2,9 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/certificate_manager_page/certificates_browser_proxy.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="certificates_browser_proxy.html"> <dom-module id="settings-certificate-password-decryption-dialog"> <template>
diff --git a/chrome/browser/resources/settings/certificate_manager_page/certificate_password_encryption_dialog.html b/chrome/browser/resources/settings/certificate_manager_page/certificate_password_encryption_dialog.html index c4489fd..6b3c4bd7 100644 --- a/chrome/browser/resources/settings/certificate_manager_page/certificate_password_encryption_dialog.html +++ b/chrome/browser/resources/settings/certificate_manager_page/certificate_password_encryption_dialog.html
@@ -2,9 +2,9 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/certificate_manager_page/certificates_browser_proxy.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="certificates_browser_proxy.html"> <dom-module id="settings-certificate-password-encryption-dialog"> <template>
diff --git a/chrome/browser/resources/settings/certificate_manager_page/certificate_subentry.html b/chrome/browser/resources/settings/certificate_manager_page/certificate_subentry.html index 5295615..fb238c7 100644 --- a/chrome/browser/resources/settings/certificate_manager_page/certificate_subentry.html +++ b/chrome/browser/resources/settings/certificate_manager_page/certificate_subentry.html
@@ -3,9 +3,9 @@ <link rel="import" href="chrome://resources/cr_elements/cr_lazy_render/cr_lazy_render.html"> <link rel="import" href="chrome://resources/cr_elements/icons.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html"> -<link rel="import" href="/certificate_manager_page/certificate_manager_types.html"> -<link rel="import" href="/certificate_manager_page/certificates_browser_proxy.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="certificate_manager_types.html"> +<link rel="import" href="certificates_browser_proxy.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-certificate-subentry"> <template>
diff --git a/chrome/browser/resources/settings/certificate_manager_page/certificates_error_dialog.html b/chrome/browser/resources/settings/certificate_manager_page/certificates_error_dialog.html index 6c575926..0b5f094 100644 --- a/chrome/browser/resources/settings/certificate_manager_page/certificates_error_dialog.html +++ b/chrome/browser/resources/settings/certificate_manager_page/certificates_error_dialog.html
@@ -1,8 +1,8 @@ <link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html"> <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-certificates-error-dialog"> <template>
diff --git a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.html b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.html index 1239d76..d861555 100644 --- a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.html +++ b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.html
@@ -3,13 +3,13 @@ <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/clear_browsing_data_dialog/clear_browsing_data_browser_proxy.html"> -<link rel="import" href="/clear_browsing_data_dialog/history_deletion_dialog.html"> -<link rel="import" href="/controls/settings_checkbox.html"> -<link rel="import" href="/controls/settings_dropdown_menu.html"> -<link rel="import" href="/icons.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="clear_browsing_data_browser_proxy.html"> +<link rel="import" href="history_deletion_dialog.html"> +<link rel="import" href="../controls/settings_checkbox.html"> +<link rel="import" href="../controls/settings_dropdown_menu.html"> +<link rel="import" href="../icons.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-clear-browsing-data-dialog"> <template>
diff --git a/chrome/browser/resources/settings/clear_browsing_data_dialog/history_deletion_dialog.html b/chrome/browser/resources/settings/clear_browsing_data_dialog/history_deletion_dialog.html index 42eb7e9..35df0f3 100644 --- a/chrome/browser/resources/settings/clear_browsing_data_dialog/history_deletion_dialog.html +++ b/chrome/browser/resources/settings/clear_browsing_data_dialog/history_deletion_dialog.html
@@ -1,6 +1,6 @@ <link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html"> <link rel="import" href="chrome://resources/html/polymer.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-history-deletion-dialog"> <template>
diff --git a/chrome/browser/resources/settings/controls/controlled_button.html b/chrome/browser/resources/settings/controls/controlled_button.html index 3f13f70..7f4e69d4 100644 --- a/chrome/browser/resources/settings/controls/controlled_button.html +++ b/chrome/browser/resources/settings/controls/controlled_button.html
@@ -4,9 +4,9 @@ <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_indicator_behavior.html"> <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_behavior.html"> <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_indicator.html"> -<link rel="import" href="/controls/pref_control_behavior.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="pref_control_behavior.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="controlled-button"> <template>
diff --git a/chrome/browser/resources/settings/controls/controlled_radio_button.html b/chrome/browser/resources/settings/controls/controlled_radio_button.html index 6440dd85..7631de20 100644 --- a/chrome/browser/resources/settings/controls/controlled_radio_button.html +++ b/chrome/browser/resources/settings/controls/controlled_radio_button.html
@@ -1,9 +1,9 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-radio-button/paper-radio-button.html"> <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_indicator.html"> -<link rel="import" href="/controls/pref_control_behavior.html"> -<link rel="import" href="/prefs/pref_util.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="pref_control_behavior.html"> +<link rel="import" href="../prefs/pref_util.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="controlled-radio-button"> <template>
diff --git a/chrome/browser/resources/settings/controls/extension_controlled_indicator.html b/chrome/browser/resources/settings/controls/extension_controlled_indicator.html index e67aee5f..1d9f520 100644 --- a/chrome/browser/resources/settings/controls/extension_controlled_indicator.html +++ b/chrome/browser/resources/settings/controls/extension_controlled_indicator.html
@@ -1,9 +1,9 @@ <link rel="import" href="chrome://resources/html/i18n_behavior.html"> <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> -<link rel="import" href="/extension_control_browser_proxy.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../extension_control_browser_proxy.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="extension-controlled-indicator"> <template>
diff --git a/chrome/browser/resources/settings/controls/pref_control_behavior.html b/chrome/browser/resources/settings/controls/pref_control_behavior.html index facdfad..d350813 100644 --- a/chrome/browser/resources/settings/controls/pref_control_behavior.html +++ b/chrome/browser/resources/settings/controls/pref_control_behavior.html
@@ -1,3 +1,3 @@ <link rel="import" href="chrome://resources/html/polymer.html"> -<link rel="import" href="/prefs/prefs_types.html"> +<link rel="import" href="../prefs/prefs_types.html"> <script src="pref_control_behavior.js"></script>
diff --git a/chrome/browser/resources/settings/controls/settings_boolean_control_behavior.html b/chrome/browser/resources/settings/controls/settings_boolean_control_behavior.html index 836d1b7..2311a10 100644 --- a/chrome/browser/resources/settings/controls/settings_boolean_control_behavior.html +++ b/chrome/browser/resources/settings/controls/settings_boolean_control_behavior.html
@@ -2,5 +2,5 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_behavior.html"> <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_indicator.html"> -<link rel="import" href="/controls/pref_control_behavior.html"> +<link rel="import" href="pref_control_behavior.html"> <script src="settings_boolean_control_behavior.js"></script>
diff --git a/chrome/browser/resources/settings/controls/settings_checkbox.html b/chrome/browser/resources/settings/controls/settings_checkbox.html index bda1045..9f4ae7b9 100644 --- a/chrome/browser/resources/settings/controls/settings_checkbox.html +++ b/chrome/browser/resources/settings/controls/settings_checkbox.html
@@ -1,7 +1,7 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-checkbox/paper-checkbox.html"> -<link rel="import" href="/controls/settings_boolean_control_behavior.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="settings_boolean_control_behavior.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-checkbox"> <template>
diff --git a/chrome/browser/resources/settings/controls/settings_dropdown_menu.html b/chrome/browser/resources/settings/controls/settings_dropdown_menu.html index b98a5578..6659294f 100644 --- a/chrome/browser/resources/settings/controls/settings_dropdown_menu.html +++ b/chrome/browser/resources/settings/controls/settings_dropdown_menu.html
@@ -1,10 +1,10 @@ <link rel="import" href="chrome://resources/html/md_select_css.html"> <link rel="import" href="chrome://resources/html/polymer.html"> -<link rel="import" href="/controls/pref_control_behavior.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/prefs/pref_util.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/settings_vars_css.html"> +<link rel="import" href="pref_control_behavior.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../prefs/pref_util.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="../settings_vars_css.html"> <dom-module id="settings-dropdown-menu"> <template>
diff --git a/chrome/browser/resources/settings/controls/settings_input.html b/chrome/browser/resources/settings/controls/settings_input.html index 77254c5..f6162561 100644 --- a/chrome/browser/resources/settings/controls/settings_input.html +++ b/chrome/browser/resources/settings/controls/settings_input.html
@@ -3,7 +3,7 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html"> <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_behavior.html"> <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_indicator.html"> -<link rel="import" href="/controls/pref_control_behavior.html"> +<link rel="import" href="pref_control_behavior.html"> <dom-module id="settings-input"> <template>
diff --git a/chrome/browser/resources/settings/controls/settings_radio_group.html b/chrome/browser/resources/settings/controls/settings_radio_group.html index 3b1d877..f837e59 100644 --- a/chrome/browser/resources/settings/controls/settings_radio_group.html +++ b/chrome/browser/resources/settings/controls/settings_radio_group.html
@@ -1,9 +1,9 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-radio-group/paper-radio-group.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-radio-button/paper-radio-button.html"> -<link rel="import" href="/controls/pref_control_behavior.html"> -<link rel="import" href="/prefs/pref_util.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="pref_control_behavior.html"> +<link rel="import" href="../prefs/pref_util.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-radio-group"> <style include="settings-shared"></style>
diff --git a/chrome/browser/resources/settings/controls/settings_toggle_button.html b/chrome/browser/resources/settings/controls/settings_toggle_button.html index add7e52..d98765a 100644 --- a/chrome/browser/resources/settings/controls/settings_toggle_button.html +++ b/chrome/browser/resources/settings/controls/settings_toggle_button.html
@@ -1,7 +1,7 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-toggle-button/paper-toggle-button.html"> -<link rel="import" href="/controls/settings_boolean_control_behavior.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="settings_boolean_control_behavior.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-toggle-button"> <template> @@ -39,10 +39,13 @@ <div id="outerRow" noSubLabel$="[[!subLabel]]"> <div class="flex" on-tap="onLabelWrapperTap_" actionable$="[[!controlDisabled_(disabled, pref)]]"> - <div class="label">[[label]]</div> + <div class="label"> + [[label]] + <content select=".label-controls"></content> + </div> <div class="secondary label">[[subLabel]]</div> </div> - <content selector=".more-actions"></content> + <content select=".more-actions"></content> <template is="dom-if" if="[[pref.controlledBy]]"> <cr-policy-pref-indicator pref="[[pref]]"></cr-policy-pref-indicator> </template>
diff --git a/chrome/browser/resources/settings/date_time_page/date_time_page.html b/chrome/browser/resources/settings/date_time_page/date_time_page.html index d5862c7..a85f2b62 100644 --- a/chrome/browser/resources/settings/date_time_page/date_time_page.html +++ b/chrome/browser/resources/settings/date_time_page/date_time_page.html
@@ -3,12 +3,12 @@ <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-toggle-button/paper-toggle-button.html"> -<link rel="import" href="/controls/settings_dropdown_menu.html"> -<link rel="import" href="/controls/settings_toggle_button.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/prefs/prefs_behavior.html"> -<link rel="import" href="/prefs/prefs_types.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../controls/settings_dropdown_menu.html"> +<link rel="import" href="../controls/settings_toggle_button.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../prefs/prefs_behavior.html"> +<link rel="import" href="../prefs/prefs_types.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-date-time-page"> <template>
diff --git a/chrome/browser/resources/settings/default_browser_page/default_browser_page.html b/chrome/browser/resources/settings/default_browser_page/default_browser_page.html index 52a00ca..2e13315 100644 --- a/chrome/browser/resources/settings/default_browser_page/default_browser_page.html +++ b/chrome/browser/resources/settings/default_browser_page/default_browser_page.html
@@ -1,8 +1,8 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> -<link rel="import" href="/default_browser_page/default_browser_browser_proxy.html"> -<link rel="import" href="/icons.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="default_browser_browser_proxy.html"> +<link rel="import" href="../icons.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-default-browser-page"> <template>
diff --git a/chrome/browser/resources/settings/device_page/device_page.html b/chrome/browser/resources/settings/device_page/device_page.html index e12ef3b6..e50598a 100644 --- a/chrome/browser/resources/settings/device_page/device_page.html +++ b/chrome/browser/resources/settings/device_page/device_page.html
@@ -5,18 +5,18 @@ <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> <link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-animatable.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> -<link rel="import" href="/device_page/device_page_browser_proxy.html"> -<link rel="import" href="/device_page/display.html"> -<link rel="import" href="/device_page/keyboard.html"> -<link rel="import" href="/device_page/pointers.html"> -<link rel="import" href="/device_page/storage.html"> -<link rel="import" href="/device_page/stylus.html"> -<link rel="import" href="/icons.html"> -<link rel="import" href="/prefs/prefs.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_page/settings_animated_pages.html"> -<link rel="import" href="/settings_page/settings_subpage.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="device_page_browser_proxy.html"> +<link rel="import" href="display.html"> +<link rel="import" href="keyboard.html"> +<link rel="import" href="pointers.html"> +<link rel="import" href="storage.html"> +<link rel="import" href="stylus.html"> +<link rel="import" href="../icons.html"> +<link rel="import" href="../prefs/prefs.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_page/settings_animated_pages.html"> +<link rel="import" href="../settings_page/settings_subpage.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-device-page"> <template>
diff --git a/chrome/browser/resources/settings/device_page/display.html b/chrome/browser/resources/settings/device_page/display.html index ea1ccbc..81e6763 100644 --- a/chrome/browser/resources/settings/device_page/display.html +++ b/chrome/browser/resources/settings/device_page/display.html
@@ -7,10 +7,10 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-tabs/paper-tabs.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-toggle-button/paper-toggle-button.html"> -<link rel="import" href="/device_page/display_layout.html"> -<link rel="import" href="/device_page/display_overscan_dialog.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/settings_vars_css.html"> +<link rel="import" href="display_layout.html"> +<link rel="import" href="display_overscan_dialog.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="../settings_vars_css.html"> <dom-module id="settings-display"> <template>
diff --git a/chrome/browser/resources/settings/device_page/display_layout.html b/chrome/browser/resources/settings/device_page/display_layout.html index a68f2e0..64331be 100644 --- a/chrome/browser/resources/settings/device_page/display_layout.html +++ b/chrome/browser/resources/settings/device_page/display_layout.html
@@ -1,9 +1,9 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-resizable-behavior/iron-resizable-behavior.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-material/paper-material.html"> -<link rel="import" href="/device_page/drag_behavior.html"> -<link rel="import" href="/device_page/layout_behavior.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="drag_behavior.html"> +<link rel="import" href="layout_behavior.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="display-layout"> <template>
diff --git a/chrome/browser/resources/settings/device_page/display_overscan_dialog.html b/chrome/browser/resources/settings/device_page/display_overscan_dialog.html index 7b993ce..075e6e9f 100644 --- a/chrome/browser/resources/settings/device_page/display_overscan_dialog.html +++ b/chrome/browser/resources/settings/device_page/display_overscan_dialog.html
@@ -4,8 +4,8 @@ <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classes/iron-flex-layout.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> -<link rel="import" href="/icons.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../icons.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-display-overscan-dialog"> <template>
diff --git a/chrome/browser/resources/settings/device_page/drive_cache_dialog.html b/chrome/browser/resources/settings/device_page/drive_cache_dialog.html index ea6e9c6..a3caa0c 100644 --- a/chrome/browser/resources/settings/device_page/drive_cache_dialog.html +++ b/chrome/browser/resources/settings/device_page/drive_cache_dialog.html
@@ -2,7 +2,7 @@ <link rel="import" href="chrome://resources/html/i18n_behavior.html"> <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-drive-cache-dialog"> <template>
diff --git a/chrome/browser/resources/settings/device_page/keyboard.html b/chrome/browser/resources/settings/device_page/keyboard.html index 73dc9239..075525a 100644 --- a/chrome/browser/resources/settings/device_page/keyboard.html +++ b/chrome/browser/resources/settings/device_page/keyboard.html
@@ -3,11 +3,11 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-collapse/iron-collapse.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> -<link rel="import" href="/controls/settings_dropdown_menu.html"> -<link rel="import" href="/controls/settings_toggle_button.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../controls/settings_dropdown_menu.html"> +<link rel="import" href="../controls/settings_toggle_button.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-keyboard"> <template>
diff --git a/chrome/browser/resources/settings/device_page/pointers.html b/chrome/browser/resources/settings/device_page/pointers.html index 60a50fe..575591e 100644 --- a/chrome/browser/resources/settings/device_page/pointers.html +++ b/chrome/browser/resources/settings/device_page/pointers.html
@@ -1,10 +1,10 @@ <link rel="import" href="chrome://resources/cr_elements/cr_slider/cr_slider.html"> <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-radio-button/paper-radio-button.html"> -<link rel="import" href="/controls/settings_radio_group.html"> -<link rel="import" href="/controls/settings_toggle_button.html"> -<link rel="import" href="/device_page/device_page_browser_proxy.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../controls/settings_radio_group.html"> +<link rel="import" href="../controls/settings_toggle_button.html"> +<link rel="import" href="device_page_browser_proxy.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-pointers"> <template>
diff --git a/chrome/browser/resources/settings/device_page/storage.html b/chrome/browser/resources/settings/device_page/storage.html index 8da9432..ecf8492 100644 --- a/chrome/browser/resources/settings/device_page/storage.html +++ b/chrome/browser/resources/settings/device_page/storage.html
@@ -3,10 +3,10 @@ <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> -<link rel="import" href="/device_page/drive_cache_dialog.html"> -<link rel="import" href="/prefs/prefs.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="drive_cache_dialog.html"> +<link rel="import" href="../prefs/prefs.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-storage"> <template>
diff --git a/chrome/browser/resources/settings/device_page/stylus.html b/chrome/browser/resources/settings/device_page/stylus.html index f6620b6..5c2e1114 100644 --- a/chrome/browser/resources/settings/device_page/stylus.html +++ b/chrome/browser/resources/settings/device_page/stylus.html
@@ -1,7 +1,7 @@ <link rel="import" href="chrome://resources/html/action_link.html"> <link rel="import" href="chrome://resources/html/polymer.html"> -<link rel="import" href="/controls/settings_toggle_button.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../controls/settings_toggle_button.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-stylus"> <template>
diff --git a/chrome/browser/resources/settings/direction_delegate.html b/chrome/browser/resources/settings/direction_delegate.html index a1bbafa9..be62c99 100644 --- a/chrome/browser/resources/settings/direction_delegate.html +++ b/chrome/browser/resources/settings/direction_delegate.html
@@ -1,4 +1,4 @@ -<link rel="import" href="/i18n_setup.html"> +<link rel="import" href="i18n_setup.html"> <link rel="import" href="chrome://resources/html/assert.html"> <link rel="import" href="chrome://resources/html/cr.html"> <script src="direction_delegate.js"></script>
diff --git a/chrome/browser/resources/settings/downloads_page/downloads_page.html b/chrome/browser/resources/settings/downloads_page/downloads_page.html index 6c70bac9..64af1e7a 100644 --- a/chrome/browser/resources/settings/downloads_page/downloads_page.html +++ b/chrome/browser/resources/settings/downloads_page/downloads_page.html
@@ -1,8 +1,8 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classes/iron-flex-layout.html"> -<link rel="import" href="/controls/controlled_button.html"> -<link rel="import" href="/controls/settings_toggle_button.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../controls/controlled_button.html"> +<link rel="import" href="../controls/settings_toggle_button.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-downloads-page"> <template>
diff --git a/chrome/browser/resources/settings/global_scroll_target_behavior.html b/chrome/browser/resources/settings/global_scroll_target_behavior.html index 9d3f252..556132f 100644 --- a/chrome/browser/resources/settings/global_scroll_target_behavior.html +++ b/chrome/browser/resources/settings/global_scroll_target_behavior.html
@@ -1,3 +1,3 @@ <link rel="import" href="chrome://resources/html/cr.html"> -<link rel="import" href="/route.html"> +<link rel="import" href="route.html"> <script src="global_scroll_target_behavior.js"></script>
diff --git a/chrome/browser/resources/settings/internet_page/internet_detail_page.html b/chrome/browser/resources/settings/internet_page/internet_detail_page.html index 33943d8..a70e4dca 100644 --- a/chrome/browser/resources/settings/internet_page/internet_detail_page.html +++ b/chrome/browser/resources/settings/internet_page/internet_detail_page.html
@@ -11,8 +11,8 @@ <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-toggle-button/paper-toggle-button.html"> -<link rel="import" href="/prefs/prefs.html"> -<link rel="import" href="/route.html"> +<link rel="import" href="../prefs/prefs.html"> +<link rel="import" href="../route.html"> <link rel="import" href="internet_shared_css.html"> <link rel="import" href="network_apnlist.html"> <link rel="import" href="network_ip_config.html">
diff --git a/chrome/browser/resources/settings/internet_page/internet_detail_page.js b/chrome/browser/resources/settings/internet_page/internet_detail_page.js index 312cb69..66f4619 100644 --- a/chrome/browser/resources/settings/internet_page/internet_detail_page.js +++ b/chrome/browser/resources/settings/internet_page/internet_detail_page.js
@@ -163,6 +163,17 @@ console.error('No guid specified for page:' + route); this.close_(); } + // Set basic networkProperties until they are loaded. + var type = /** @type {!chrome.networkingPrivate.NetworkType} */ ( + queryParams.get('type')) || + CrOnc.Type.WI_FI; + var name = queryParams.get('name') || type; + this.networkProperties = { + GUID: this.guid, + Type: type, + ConnectionState: CrOnc.ConnectionState.NOT_CONNECTED, + Name: {Active: name}, + }; this.getNetworkDetails_(); }, @@ -344,6 +355,16 @@ /** * @param {!CrOnc.NetworkProperties} networkProperties + * @return {boolean} + * @private + */ + isCellular_: function(networkProperties) { + return networkProperties.Type == CrOnc.Type.CELLULAR && + !!networkProperties.Cellular; + }, + + /** + * @param {!CrOnc.NetworkProperties} networkProperties * @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy * @return {boolean} * @private @@ -397,7 +418,7 @@ * @private */ showActivate_: function(networkProperties) { - if (networkProperties.Type != CrOnc.Type.CELLULAR) + if (!this.isCellular_(networkProperties)) return false; var activation = networkProperties.Cellular.ActivationState; return activation == CrOnc.ActivationState.NOT_ACTIVATED || @@ -430,12 +451,9 @@ * @private */ showViewAccount_: function(networkProperties) { - // Show either the 'Activate' or the 'View Account' button. - if (this.showActivate_(networkProperties)) - return false; - - if (networkProperties.Type != CrOnc.Type.CELLULAR || - !networkProperties.Cellular) { + // Show either the 'Activate' or the 'View Account' button (Cellular only). + if (!this.isCellular_(networkProperties) || + this.showActivate_(networkProperties)) { return false; } @@ -722,12 +740,12 @@ */ getInfoFields_: function() { /** @type {!Array<string>} */ var fields = []; - if (this.networkProperties.Type == CrOnc.Type.CELLULAR) { + var type = this.networkProperties.Type; + if (type == CrOnc.Type.CELLULAR && !!this.networkProperties.Cellular) { fields.push( 'Cellular.ActivationState', 'Cellular.RoamingState', 'RestrictedConnectivity', 'Cellular.ServingOperator.Name'); - } - if (this.networkProperties.Type == CrOnc.Type.VPN) { + } else if (type == CrOnc.Type.VPN && !!this.networkProperties.VPN) { var vpnType = CrOnc.getActiveValue(this.networkProperties.VPN.Type); if (vpnType == 'ThirdPartyVPN') { fields.push('VPN.ThirdPartyVPN.ProviderName'); @@ -738,10 +756,9 @@ else if (vpnType == 'L2TP-IPsec') fields.push('VPN.L2TP.Username'); } - } - if (this.networkProperties.Type == CrOnc.Type.WI_FI) + } else if (type == CrOnc.Type.WI_FI) { fields.push('RestrictedConnectivity'); - if (this.networkProperties.Type == CrOnc.Type.WI_MAX) { + } else if (type == CrOnc.Type.WI_MAX) { fields.push('RestrictedConnectivity', 'WiMAX.EAP.Identity'); } return fields; @@ -754,18 +771,18 @@ getAdvancedFields_: function() { /** @type {!Array<string>} */ var fields = []; fields.push('MacAddress'); - if (this.networkProperties.Type == CrOnc.Type.CELLULAR) { + var type = this.networkProperties.Type; + if (type == CrOnc.Type.CELLULAR && !!this.networkProperties.Cellular) { fields.push( 'Cellular.Carrier', 'Cellular.Family', 'Cellular.NetworkTechnology', 'Cellular.ServingOperator.Code'); - } - if (this.networkProperties.Type == CrOnc.Type.WI_FI) { + } else if (type == CrOnc.Type.WI_FI) { fields.push( 'WiFi.SSID', 'WiFi.BSSID', 'WiFi.Security', 'WiFi.SignalStrength', 'WiFi.Frequency'); - } - if (this.networkProperties.Type == CrOnc.Type.WI_MAX) + } else if (type == CrOnc.Type.WI_MAX) { fields.push('WiFi.SignalStrength'); + } return fields; },
diff --git a/chrome/browser/resources/settings/internet_page/internet_known_networks_page.html b/chrome/browser/resources/settings/internet_page/internet_known_networks_page.html index 9972456b..2495f3a 100644 --- a/chrome/browser/resources/settings/internet_page/internet_known_networks_page.html +++ b/chrome/browser/resources/settings/internet_page/internet_known_networks_page.html
@@ -1,7 +1,7 @@ <link rel="import" href="chrome://resources/cr_elements/icons.html"> <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classes/iron-flex-layout.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-internet-known-networks-page"> <template>
diff --git a/chrome/browser/resources/settings/internet_page/internet_page.html b/chrome/browser/resources/settings/internet_page/internet_page.html index 4e8eab42..a921f139 100644 --- a/chrome/browser/resources/settings/internet_page/internet_page.html +++ b/chrome/browser/resources/settings/internet_page/internet_page.html
@@ -6,11 +6,11 @@ <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> <link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-animatable.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> -<link rel="import" href="/prefs/prefs.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_page/settings_animated_pages.html"> -<link rel="import" href="/settings_page/settings_subpage.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../prefs/prefs.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_page/settings_animated_pages.html"> +<link rel="import" href="../settings_page/settings_subpage.html"> +<link rel="import" href="../settings_shared_css.html"> <link rel="import" href="internet_detail_page.html"> <link rel="import" href="internet_known_networks_page.html"> <link rel="import" href="network_summary.html">
diff --git a/chrome/browser/resources/settings/internet_page/internet_page.js b/chrome/browser/resources/settings/internet_page/internet_page.js index 342bab9..8854cba 100644 --- a/chrome/browser/resources/settings/internet_page/internet_page.js +++ b/chrome/browser/resources/settings/internet_page/internet_page.js
@@ -117,9 +117,12 @@ * @private */ onShowDetail_: function(event) { - settings.navigateTo( - settings.Route.NETWORK_DETAIL, - new URLSearchParams('guid=' + event.detail.GUID)); + var params = new URLSearchParams; + params.append('guid', event.detail.GUID); + params.append('type', event.detail.Type); + if (event.detail.Name) + params.append('name', event.detail.Name); + settings.navigateTo(settings.Route.NETWORK_DETAIL, params); }, /**
diff --git a/chrome/browser/resources/settings/internet_page/internet_shared_css.html b/chrome/browser/resources/settings/internet_page/internet_shared_css.html index 183fa08..d48ac4e1 100644 --- a/chrome/browser/resources/settings/internet_page/internet_shared_css.html +++ b/chrome/browser/resources/settings/internet_page/internet_shared_css.html
@@ -1,4 +1,4 @@ -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../settings_shared_css.html"> <!-- Common styles for Material Design settings. --> <dom-module id="internet-shared">
diff --git a/chrome/browser/resources/settings/internet_page/network_apnlist.html b/chrome/browser/resources/settings/internet_page/network_apnlist.html index c5d82d9..a4803bc 100644 --- a/chrome/browser/resources/settings/internet_page/network_apnlist.html +++ b/chrome/browser/resources/settings/internet_page/network_apnlist.html
@@ -2,7 +2,7 @@ <link rel="import" href="chrome://resources/html/md_select_css.html"> <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> -<link rel="import" href="/settings_vars_css.html"> +<link rel="import" href="../settings_vars_css.html"> <link rel="import" href="internet_shared_css.html"> <link rel="import" href="network_property_list.html">
diff --git a/chrome/browser/resources/settings/internet_page/network_nameservers.html b/chrome/browser/resources/settings/internet_page/network_nameservers.html index b039204..63590f6 100644 --- a/chrome/browser/resources/settings/internet_page/network_nameservers.html +++ b/chrome/browser/resources/settings/internet_page/network_nameservers.html
@@ -2,7 +2,7 @@ <link rel="import" href="chrome://resources/html/md_select_css.html"> <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input-container.html"> -<link rel="import" href="/settings_vars_css.html"> +<link rel="import" href="../settings_vars_css.html"> <link rel="import" href="internet_shared_css.html"> <dom-module id="network-nameservers">
diff --git a/chrome/browser/resources/settings/internet_page/network_proxy.html b/chrome/browser/resources/settings/internet_page/network_proxy.html index d46e2931..df6866ee 100644 --- a/chrome/browser/resources/settings/internet_page/network_proxy.html +++ b/chrome/browser/resources/settings/internet_page/network_proxy.html
@@ -10,11 +10,11 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input-container.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-toggle-button/paper-toggle-button.html"> -<link rel="import" href="/controls/extension_controlled_indicator.html"> -<link rel="import" href="/controls/settings_toggle_button.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/prefs/prefs_behavior.html"> -<link rel="import" href="/settings_vars_css.html"> +<link rel="import" href="../controls/extension_controlled_indicator.html"> +<link rel="import" href="../controls/settings_toggle_button.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../prefs/prefs_behavior.html"> +<link rel="import" href="../settings_vars_css.html"> <link rel="import" href="internet_shared_css.html"> <link rel="import" href="network_proxy_exclusions.html"> <link rel="import" href="network_proxy_input.html">
diff --git a/chrome/browser/resources/settings/internet_page/network_siminfo.html b/chrome/browser/resources/settings/internet_page/network_siminfo.html index a242d93..b6de3eea 100644 --- a/chrome/browser/resources/settings/internet_page/network_siminfo.html +++ b/chrome/browser/resources/settings/internet_page/network_siminfo.html
@@ -6,7 +6,7 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-toggle-button/paper-toggle-button.html"> -<link rel="import" href="/icons.html"> +<link rel="import" href="../icons.html"> <link rel="import" href="internet_shared_css.html"> <dom-module id="network-siminfo">
diff --git a/chrome/browser/resources/settings/internet_page/network_summary_item.html b/chrome/browser/resources/settings/internet_page/network_summary_item.html index 6940b89..782099412 100644 --- a/chrome/browser/resources/settings/internet_page/network_summary_item.html +++ b/chrome/browser/resources/settings/internet_page/network_summary_item.html
@@ -10,7 +10,7 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-toggle-button/paper-toggle-button.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../settings_shared_css.html"> <link rel="import" href="network_siminfo.html"> <dom-module name="network-summary-item">
diff --git a/chrome/browser/resources/settings/languages_page/add_languages_dialog.html b/chrome/browser/resources/settings/languages_page/add_languages_dialog.html index 2c704dbb..00378f1 100644 --- a/chrome/browser/resources/settings/languages_page/add_languages_dialog.html +++ b/chrome/browser/resources/settings/languages_page/add_languages_dialog.html
@@ -3,8 +3,8 @@ <link rel="import" href="chrome://resources/polymer/v1_0/iron-list/iron-list.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-checkbox/paper-checkbox.html"> -<link rel="import" href="/languages_page/languages.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="languages.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-add-languages-dialog"> <template>
diff --git a/chrome/browser/resources/settings/languages_page/edit_dictionary_page.html b/chrome/browser/resources/settings/languages_page/edit_dictionary_page.html index 5487b78..b1a5585 100644 --- a/chrome/browser/resources/settings/languages_page/edit_dictionary_page.html +++ b/chrome/browser/resources/settings/languages_page/edit_dictionary_page.html
@@ -5,7 +5,7 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-edit-dictionary-page"> <template>
diff --git a/chrome/browser/resources/settings/languages_page/languages.html b/chrome/browser/resources/settings/languages_page/languages.html index 1b86236..cc25681 100644 --- a/chrome/browser/resources/settings/languages_page/languages.html +++ b/chrome/browser/resources/settings/languages_page/languages.html
@@ -2,6 +2,6 @@ <link rel="import" href="chrome://resources/html/cr.html"> <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/promise_resolver.html"> -<link rel="import" href="/prefs/prefs.html"> -<link rel="import" href="/prefs/prefs_behavior.html"> +<link rel="import" href="../prefs/prefs.html"> +<link rel="import" href="../prefs/prefs_behavior.html"> <script src="languages.js"></script>
diff --git a/chrome/browser/resources/settings/languages_page/languages_page.html b/chrome/browser/resources/settings/languages_page/languages_page.html index 00635ba..9a9d646 100644 --- a/chrome/browser/resources/settings/languages_page/languages_page.html +++ b/chrome/browser/resources/settings/languages_page/languages_page.html
@@ -11,13 +11,13 @@ <link rel="import" href="chrome://resources/cr_elements/cr_expand_button/cr_expand_button.html"> <link rel="import" href="chrome://resources/cr_elements/cr_lazy_render/cr_lazy_render.html"> <link rel="import" href="chrome://resources/cr_elements/icons.html"> -<link rel="import" href="/languages_page/add_languages_dialog.html"> -<link rel="import" href="/languages_page/languages.html"> -<link rel="import" href="/lifetime_browser_proxy.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_page/settings_animated_pages.html"> -<link rel="import" href="/settings_page/settings_subpage.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="add_languages_dialog.html"> +<link rel="import" href="languages.html"> +<link rel="import" href="../lifetime_browser_proxy.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_page/settings_animated_pages.html"> +<link rel="import" href="../settings_page/settings_subpage.html"> +<link rel="import" href="../settings_shared_css.html"> <if expr="not is_macosx"> <link rel="import" href="edit_dictionary_page.html"> @@ -25,7 +25,7 @@ <if expr="chromeos"> <link rel="import" href="chrome://resources/html/chromeos/ui_account_tweaks.html"> -<link rel="import" href="/languages_page/manage_input_methods_page.html"> +<link rel="import" href="manage_input_methods_page.html"> </if> <dom-module id="settings-languages-page">
diff --git a/chrome/browser/resources/settings/languages_page/manage_input_methods_page.html b/chrome/browser/resources/settings/languages_page/manage_input_methods_page.html index 4aafd30..162cf9de 100644 --- a/chrome/browser/resources/settings/languages_page/manage_input_methods_page.html +++ b/chrome/browser/resources/settings/languages_page/manage_input_methods_page.html
@@ -2,7 +2,7 @@ <link rel="import" href="chrome://resources/html/cr.html"> <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-checkbox/paper-checkbox.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../settings_shared_css.html"> <link rel="import" href="languages.html"> <dom-module id="settings-manage-input-methods-page">
diff --git a/chrome/browser/resources/settings/on_startup_page/on_startup_page.html b/chrome/browser/resources/settings/on_startup_page/on_startup_page.html index b679c162..940c053 100644 --- a/chrome/browser/resources/settings/on_startup_page/on_startup_page.html +++ b/chrome/browser/resources/settings/on_startup_page/on_startup_page.html
@@ -1,11 +1,11 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classes/iron-flex-layout.html"> -<link rel="import" href="/controls/controlled_radio_button.html"> -<link rel="import" href="/controls/extension_controlled_indicator.html"> -<link rel="import" href="/controls/settings_radio_group.html"> -<link rel="import" href="/on_startup_page/on_startup_browser_proxy.html"> -<link rel="import" href="/on_startup_page/startup_urls_page.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../controls/controlled_radio_button.html"> +<link rel="import" href="../controls/extension_controlled_indicator.html"> +<link rel="import" href="../controls/settings_radio_group.html"> +<link rel="import" href="on_startup_browser_proxy.html"> +<link rel="import" href="startup_urls_page.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-on-startup-page"> <template>
diff --git a/chrome/browser/resources/settings/on_startup_page/startup_url_dialog.html b/chrome/browser/resources/settings/on_startup_page/startup_url_dialog.html index 0b19bde..f8865fe 100644 --- a/chrome/browser/resources/settings/on_startup_page/startup_url_dialog.html +++ b/chrome/browser/resources/settings/on_startup_page/startup_url_dialog.html
@@ -2,8 +2,8 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/on_startup_page/startup_urls_page_browser_proxy.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="startup_urls_page_browser_proxy.html"> <dom-module id="settings-startup-url-dialog"> <template>
diff --git a/chrome/browser/resources/settings/on_startup_page/startup_url_entry.html b/chrome/browser/resources/settings/on_startup_page/startup_url_entry.html index 25ed0730..9a2e8423e 100644 --- a/chrome/browser/resources/settings/on_startup_page/startup_url_entry.html +++ b/chrome/browser/resources/settings/on_startup_page/startup_url_entry.html
@@ -4,8 +4,8 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/icon.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html"> -<link rel="import" href="/on_startup_page/startup_urls_page_browser_proxy.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="startup_urls_page_browser_proxy.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-startup-url-entry"> <template>
diff --git a/chrome/browser/resources/settings/on_startup_page/startup_urls_page.html b/chrome/browser/resources/settings/on_startup_page/startup_urls_page.html index 2627254..9089b85 100644 --- a/chrome/browser/resources/settings/on_startup_page/startup_urls_page.html +++ b/chrome/browser/resources/settings/on_startup_page/startup_urls_page.html
@@ -5,11 +5,11 @@ <link rel="import" href="chrome://resources/polymer/v1_0/iron-list/iron-list.html"> <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> <link rel="import" href="chrome://resources/cr_elements/cr_scrollable_behavior.html"> -<link rel="import" href="/controls/extension_controlled_indicator.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/on_startup_page/startup_url_dialog.html"> -<link rel="import" href="/on_startup_page/startup_url_entry.html"> -<link rel="import" href="/on_startup_page/startup_urls_page_browser_proxy.html"> +<link rel="import" href="../controls/extension_controlled_indicator.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="startup_url_dialog.html"> +<link rel="import" href="startup_url_entry.html"> +<link rel="import" href="startup_urls_page_browser_proxy.html"> <dom-module id="settings-startup-urls-page"> <template>
diff --git a/chrome/browser/resources/settings/passwords_and_forms_page/address_edit_dialog.html b/chrome/browser/resources/settings/passwords_and_forms_page/address_edit_dialog.html index 5d74ca8..d9bce756 100644 --- a/chrome/browser/resources/settings/passwords_and_forms_page/address_edit_dialog.html +++ b/chrome/browser/resources/settings/passwords_and_forms_page/address_edit_dialog.html
@@ -6,8 +6,8 @@ <link rel="import" href="chrome://resources/polymer/v1_0/iron-a11y-keys/iron-a11y-keys.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-textarea.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/settings_vars_css.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="../settings_vars_css.html"> <dom-module id="settings-address-edit-dialog"> <template>
diff --git a/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.html b/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.html index a12e153..6d0364d 100644 --- a/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.html +++ b/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.html
@@ -3,11 +3,11 @@ <link rel="import" href="chrome://resources/html/action_link_css.html"> <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/passwords_and_forms_page/address_edit_dialog.html"> -<link rel="import" href="/passwords_and_forms_page/credit_card_edit_dialog.html"> -<link rel="import" href="/passwords_and_forms_page/passwords_shared_css.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="address_edit_dialog.html"> +<link rel="import" href="credit_card_edit_dialog.html"> +<link rel="import" href="passwords_shared_css.html"> <dom-module id="settings-autofill-section"> <template>
diff --git a/chrome/browser/resources/settings/passwords_and_forms_page/credit_card_edit_dialog.html b/chrome/browser/resources/settings/passwords_and_forms_page/credit_card_edit_dialog.html index cae4a0a..f00e88c 100644 --- a/chrome/browser/resources/settings/passwords_and_forms_page/credit_card_edit_dialog.html +++ b/chrome/browser/resources/settings/passwords_and_forms_page/credit_card_edit_dialog.html
@@ -5,8 +5,8 @@ <link rel="import" href="chrome://resources/polymer/v1_0/iron-a11y-keys/iron-a11y-keys.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html"> -<link rel="import" href="/settings_vars_css.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../settings_vars_css.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-credit-card-edit-dialog"> <style include="settings-shared md-select">
diff --git a/chrome/browser/resources/settings/passwords_and_forms_page/password_edit_dialog.html b/chrome/browser/resources/settings/passwords_and_forms_page/password_edit_dialog.html index da01a95..07753dc 100644 --- a/chrome/browser/resources/settings/passwords_and_forms_page/password_edit_dialog.html +++ b/chrome/browser/resources/settings/passwords_and_forms_page/password_edit_dialog.html
@@ -3,8 +3,8 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html"> -<link rel="import" href="/icons.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../icons.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="password-edit-dialog"> <template>
diff --git a/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.html b/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.html index 065a12a..b71ed1d 100644 --- a/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.html +++ b/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.html
@@ -4,14 +4,14 @@ <link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-animatable.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-toggle-button/paper-toggle-button.html"> -<link rel="import" href="/passwords_and_forms_page/autofill_section.html"> -<link rel="import" href="/passwords_and_forms_page/passwords_section.html"> -<link rel="import" href="/prefs/prefs.html"> -<link rel="import" href="/prefs/prefs_behavior.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_page/settings_animated_pages.html"> -<link rel="import" href="/settings_page/settings_subpage.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="autofill_section.html"> +<link rel="import" href="passwords_section.html"> +<link rel="import" href="../prefs/prefs.html"> +<link rel="import" href="../prefs/prefs_behavior.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_page/settings_animated_pages.html"> +<link rel="import" href="../settings_page/settings_subpage.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-passwords-and-forms-page"> <template>
diff --git a/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.html b/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.html index 03336b10..db94005 100644 --- a/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.html +++ b/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.html
@@ -4,12 +4,12 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-list/iron-list.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html"> -<link rel="import" href="/controls/settings_toggle_button.html"> -<link rel="import" href="/global_scroll_target_behavior.html"> -<link rel="import" href="/passwords_and_forms_page/password_edit_dialog.html"> -<link rel="import" href="/passwords_and_forms_page/passwords_shared_css.html"> -<link rel="import" href="/prefs/prefs.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../controls/settings_toggle_button.html"> +<link rel="import" href="../global_scroll_target_behavior.html"> +<link rel="import" href="../prefs/prefs.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="password_edit_dialog.html"> +<link rel="import" href="passwords_shared_css.html"> <dom-module id="passwords-section"> <template>
diff --git a/chrome/browser/resources/settings/people_page/camera.html b/chrome/browser/resources/settings/people_page/camera.html index 1d0de4a..debaaf07 100644 --- a/chrome/browser/resources/settings/people_page/camera.html +++ b/chrome/browser/resources/settings/people_page/camera.html
@@ -2,8 +2,8 @@ <link rel="import" href="chrome://resources/html/util.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner.html"> -<link rel="import" href="/icons.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../icons.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-camera"> <template>
diff --git a/chrome/browser/resources/settings/people_page/change_picture.html b/chrome/browser/resources/settings/people_page/change_picture.html index 1d33eae..9a0941a 100644 --- a/chrome/browser/resources/settings/people_page/change_picture.html +++ b/chrome/browser/resources/settings/people_page/change_picture.html
@@ -6,12 +6,12 @@ <link rel="import" href="chrome://resources/polymer/v1_0/iron-a11y-keys/iron-a11y-keys.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-selector/iron-selector.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/icons.html"> -<link rel="import" href="/people_page/camera.html"> -<link rel="import" href="/people_page/change_picture_browser_proxy.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../icons.html"> +<link rel="import" href="camera.html"> +<link rel="import" href="change_picture_browser_proxy.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-change-picture"> <template>
diff --git a/chrome/browser/resources/settings/people_page/compiled_resources2.gyp b/chrome/browser/resources/settings/people_page/compiled_resources2.gyp index e80ce8c..17ad19b 100644 --- a/chrome/browser/resources/settings/people_page/compiled_resources2.gyp +++ b/chrome/browser/resources/settings/people_page/compiled_resources2.gyp
@@ -51,6 +51,13 @@ 'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'], }, { + 'target_name': 'fingerprint_browser_proxy', + 'dependencies': [ + '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', + ], + 'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'], + }, + { 'target_name': 'import_data_browser_proxy', 'dependencies': [ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr',
diff --git a/chrome/browser/resources/settings/people_page/easy_unlock_turn_off_dialog.html b/chrome/browser/resources/settings/people_page/easy_unlock_turn_off_dialog.html index 5e026f28..9395315e 100644 --- a/chrome/browser/resources/settings/people_page/easy_unlock_turn_off_dialog.html +++ b/chrome/browser/resources/settings/people_page/easy_unlock_turn_off_dialog.html
@@ -4,9 +4,9 @@ <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/people_page/easy_unlock_browser_proxy.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="easy_unlock_browser_proxy.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="easy-unlock-turn-off-dialog"> <template>
diff --git a/chrome/browser/resources/settings/people_page/fingerprint_browser_proxy.html b/chrome/browser/resources/settings/people_page/fingerprint_browser_proxy.html new file mode 100644 index 0000000..7b332d0 --- /dev/null +++ b/chrome/browser/resources/settings/people_page/fingerprint_browser_proxy.html
@@ -0,0 +1 @@ +<script src="/people_page/fingerprint_browser_proxy.js"></script>
diff --git a/chrome/browser/resources/settings/people_page/fingerprint_browser_proxy.js b/chrome/browser/resources/settings/people_page/fingerprint_browser_proxy.js new file mode 100644 index 0000000..72fafa94c --- /dev/null +++ b/chrome/browser/resources/settings/people_page/fingerprint_browser_proxy.js
@@ -0,0 +1,121 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +cr.exportPath('settings'); + +/** + * @enum {number} + * These values must be kept in sync with the values in + * third_party/cros_system_api/dbus/service_constants.h. + */ +settings.FingerprintResultType = { + SUCCESS: 0, + PARTIAL: 1, + INSUFFICIENT: 2, + SENSOR_DIRTY: 3, + TOO_SLOW: 4, + TOO_FAST: 5, +}; + +/** + * An object describing a scan from the fingerprint hardware. The structure of + * this data must be kept in sync with C++ FingerprintHandler. + * @typedef {{ + * result: settings.FingerprintResultType, + * isComplete: boolean, + * }} + */ +settings.FingerprintScan; + +cr.define('settings', function() { + /** @interface */ + function FingerprintBrowserProxy() {} + + FingerprintBrowserProxy.prototype = { + /** + * @return {!Promise<!Array<string>>} + */ + getFingerprintsList: function () {}, + + startEnroll: function () {}, + + cancelCurrentEnroll: function() {}, + + /** + * @param {number} index + * @return {!Promise<string>} + */ + getEnrollmentLabel: function(index) {}, + + /** + * @param {number} index + * @return {!Promise<!Array<string>>} + */ + removeEnrollment: function(index) {}, + + /** + * @param {number} index + * @param {string} newLabel + */ + changeEnrollmentLabel: function(index, newLabel) {}, + + startAuthentication: function() {}, + + endCurrentAuthentication: function() {}, + }; + + /** + * @constructor + * @implements {settings.FingerprintBrowserProxy} + */ + function FingerprintBrowserProxyImpl() {} + cr.addSingletonGetter(FingerprintBrowserProxyImpl); + + FingerprintBrowserProxyImpl.prototype = { + /** @override */ + getFingerprintsList: function () { + return cr.sendWithPromise('getFingerprintsList'); + }, + + /** @override */ + startEnroll: function () { + chrome.send('startEnroll'); + }, + + /** @override */ + cancelCurrentEnroll: function() { + chrome.send('cancelCurrentEnroll'); + }, + + /** @override */ + getEnrollmentLabel: function(index) { + return cr.sendWithPromise('getEnrollmentLabel'); + }, + + /** @override */ + removeEnrollment: function(index) { + return cr.sendWithPromise('removeEnrollment', index); + }, + + /** @override */ + changeEnrollmentLabel: function(index, newLabel) { + chrome.send('changeEnrollmentLabel', [index, newLabel]); + }, + + /** @override */ + startAuthentication: function() { + chrome.send('startAuthentication'); + }, + + /** @override */ + endCurrentAuthentication: function() { + chrome.send('endCurrentAuthentication'); + }, + }; + + return { + FingerprintBrowserProxy : FingerprintBrowserProxy, + FingerprintBrowserProxyImpl : FingerprintBrowserProxyImpl, + }; +});
diff --git a/chrome/browser/resources/settings/people_page/import_data_dialog.html b/chrome/browser/resources/settings/people_page/import_data_dialog.html index dbe888f5..92aad8b 100644 --- a/chrome/browser/resources/settings/people_page/import_data_dialog.html +++ b/chrome/browser/resources/settings/people_page/import_data_dialog.html
@@ -6,13 +6,13 @@ <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner.html"> -<link rel="import" href="/controls/settings_checkbox.html"> -<link rel="import" href="/controls/settings_toggle_button.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/icons.html"> -<link rel="import" href="/people_page/import_data_browser_proxy.html"> -<link rel="import" href="/prefs/prefs_behavior.html"> -<link rel="import" href="/settings_vars_css.html"> +<link rel="import" href="../controls/settings_checkbox.html"> +<link rel="import" href="../controls/settings_toggle_button.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../icons.html"> +<link rel="import" href="import_data_browser_proxy.html"> +<link rel="import" href="../prefs/prefs_behavior.html"> +<link rel="import" href="../settings_vars_css.html"> <dom-module id="settings-import-data-dialog"> <template>
diff --git a/chrome/browser/resources/settings/people_page/lock_screen.html b/chrome/browser/resources/settings/people_page/lock_screen.html index 63b6748a..e6df9cbc 100644 --- a/chrome/browser/resources/settings/people_page/lock_screen.html +++ b/chrome/browser/resources/settings/people_page/lock_screen.html
@@ -3,15 +3,15 @@ <link rel="import" href="chrome://resources/html/action_link_css.html"> <link rel="import" href="chrome://resources/html/i18n_behavior.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-radio-group/paper-radio-group.html"> -<link rel="import" href="/controls/settings_toggle_button.html"> -<link rel="import" href="/people_page/fingerprint_list.html"> -<link rel="import" href="/people_page/lock_screen_constants.html"> -<link rel="import" href="/people_page/lock_state_behavior.html"> -<link rel="import" href="/people_page/password_prompt_dialog.html"> -<link rel="import" href="/people_page/setup_pin_dialog.html"> -<link rel="import" href="/prefs/prefs_behavior.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../controls/settings_toggle_button.html"> +<link rel="import" href="fingerprint_list.html"> +<link rel="import" href="lock_screen_constants.html"> +<link rel="import" href="lock_state_behavior.html"> +<link rel="import" href="password_prompt_dialog.html"> +<link rel="import" href="setup_pin_dialog.html"> +<link rel="import" href="../prefs/prefs_behavior.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-lock-screen"> <template>
diff --git a/chrome/browser/resources/settings/people_page/manage_profile.html b/chrome/browser/resources/settings/people_page/manage_profile.html index f0f4e78..f677935 100644 --- a/chrome/browser/resources/settings/people_page/manage_profile.html +++ b/chrome/browser/resources/settings/people_page/manage_profile.html
@@ -4,10 +4,10 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/shadow.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-toggle-button/paper-toggle-button.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/people_page/manage_profile_browser_proxy.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="manage_profile_browser_proxy.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-manage-profile"> <template>
diff --git a/chrome/browser/resources/settings/people_page/password_prompt_dialog.html b/chrome/browser/resources/settings/people_page/password_prompt_dialog.html index 5fce436..ac270ad 100644 --- a/chrome/browser/resources/settings/people_page/password_prompt_dialog.html +++ b/chrome/browser/resources/settings/people_page/password_prompt_dialog.html
@@ -2,9 +2,9 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html"> -<link rel="import" href="/people_page/lock_screen_constants.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="lock_screen_constants.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-password-prompt-dialog"> <template>
diff --git a/chrome/browser/resources/settings/people_page/people_page.html b/chrome/browser/resources/settings/people_page/people_page.html index 59d922a..ee85d5c 100644 --- a/chrome/browser/resources/settings/people_page/people_page.html +++ b/chrome/browser/resources/settings/people_page/people_page.html
@@ -10,26 +10,26 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-checkbox/paper-checkbox.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> -<link rel="import" href="/controls/settings_toggle_button.html"> -<link rel="import" href="/people_page/sync_page.html"> -<link rel="import" href="/people_page/profile_info_browser_proxy.html"> -<link rel="import" href="/people_page/sync_browser_proxy.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_page/settings_animated_pages.html"> -<link rel="import" href="/settings_page/settings_subpage.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../controls/settings_toggle_button.html"> +<link rel="import" href="sync_page.html"> +<link rel="import" href="profile_info_browser_proxy.html"> +<link rel="import" href="sync_browser_proxy.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_page/settings_animated_pages.html"> +<link rel="import" href="../settings_page/settings_subpage.html"> +<link rel="import" href="../settings_shared_css.html"> <if expr="chromeos"> -<link rel="import" href="/people_page/change_picture.html"> -<link rel="import" href="/people_page/easy_unlock_browser_proxy.html"> -<link rel="import" href="/people_page/easy_unlock_turn_off_dialog.html"> -<link rel="import" href="/people_page/lock_screen.html"> -<link rel="import" href="/people_page/lock_state_behavior.html"> -<link rel="import" href="/people_page/users_page.html"> +<link rel="import" href="change_picture.html"> +<link rel="import" href="easy_unlock_browser_proxy.html"> +<link rel="import" href="easy_unlock_turn_off_dialog.html"> +<link rel="import" href="lock_screen.html"> +<link rel="import" href="lock_state_behavior.html"> +<link rel="import" href="users_page.html"> </if> <if expr="not chromeos"> -<link rel="import" href="/people_page/import_data_dialog.html"> -<link rel="import" href="/people_page/manage_profile.html"> +<link rel="import" href="import_data_dialog.html"> +<link rel="import" href="manage_profile.html"> </if> <dom-module id="settings-people-page">
diff --git a/chrome/browser/resources/settings/people_page/setup_pin_dialog.html b/chrome/browser/resources/settings/people_page/setup_pin_dialog.html index 3713f67..cbfec6b1 100644 --- a/chrome/browser/resources/settings/people_page/setup_pin_dialog.html +++ b/chrome/browser/resources/settings/people_page/setup_pin_dialog.html
@@ -2,10 +2,10 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/i18n_behavior.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> -<link rel="import" href="/icons.html"> -<link rel="import" href="/people_page/lock_screen_constants.html"> -<link rel="import" href="/people_page/pin_keyboard.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../icons.html"> +<link rel="import" href="lock_screen_constants.html"> +<link rel="import" href="pin_keyboard.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-setup-pin-dialog"> <template>
diff --git a/chrome/browser/resources/settings/people_page/sync_browser_proxy.html b/chrome/browser/resources/settings/people_page/sync_browser_proxy.html index 53d2f4e..1770408e 100644 --- a/chrome/browser/resources/settings/people_page/sync_browser_proxy.html +++ b/chrome/browser/resources/settings/people_page/sync_browser_proxy.html
@@ -1,3 +1,3 @@ -<link rel="import" href="/i18n_setup.html"> +<link rel="import" href="../i18n_setup.html"> <link rel="import" href="chrome://resources/html/cr.html"> <script src="sync_browser_proxy.js"></script>
diff --git a/chrome/browser/resources/settings/people_page/sync_page.html b/chrome/browser/resources/settings/people_page/sync_page.html index fe889ef..a3e583a 100644 --- a/chrome/browser/resources/settings/people_page/sync_page.html +++ b/chrome/browser/resources/settings/people_page/sync_page.html
@@ -7,9 +7,9 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-radio-button/paper-radio-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-radio-group/paper-radio-group.html"> -<link rel="import" href="/people_page/sync_browser_proxy.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="sync_browser_proxy.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-sync-page"> <template>
diff --git a/chrome/browser/resources/settings/people_page/user_list.html b/chrome/browser/resources/settings/people_page/user_list.html index 4ce38d2..560410b21 100644 --- a/chrome/browser/resources/settings/people_page/user_list.html +++ b/chrome/browser/resources/settings/people_page/user_list.html
@@ -2,8 +2,8 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-user-list"> <template>
diff --git a/chrome/browser/resources/settings/people_page/users_add_user_dialog.html b/chrome/browser/resources/settings/people_page/users_add_user_dialog.html index 295f1aa..2db4c7e 100644 --- a/chrome/browser/resources/settings/people_page/users_add_user_dialog.html +++ b/chrome/browser/resources/settings/people_page/users_add_user_dialog.html
@@ -4,7 +4,7 @@ <link rel="import" href="chrome://resources/polymer/v1_0/iron-a11y-keys/iron-a11y-keys.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-users-add-user-dialog"> <template>
diff --git a/chrome/browser/resources/settings/people_page/users_page.html b/chrome/browser/resources/settings/people_page/users_page.html index 36686f1..6a542f2 100644 --- a/chrome/browser/resources/settings/people_page/users_page.html +++ b/chrome/browser/resources/settings/people_page/users_page.html
@@ -3,8 +3,8 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classes/iron-flex-layout.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> -<link rel="import" href="/controls/settings_toggle_button.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../controls/settings_toggle_button.html"> +<link rel="import" href="../settings_shared_css.html"> <link rel="import" href="user_list.html"> <link rel="import" href="users_add_user_dialog.html">
diff --git a/chrome/browser/resources/settings/printing_page/cloud_printers.html b/chrome/browser/resources/settings/printing_page/cloud_printers.html index 157c346..9eaa0a3 100644 --- a/chrome/browser/resources/settings/printing_page/cloud_printers.html +++ b/chrome/browser/resources/settings/printing_page/cloud_printers.html
@@ -1,7 +1,7 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> -<link rel="import" href="/controls/settings_toggle_button.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../controls/settings_toggle_button.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-cloud-printers"> <template>
diff --git a/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html b/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html index ac227b24..f80c3474 100644 --- a/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html +++ b/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html
@@ -4,11 +4,11 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/printing_page/cups_add_printer_dialog_util.html"> -<link rel="import" href="/printing_page/cups_printers_browser_proxy.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/settings_vars_css.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="cups_add_printer_dialog_util.html"> +<link rel="import" href="cups_printers_browser_proxy.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="../settings_vars_css.html"> <dom-module id="add-printer-discovery-dialog"> <template>
diff --git a/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_util.html b/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_util.html index f08c5e7..243935e9 100644 --- a/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_util.html +++ b/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_util.html
@@ -7,8 +7,8 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input-container.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-item/paper-item.html"> -<link rel="import" href="/printing_page/cups_printers_browser_proxy.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="cups_printers_browser_proxy.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="add-printer-list"> <template>
diff --git a/chrome/browser/resources/settings/printing_page/cups_printer_details_page.html b/chrome/browser/resources/settings/printing_page/cups_printer_details_page.html index a2e28fd..0e0de7612 100644 --- a/chrome/browser/resources/settings/printing_page/cups_printer_details_page.html +++ b/chrome/browser/resources/settings/printing_page/cups_printer_details_page.html
@@ -2,7 +2,7 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-collapse/iron-collapse.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-cups-printer-details-page"> <template>
diff --git a/chrome/browser/resources/settings/printing_page/cups_printers.html b/chrome/browser/resources/settings/printing_page/cups_printers.html index 677f48c9..24ea9b1 100644 --- a/chrome/browser/resources/settings/printing_page/cups_printers.html +++ b/chrome/browser/resources/settings/printing_page/cups_printers.html
@@ -1,9 +1,9 @@ <link rel="import" href="chrome://resources/html/action_link.html"> <link rel="import" href="chrome://resources/html/action_link_css.html"> <link rel="import" href="chrome://resources/html/polymer.html"> -<link rel="import" href="/printing_page/cups_add_printer_dialog.html"> -<link rel="import" href="/printing_page/cups_printers_list.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="cups_add_printer_dialog.html"> +<link rel="import" href="cups_printers_list.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-cups-printers"> <template>
diff --git a/chrome/browser/resources/settings/printing_page/cups_printers_list.html b/chrome/browser/resources/settings/printing_page/cups_printers_list.html index 1193820a..e3d456fe 100644 --- a/chrome/browser/resources/settings/printing_page/cups_printers_list.html +++ b/chrome/browser/resources/settings/printing_page/cups_printers_list.html
@@ -2,8 +2,8 @@ <link rel="import" href="chrome://resources/cr_elements/icons.html"> <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html"> -<link rel="import" href="/printing_page/cups_printers_browser_proxy.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="cups_printers_browser_proxy.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-cups-printers-list"> <template>
diff --git a/chrome/browser/resources/settings/printing_page/printing_page.html b/chrome/browser/resources/settings/printing_page/printing_page.html index 4cad00e..85f5e26 100644 --- a/chrome/browser/resources/settings/printing_page/printing_page.html +++ b/chrome/browser/resources/settings/printing_page/printing_page.html
@@ -1,14 +1,14 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-animatable.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> -<link rel="import" href="/printing_page/cloud_printers.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_page/settings_animated_pages.html"> -<link rel="import" href="/settings_page/settings_subpage.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="cloud_printers.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_page/settings_animated_pages.html"> +<link rel="import" href="../settings_page/settings_subpage.html"> +<link rel="import" href="../settings_shared_css.html"> <if expr="chromeos"> -<link rel="import" href="/printing_page/cups_printer_details_page.html"> -<link rel="import" href="/printing_page/cups_printers.html"> +<link rel="import" href="cups_printer_details_page.html"> +<link rel="import" href="cups_printers.html"> </if> <dom-module id="settings-printing-page">
diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.html b/chrome/browser/resources/settings/privacy_page/privacy_page.html index e7ef19b..836d57f 100644 --- a/chrome/browser/resources/settings/privacy_page/privacy_page.html +++ b/chrome/browser/resources/settings/privacy_page/privacy_page.html
@@ -5,30 +5,30 @@ <link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-animatable.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> -<link rel="import" href="/clear_browsing_data_dialog/clear_browsing_data_dialog.html"> -<link rel="import" href="/controls/settings_toggle_button.html"> -<link rel="import" href="/lifetime_browser_proxy.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_page/settings_animated_pages.html"> -<link rel="import" href="/settings_page/settings_subpage.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/site_settings/all_sites.html"> -<link rel="import" href="/site_settings/category_default_setting.html"> -<link rel="import" href="/site_settings/category_setting_exceptions.html"> -<link rel="import" href="/site_settings/constants.html"> -<link rel="import" href="/site_settings/media_picker.html"> -<link rel="import" href="/site_settings/pdf_documents.html"> -<link rel="import" href="/site_settings/protocol_handlers.html"> -<link rel="import" href="/site_settings/site_data_details_subpage.html"> -<link rel="import" href="/site_settings/usb_devices.html"> -<link rel="import" href="/site_settings/site_data.html"> -<link rel="import" href="/site_settings/zoom_levels.html"> -<link rel="import" href="/site_settings_page/site_settings_page.html"> +<link rel="import" href="../clear_browsing_data_dialog/clear_browsing_data_dialog.html"> +<link rel="import" href="../controls/settings_toggle_button.html"> +<link rel="import" href="../lifetime_browser_proxy.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_page/settings_animated_pages.html"> +<link rel="import" href="../settings_page/settings_subpage.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="../site_settings/all_sites.html"> +<link rel="import" href="../site_settings/category_default_setting.html"> +<link rel="import" href="../site_settings/category_setting_exceptions.html"> +<link rel="import" href="../site_settings/constants.html"> +<link rel="import" href="../site_settings/media_picker.html"> +<link rel="import" href="../site_settings/pdf_documents.html"> +<link rel="import" href="../site_settings/protocol_handlers.html"> +<link rel="import" href="../site_settings/site_data_details_subpage.html"> +<link rel="import" href="../site_settings/usb_devices.html"> +<link rel="import" href="../site_settings/site_data.html"> +<link rel="import" href="../site_settings/zoom_levels.html"> +<link rel="import" href="../site_settings_page/site_settings_page.html"> <if expr="use_nss_certs"> -<link rel="import" href="/certificate_manager_page/certificate_manager_page.html"> +<link rel="import" href="../certificate_manager_page/certificate_manager_page.html"> </if> -<link rel="import" href="/privacy_page/privacy_page_browser_proxy.html"> +<link rel="import" href="privacy_page_browser_proxy.html"> <dom-module id="settings-privacy-page"> <template>
diff --git a/chrome/browser/resources/settings/reset_page/powerwash_dialog.html b/chrome/browser/resources/settings/reset_page/powerwash_dialog.html index e70ab00..8c34f76 100644 --- a/chrome/browser/resources/settings/reset_page/powerwash_dialog.html +++ b/chrome/browser/resources/settings/reset_page/powerwash_dialog.html
@@ -2,9 +2,9 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classes/iron-flex-layout.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> -<link rel="import" href="/lifetime_browser_proxy.html"> -<link rel="import" href="/reset_page/reset_browser_proxy.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../lifetime_browser_proxy.html"> +<link rel="import" href="reset_browser_proxy.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-powerwash-dialog"> <template>
diff --git a/chrome/browser/resources/settings/reset_page/reset_page.html b/chrome/browser/resources/settings/reset_page/reset_page.html index 0038e583..d242059 100644 --- a/chrome/browser/resources/settings/reset_page/reset_page.html +++ b/chrome/browser/resources/settings/reset_page/reset_page.html
@@ -1,13 +1,13 @@ <link rel="import" href="chrome://resources/cr_elements/cr_lazy_render/cr_lazy_render.html"> <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/reset_page/reset_profile_dialog.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="reset_profile_dialog.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_shared_css.html"> <if expr="chromeos"> -<link rel="import" href="/reset_page/powerwash_dialog.html"> +<link rel="import" href="powerwash_dialog.html"> </if> <dom-module id="settings-reset-page">
diff --git a/chrome/browser/resources/settings/reset_page/reset_profile_banner.html b/chrome/browser/resources/settings/reset_page/reset_profile_banner.html index 75ea93c..16285e1 100644 --- a/chrome/browser/resources/settings/reset_page/reset_profile_banner.html +++ b/chrome/browser/resources/settings/reset_page/reset_profile_banner.html
@@ -2,8 +2,8 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html"> -<link rel="import" href="/reset_page/reset_browser_proxy.html"> -<link rel="import" href="/reset_page/reset_profile_dialog.html"> +<link rel="import" href="reset_browser_proxy.html"> +<link rel="import" href="reset_profile_dialog.html"> <dom-module id="settings-reset-profile-banner"> <template>
diff --git a/chrome/browser/resources/settings/reset_page/reset_profile_dialog.html b/chrome/browser/resources/settings/reset_page/reset_profile_dialog.html index 1dfd9a4..d408d98 100644 --- a/chrome/browser/resources/settings/reset_page/reset_profile_dialog.html +++ b/chrome/browser/resources/settings/reset_page/reset_profile_dialog.html
@@ -7,8 +7,8 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-checkbox/paper-checkbox.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner.html"> -<link rel="import" href="/reset_page/reset_browser_proxy.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="reset_browser_proxy.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-reset-profile-dialog"> <template>
diff --git a/chrome/browser/resources/settings/search_engines_page/omnibox_extension_entry.html b/chrome/browser/resources/settings/search_engines_page/omnibox_extension_entry.html index 939da766..5496507 100644 --- a/chrome/browser/resources/settings/search_engines_page/omnibox_extension_entry.html +++ b/chrome/browser/resources/settings/search_engines_page/omnibox_extension_entry.html
@@ -3,9 +3,9 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/icon.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html"> -<link rel="import" href="/extension_control_browser_proxy.html"> -<link rel="import" href="/search_engines_page/search_engine_entry_css.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../extension_control_browser_proxy.html"> +<link rel="import" href="search_engine_entry_css.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-omnibox-extension-entry"> <template>
diff --git a/chrome/browser/resources/settings/search_engines_page/search_engine_dialog.html b/chrome/browser/resources/settings/search_engines_page/search_engine_dialog.html index 8461bb9e..29f265b 100644 --- a/chrome/browser/resources/settings/search_engines_page/search_engine_dialog.html +++ b/chrome/browser/resources/settings/search_engines_page/search_engine_dialog.html
@@ -2,8 +2,8 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/search_engines_page/search_engines_browser_proxy.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="search_engines_browser_proxy.html"> <dom-module id="settings-search-engine-dialog"> <template>
diff --git a/chrome/browser/resources/settings/search_engines_page/search_engine_entry.html b/chrome/browser/resources/settings/search_engines_page/search_engine_entry.html index 0124a5f..77480c65 100644 --- a/chrome/browser/resources/settings/search_engines_page/search_engine_entry.html +++ b/chrome/browser/resources/settings/search_engines_page/search_engine_entry.html
@@ -3,11 +3,11 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/icon.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html"> -<link rel="import" href="/controls/extension_controlled_indicator.html"> -<link rel="import" href="/search_engines_page/search_engine_dialog.html"> -<link rel="import" href="/search_engines_page/search_engine_entry_css.html"> -<link rel="import" href="/search_engines_page/search_engines_browser_proxy.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../controls/extension_controlled_indicator.html"> +<link rel="import" href="search_engine_dialog.html"> +<link rel="import" href="search_engine_entry_css.html"> +<link rel="import" href="search_engines_browser_proxy.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-search-engine-entry"> <template>
diff --git a/chrome/browser/resources/settings/search_engines_page/search_engines_list.html b/chrome/browser/resources/settings/search_engines_page/search_engines_list.html index edbf705..c1049d365 100644 --- a/chrome/browser/resources/settings/search_engines_page/search_engines_list.html +++ b/chrome/browser/resources/settings/search_engines_page/search_engines_list.html
@@ -1,8 +1,8 @@ <link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-list/iron-list.html"> -<link rel="import" href="/global_scroll_target_behavior.html"> -<link rel="import" href="/search_engines_page/search_engine_entry.html"> +<link rel="import" href="../global_scroll_target_behavior.html"> +<link rel="import" href="search_engine_entry.html"> <dom-module id="settings-search-engines-list"> <template>
diff --git a/chrome/browser/resources/settings/search_engines_page/search_engines_page.html b/chrome/browser/resources/settings/search_engines_page/search_engines_page.html index bae938a..e2d682d 100644 --- a/chrome/browser/resources/settings/search_engines_page/search_engines_page.html +++ b/chrome/browser/resources/settings/search_engines_page/search_engines_page.html
@@ -3,11 +3,11 @@ <link rel="import" href="chrome://resources/html/action_link_css.html"> <link rel="import" href="chrome://resources/html/cr.html"> <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> -<link rel="import" href="/search_engines_page/search_engines_browser_proxy.html"> -<link rel="import" href="/search_engines_page/search_engine_dialog.html"> -<link rel="import" href="/search_engines_page/search_engines_list.html"> -<link rel="import" href="/search_engines_page/omnibox_extension_entry.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="search_engines_browser_proxy.html"> +<link rel="import" href="search_engine_dialog.html"> +<link rel="import" href="search_engines_list.html"> +<link rel="import" href="omnibox_extension_entry.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-search-engines-page"> <template>
diff --git a/chrome/browser/resources/settings/search_page/search_page.html b/chrome/browser/resources/settings/search_page/search_page.html index 96b4ba01..f064f1c 100644 --- a/chrome/browser/resources/settings/search_page/search_page.html +++ b/chrome/browser/resources/settings/search_page/search_page.html
@@ -4,17 +4,17 @@ <link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-animatable.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> -<link rel="import" href="/controls/extension_controlled_indicator.html"> -<link rel="import" href="/controls/settings_toggle_button.html"> -<link rel="import" href="/icons.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/search_engines_page/search_engines_page.html"> -<link rel="import" href="/search_engines_page/search_engines_browser_proxy.html"> -<link rel="import" href="/settings_page/settings_animated_pages.html"> -<link rel="import" href="/settings_page/settings_subpage.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/settings_vars_css.html"> +<link rel="import" href="../controls/extension_controlled_indicator.html"> +<link rel="import" href="../controls/settings_toggle_button.html"> +<link rel="import" href="../icons.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../search_engines_page/search_engines_page.html"> +<link rel="import" href="../search_engines_page/search_engines_browser_proxy.html"> +<link rel="import" href="../settings_page/settings_animated_pages.html"> +<link rel="import" href="../settings_page/settings_subpage.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="../settings_vars_css.html"> <dom-module id="settings-search-page"> <template> @@ -84,7 +84,7 @@ hotwordInfo_.alwaysOn)]]" on-change="onHotwordSearchEnableChange_"> <a href="$i18nRaw{hotwordLearnMoreUrl}" target="_blank" - on-tap="doNothing_"> + class="label-controls" on-tap="doNothing_"> $i18n{searchOkGoogleLearnMore} </a> </settings-toggle-button>
diff --git a/chrome/browser/resources/settings/settings.html b/chrome/browser/resources/settings/settings.html index d5edfd4..53975ff 100644 --- a/chrome/browser/resources/settings/settings.html +++ b/chrome/browser/resources/settings/settings.html
@@ -3,8 +3,9 @@ <head> <meta charset="utf-8"> <title>$i18n{settings}</title> + <base href="chrome://$i18n{hostname}"> <link rel="import" href="chrome://resources/html/polymer.html"> - <link rel="import" href="/settings_ui/settings_ui.html"> + <link rel="import" href="settings_ui/settings_ui.html"> <link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css"> <link rel="import" href="chrome://resources/html/i18n_template.html"> <!-- Do not add any <link rel="..."> elements below here. Imports outside of
diff --git a/chrome/browser/resources/settings/settings_main/settings_main.html b/chrome/browser/resources/settings/settings_main/settings_main.html index e462724..71ca0fb 100644 --- a/chrome/browser/resources/settings/settings_main/settings_main.html +++ b/chrome/browser/resources/settings/settings_main/settings_main.html
@@ -3,10 +3,10 @@ <link rel="import" href="chrome://resources/html/promise_resolver.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> -<link rel="import" href="/about_page/about_page.html"> -<link rel="import" href="/basic_page/basic_page.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_vars_css.html"> +<link rel="import" href="../about_page/about_page.html"> +<link rel="import" href="../basic_page/basic_page.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_vars_css.html"> <dom-module id="settings-main"> <template>
diff --git a/chrome/browser/resources/settings/settings_menu/settings_menu.html b/chrome/browser/resources/settings/settings_menu/settings_menu.html index 7725ea2..5c42519 100644 --- a/chrome/browser/resources/settings/settings_menu/settings_menu.html +++ b/chrome/browser/resources/settings/settings_menu/settings_menu.html
@@ -5,9 +5,9 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-menu/paper-menu.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-menu/paper-submenu.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-ripple/paper-ripple.html"> -<link rel="import" href="/icons.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../icons.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-menu"> <template>
diff --git a/chrome/browser/resources/settings/settings_page/main_page_behavior.html b/chrome/browser/resources/settings/settings_page/main_page_behavior.html index 97b3a549..ec89b7b7 100644 --- a/chrome/browser/resources/settings/settings_page/main_page_behavior.html +++ b/chrome/browser/resources/settings/settings_page/main_page_behavior.html
@@ -1,4 +1,4 @@ <link rel="import" href="chrome://resources/html/assert.html"> <link rel="import" href="chrome://resources/html/polymer.html"> -<link rel="import" href="/route.html"> +<link rel="import" href="../route.html"> <script src="main_page_behavior.js"></script>
diff --git a/chrome/browser/resources/settings/settings_page/settings_animated_pages.html b/chrome/browser/resources/settings/settings_page/settings_animated_pages.html index 192fe21..8340f045 100644 --- a/chrome/browser/resources/settings/settings_page/settings_animated_pages.html +++ b/chrome/browser/resources/settings/settings_page/settings_animated_pages.html
@@ -10,7 +10,7 @@ <link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-animatable.html"> <link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-animated-pages.html"> <link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-animation-runner-behavior.html"> -<link rel="import" href="/route.html"> +<link rel="import" href="../route.html"> <dom-module id="settings-animated-pages"> <template>
diff --git a/chrome/browser/resources/settings/settings_page/settings_section.html b/chrome/browser/resources/settings/settings_page/settings_section.html index 9949f5f..2fb6efc 100644 --- a/chrome/browser/resources/settings/settings_page/settings_section.html +++ b/chrome/browser/resources/settings/settings_page/settings_section.html
@@ -1,6 +1,6 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/shadow.html"> -<link rel="import" href="/animation/animation.html"> +<link rel="import" href="../animation/animation.html"> <dom-module id="settings-section"> <template>
diff --git a/chrome/browser/resources/settings/settings_page/settings_subpage.html b/chrome/browser/resources/settings/settings_page/settings_subpage.html index aa43911..951ef6d 100644 --- a/chrome/browser/resources/settings/settings_page/settings_subpage.html +++ b/chrome/browser/resources/settings/settings_page/settings_subpage.html
@@ -3,10 +3,10 @@ <link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-animatable-behavior.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner.html"> -<link rel="import" href="/icons.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_page/settings_subpage_search.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../icons.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="settings_subpage_search.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-subpage"> <template>
diff --git a/chrome/browser/resources/settings/settings_page_css.html b/chrome/browser/resources/settings/settings_page_css.html index aa054b35..07b269d 100644 --- a/chrome/browser/resources/settings/settings_page_css.html +++ b/chrome/browser/resources/settings/settings_page_css.html
@@ -1,5 +1,5 @@ <link rel="import" href="chrome://resources/html/polymer.html"> -<link rel="import" href="/settings_page/main_page_behavior.html"> +<link rel="import" href="settings_page/main_page_behavior.html"> <dom-module id="settings-page-styles"> <template>
diff --git a/chrome/browser/resources/settings/settings_shared_css.html b/chrome/browser/resources/settings/settings_shared_css.html index 441b26ab9..32ed821 100644 --- a/chrome/browser/resources/settings/settings_shared_css.html +++ b/chrome/browser/resources/settings/settings_shared_css.html
@@ -1,5 +1,5 @@ <link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> -<link rel="import" href="/settings_vars_css.html"> +<link rel="import" href="settings_vars_css.html"> <!-- Common styles for Material Design settings. --> <dom-module id="settings-shared">
diff --git a/chrome/browser/resources/settings/settings_ui/settings_ui.html b/chrome/browser/resources/settings/settings_ui/settings_ui.html index be8ebae..fc366132 100644 --- a/chrome/browser/resources/settings/settings_ui/settings_ui.html +++ b/chrome/browser/resources/settings/settings_ui/settings_ui.html
@@ -4,16 +4,16 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-header-panel/paper-header-panel.html"> -<link rel="import" href="/direction_delegate.html"> -<link rel="import" href="/global_scroll_target_behavior.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/icons.html"> -<link rel="import" href="/settings_main/settings_main.html"> -<link rel="import" href="/settings_menu/settings_menu.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/prefs/prefs.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_vars_css.html"> +<link rel="import" href="../direction_delegate.html"> +<link rel="import" href="../global_scroll_target_behavior.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../icons.html"> +<link rel="import" href="../settings_main/settings_main.html"> +<link rel="import" href="../settings_menu/settings_menu.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="../prefs/prefs.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_vars_css.html"> <if expr="chromeos"> <link rel="import" href="chrome://resources/cr_elements/network/cr_onc_types.html">
diff --git a/chrome/browser/resources/settings/site_settings/add_site_dialog.html b/chrome/browser/resources/settings/site_settings/add_site_dialog.html index 3828943..149cad2 100644 --- a/chrome/browser/resources/settings/site_settings/add_site_dialog.html +++ b/chrome/browser/resources/settings/site_settings/add_site_dialog.html
@@ -4,10 +4,10 @@ <link rel="import" href="chrome://resources/polymer/v1_0/iron-a11y-keys/iron-a11y-keys.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/site_settings/constants.html"> -<link rel="import" href="/site_settings/site_settings_behavior.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="constants.html"> +<link rel="import" href="site_settings_behavior.html"> <dom-module id="add-site-dialog"> <template>
diff --git a/chrome/browser/resources/settings/site_settings/all_sites.html b/chrome/browser/resources/settings/site_settings/all_sites.html index 42c9bcd..f048e8e 100644 --- a/chrome/browser/resources/settings/site_settings/all_sites.html +++ b/chrome/browser/resources/settings/site_settings/all_sites.html
@@ -1,8 +1,8 @@ <link rel="import" href="chrome://resources/html/polymer.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/site_settings/constants.html"> -<link rel="import" href="/site_settings/site_list.html"> -<link rel="import" href="/site_settings/site_settings_behavior.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="constants.html"> +<link rel="import" href="site_list.html"> +<link rel="import" href="site_settings_behavior.html"> <dom-module id="all-sites"> <template>
diff --git a/chrome/browser/resources/settings/site_settings/category_default_setting.html b/chrome/browser/resources/settings/site_settings/category_default_setting.html index e46a561..92e1da2 100644 --- a/chrome/browser/resources/settings/site_settings/category_default_setting.html +++ b/chrome/browser/resources/settings/site_settings/category_default_setting.html
@@ -1,10 +1,10 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> -<link rel="import" href="/controls/settings_toggle_button.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/site_settings/constants.html"> -<link rel="import" href="/site_settings/site_settings_behavior.html"> -<link rel="import" href="/site_settings/site_settings_prefs_browser_proxy.html"> +<link rel="import" href="../controls/settings_toggle_button.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="constants.html"> +<link rel="import" href="site_settings_behavior.html"> +<link rel="import" href="site_settings_prefs_browser_proxy.html"> <dom-module id="category-default-setting"> <template>
diff --git a/chrome/browser/resources/settings/site_settings/category_setting_exceptions.html b/chrome/browser/resources/settings/site_settings/category_setting_exceptions.html index c3f4b1f..3fe8e0f 100644 --- a/chrome/browser/resources/settings/site_settings/category_setting_exceptions.html +++ b/chrome/browser/resources/settings/site_settings/category_setting_exceptions.html
@@ -1,7 +1,7 @@ <link rel="import" href="chrome://resources/html/polymer.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/site_settings/constants.html"> -<link rel="import" href="/site_settings/site_list.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="constants.html"> +<link rel="import" href="site_list.html"> <dom-module id="category-setting-exceptions"> <template>
diff --git a/chrome/browser/resources/settings/site_settings/cookie_tree_behavior.html b/chrome/browser/resources/settings/site_settings/cookie_tree_behavior.html index f013afa..a9d7fd71 100644 --- a/chrome/browser/resources/settings/site_settings/cookie_tree_behavior.html +++ b/chrome/browser/resources/settings/site_settings/cookie_tree_behavior.html
@@ -1,3 +1,3 @@ -<link rel="import" href="/site_settings/site_settings_behavior.html"> -<link rel="import" href="/site_settings/site_settings_prefs_browser_proxy.html"> +<link rel="import" href="site_settings_behavior.html"> +<link rel="import" href="site_settings_prefs_browser_proxy.html"> <script src="cookie_tree_behavior.js"></script>
diff --git a/chrome/browser/resources/settings/site_settings/media_picker.html b/chrome/browser/resources/settings/site_settings/media_picker.html index 97407ea..fe118df5 100644 --- a/chrome/browser/resources/settings/site_settings/media_picker.html +++ b/chrome/browser/resources/settings/site_settings/media_picker.html
@@ -1,7 +1,7 @@ <link rel="import" href="chrome://resources/html/md_select_css.html"> <link rel="import" href="chrome://resources/html/polymer.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/settings_vars_css.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="../settings_vars_css.html"> <dom-module id="media-picker"> <template>
diff --git a/chrome/browser/resources/settings/site_settings/pdf_documents.html b/chrome/browser/resources/settings/site_settings/pdf_documents.html index 0ea4cf3..3c42c4b 100644 --- a/chrome/browser/resources/settings/site_settings/pdf_documents.html +++ b/chrome/browser/resources/settings/site_settings/pdf_documents.html
@@ -1,6 +1,6 @@ <link rel="import" href="chrome://resources/html/polymer.html"> -<link rel="import" href="/controls/settings_toggle_button.html"> -<link rel="import" href="/settings_shared_css.html"> +<link rel="import" href="../controls/settings_toggle_button.html"> +<link rel="import" href="../settings_shared_css.html"> <dom-module id="settings-pdf-documents"> <template>
diff --git a/chrome/browser/resources/settings/site_settings/protocol_handlers.html b/chrome/browser/resources/settings/site_settings/protocol_handlers.html index ab34821..f10f271 100644 --- a/chrome/browser/resources/settings/site_settings/protocol_handlers.html +++ b/chrome/browser/resources/settings/site_settings/protocol_handlers.html
@@ -4,10 +4,10 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-toggle-button/paper-toggle-button.html"> <link rel="import" href="chrome://resources/cr_elements/cr_action_menu/cr_action_menu.html"> <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/site_settings/site_settings_behavior.html"> -<link rel="import" href="/site_settings/site_settings_prefs_browser_proxy.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="site_settings_behavior.html"> +<link rel="import" href="site_settings_prefs_browser_proxy.html"> <dom-module id="protocol-handlers"> <template>
diff --git a/chrome/browser/resources/settings/site_settings/site_data.html b/chrome/browser/resources/settings/site_settings/site_data.html index be45b89..d9387121 100644 --- a/chrome/browser/resources/settings/site_settings/site_data.html +++ b/chrome/browser/resources/settings/site_settings/site_data.html
@@ -3,10 +3,10 @@ <link rel="import" href="chrome://resources/cr_elements/icons.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> -<link rel="import" href="/settings_page/settings_subpage_search.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/site_settings/cookie_tree_behavior.html"> -<link rel="import" href="/site_settings/site_settings_behavior.html"> +<link rel="import" href="../settings_page/settings_subpage_search.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="cookie_tree_behavior.html"> +<link rel="import" href="site_settings_behavior.html"> <dom-module id="site-data"> <template>
diff --git a/chrome/browser/resources/settings/site_settings/site_data_details_subpage.html b/chrome/browser/resources/settings/site_settings/site_data_details_subpage.html index ece1b3e..17a6cf34 100644 --- a/chrome/browser/resources/settings/site_settings/site_data_details_subpage.html +++ b/chrome/browser/resources/settings/site_settings/site_data_details_subpage.html
@@ -3,9 +3,9 @@ <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-collapse/iron-collapse.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/site_settings/site_settings_prefs_browser_proxy.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="site_settings_prefs_browser_proxy.html"> <dom-module id="site-data-details-subpage"> <template>
diff --git a/chrome/browser/resources/settings/site_settings/site_details.html b/chrome/browser/resources/settings/site_settings/site_details.html index 767d5e3b..dace4e1fb 100644 --- a/chrome/browser/resources/settings/site_settings/site_details.html +++ b/chrome/browser/resources/settings/site_settings/site_details.html
@@ -5,12 +5,12 @@ <link rel="import" href="chrome://resources/cr_elements/icons.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/site_settings/constants.html"> -<link rel="import" href="/site_settings/site_details_permission.html"> -<link rel="import" href="/site_settings/site_settings_behavior.html"> -<link rel="import" href="/site_settings/website_usage_private_api.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="constants.html"> +<link rel="import" href="site_details_permission.html"> +<link rel="import" href="site_settings_behavior.html"> +<link rel="import" href="website_usage_private_api.html"> <dom-module id="site-details"> <template>
diff --git a/chrome/browser/resources/settings/site_settings/site_details_permission.html b/chrome/browser/resources/settings/site_settings/site_details_permission.html index c34ae3f..c5f56fe7 100644 --- a/chrome/browser/resources/settings/site_settings/site_details_permission.html +++ b/chrome/browser/resources/settings/site_settings/site_details_permission.html
@@ -2,11 +2,11 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/settings_vars_css.html"> -<link rel="import" href="/site_settings/constants.html"> -<link rel="import" href="/site_settings/site_settings_behavior.html"> -<link rel="import" href="/site_settings/site_settings_prefs_browser_proxy.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="../settings_vars_css.html"> +<link rel="import" href="constants.html"> +<link rel="import" href="site_settings_behavior.html"> +<link rel="import" href="site_settings_prefs_browser_proxy.html"> <dom-module id="site-details-permission"> <template>
diff --git a/chrome/browser/resources/settings/site_settings/site_list.html b/chrome/browser/resources/settings/site_settings/site_list.html index 0c18ca9..c26e9c3 100644 --- a/chrome/browser/resources/settings/site_settings/site_list.html +++ b/chrome/browser/resources/settings/site_settings/site_list.html
@@ -4,14 +4,14 @@ <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/icons.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/site_settings/add_site_dialog.html"> -<link rel="import" href="/site_settings/constants.html"> -<link rel="import" href="/site_settings/site_settings_behavior.html"> -<link rel="import" href="/site_settings/site_settings_prefs_browser_proxy.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../icons.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="add_site_dialog.html"> +<link rel="import" href="constants.html"> +<link rel="import" href="site_settings_behavior.html"> +<link rel="import" href="site_settings_prefs_browser_proxy.html"> <dom-module id="site-list"> <template>
diff --git a/chrome/browser/resources/settings/site_settings/site_settings_behavior.html b/chrome/browser/resources/settings/site_settings/site_settings_behavior.html index e3ae437..e5cd479 100644 --- a/chrome/browser/resources/settings/site_settings/site_settings_behavior.html +++ b/chrome/browser/resources/settings/site_settings/site_settings_behavior.html
@@ -1,8 +1,8 @@ -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/icons.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/site_settings/constants.html"> -<link rel="import" href="/site_settings/site_settings_prefs_browser_proxy.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../icons.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="constants.html"> +<link rel="import" href="site_settings_prefs_browser_proxy.html"> <link rel="import" href="chrome://resources/cr_elements/icons.html"> <link rel="import" href="chrome://resources/html/assert.html"> <link rel="import" href="chrome://resources/html/icon.html">
diff --git a/chrome/browser/resources/settings/site_settings/usb_devices.html b/chrome/browser/resources/settings/site_settings/usb_devices.html index eed92587..6abb7e3b0 100644 --- a/chrome/browser/resources/settings/site_settings/usb_devices.html +++ b/chrome/browser/resources/settings/site_settings/usb_devices.html
@@ -2,10 +2,10 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html"> <link rel="import" href="chrome://resources/cr_elements/cr_action_menu/cr_action_menu.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/site_settings/site_settings_behavior.html"> -<link rel="import" href="/site_settings/site_settings_prefs_browser_proxy.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="site_settings_behavior.html"> +<link rel="import" href="site_settings_prefs_browser_proxy.html"> <dom-module id="usb-devices"> <template>
diff --git a/chrome/browser/resources/settings/site_settings/zoom_levels.html b/chrome/browser/resources/settings/site_settings/zoom_levels.html index c00584f..3d385cb 100644 --- a/chrome/browser/resources/settings/site_settings/zoom_levels.html +++ b/chrome/browser/resources/settings/site_settings/zoom_levels.html
@@ -2,10 +2,10 @@ <link rel="import" href="chrome://resources/cr_elements/icons.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html"> <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> -<link rel="import" href="/i18n_setup.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/site_settings/site_settings_behavior.html"> -<link rel="import" href="/site_settings/site_settings_prefs_browser_proxy.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="site_settings_behavior.html"> +<link rel="import" href="site_settings_prefs_browser_proxy.html"> <dom-module id="zoom-levels"> <template>
diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_page.html b/chrome/browser/resources/settings/site_settings_page/site_settings_page.html index 1d43797..2779245 100644 --- a/chrome/browser/resources/settings/site_settings_page/site_settings_page.html +++ b/chrome/browser/resources/settings/site_settings_page/site_settings_page.html
@@ -1,12 +1,12 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> -<link rel="import" href="/icons.html"> -<link rel="import" href="/route.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/site_settings/constants.html"> -<link rel="import" href="/site_settings/site_settings_behavior.html"> -<link rel="import" href="/site_settings/site_settings_prefs_browser_proxy.html"> +<link rel="import" href="../icons.html"> +<link rel="import" href="../route.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="../site_settings/constants.html"> +<link rel="import" href="../site_settings/site_settings_behavior.html"> +<link rel="import" href="../site_settings/site_settings_prefs_browser_proxy.html"> <dom-module id="settings-site-settings-page"> <template>
diff --git a/chrome/browser/resources/settings/system_page/system_page.html b/chrome/browser/resources/settings/system_page/system_page.html index 65faa371..6cd6aa2 100644 --- a/chrome/browser/resources/settings/system_page/system_page.html +++ b/chrome/browser/resources/settings/system_page/system_page.html
@@ -1,12 +1,12 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> -<link rel="import" href="/controls/controlled_button.html"> -<link rel="import" href="/controls/extension_controlled_indicator.html"> -<link rel="import" href="/controls/settings_toggle_button.html"> -<link rel="import" href="/lifetime_browser_proxy.html"> -<link rel="import" href="/prefs/prefs.html"> -<link rel="import" href="/settings_shared_css.html"> -<link rel="import" href="/system_page/system_page_browser_proxy.html"> +<link rel="import" href="../controls/controlled_button.html"> +<link rel="import" href="../controls/extension_controlled_indicator.html"> +<link rel="import" href="../controls/settings_toggle_button.html"> +<link rel="import" href="../lifetime_browser_proxy.html"> +<link rel="import" href="../prefs/prefs.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="system_page_browser_proxy.html"> <dom-module id="settings-system-page"> <template>
diff --git a/chrome/browser/ssl/common_name_mismatch_handler.h b/chrome/browser/ssl/common_name_mismatch_handler.h index f1567c2..5d36226 100644 --- a/chrome/browser/ssl/common_name_mismatch_handler.h +++ b/chrome/browser/ssl/common_name_mismatch_handler.h
@@ -41,8 +41,9 @@ IGNORE_REQUESTS_FOR_TESTING }; - typedef base::Callback<void(const SuggestedUrlCheckResult& result, - const GURL& suggested_url)> CheckUrlCallback; + typedef base::Callback<void(SuggestedUrlCheckResult result, + const GURL& suggested_url)> + CheckUrlCallback; CommonNameMismatchHandler( const GURL& request_url,
diff --git a/chrome/browser/ssl/ssl_error_handler.cc b/chrome/browser/ssl/ssl_error_handler.cc index 8f1f2739..8ddc06f 100644 --- a/chrome/browser/ssl/ssl_error_handler.cc +++ b/chrome/browser/ssl/ssl_error_handler.cc
@@ -49,6 +49,8 @@ const base::Feature kSSLCommonNameMismatchHandling{ "SSLCommonNameMismatchHandling", base::FEATURE_ENABLED_BY_DEFAULT}; +const char kHistogram[] = "interstitial.ssl_error_handler"; + // Default delay in milliseconds before displaying the SSL interstitial. // This can be changed in tests. // - If there is a name mismatch and a suggested URL available result arrives @@ -58,20 +60,6 @@ // - Otherwise, an SSL interstitial is displayed. const int64_t kInterstitialDelayInMilliseconds = 3000; -// Events for UMA. -enum SSLErrorHandlerEvent { - HANDLE_ALL, - SHOW_CAPTIVE_PORTAL_INTERSTITIAL_NONOVERRIDABLE, - SHOW_CAPTIVE_PORTAL_INTERSTITIAL_OVERRIDABLE, - SHOW_SSL_INTERSTITIAL_NONOVERRIDABLE, - SHOW_SSL_INTERSTITIAL_OVERRIDABLE, - WWW_MISMATCH_FOUND, - WWW_MISMATCH_URL_AVAILABLE, - WWW_MISMATCH_URL_NOT_AVAILABLE, - SHOW_BAD_CLOCK, - SSL_ERROR_HANDLER_EVENT_COUNT -}; - // Adds a message to console after navigation commits and then, deletes itself. // Also deletes itself if the navigation is stopped. class CommonNameMismatchRedirectObserver @@ -129,9 +117,9 @@ DISALLOW_COPY_AND_ASSIGN(CommonNameMismatchRedirectObserver); }; -void RecordUMA(SSLErrorHandlerEvent event) { - UMA_HISTOGRAM_ENUMERATION("interstitial.ssl_error_handler", event, - SSL_ERROR_HANDLER_EVENT_COUNT); +void RecordUMA(SSLErrorHandler::UMAEvent event) { + UMA_HISTOGRAM_ENUMERATION(kHistogram, event, + SSLErrorHandler::SSL_ERROR_HANDLER_EVENT_COUNT); } #if BUILDFLAG(ENABLE_CAPTIVE_PORTAL_DETECTION) @@ -219,14 +207,139 @@ network_time_tracker_ = tracker; } -static base::LazyInstance<ConfigSingleton>::Leaky g_config = - LAZY_INSTANCE_INITIALIZER; +class SSLErrorHandlerDelegateImpl : public SSLErrorHandler::Delegate { + public: + SSLErrorHandlerDelegateImpl( + content::WebContents* web_contents, + const net::SSLInfo& ssl_info, + Profile* const profile, + int cert_error, + int options_mask, + const GURL& request_url, + std::unique_ptr<SSLCertReporter> ssl_cert_reporter, + const base::Callback<void(content::CertificateRequestResultType)>& + callback) + : web_contents_(web_contents), + ssl_info_(ssl_info), + profile_(profile), + cert_error_(cert_error), + options_mask_(options_mask), + request_url_(request_url), + ssl_cert_reporter_(std::move(ssl_cert_reporter)), + callback_(callback) {} + ~SSLErrorHandlerDelegateImpl() override; + + // SSLErrorHandler::Delegate methods: + void CheckForCaptivePortal() override; + bool GetSuggestedUrl(const std::vector<std::string>& dns_names, + GURL* suggested_url) const override; + void CheckSuggestedUrl( + const GURL& suggested_url, + const CommonNameMismatchHandler::CheckUrlCallback& callback) override; + void NavigateToSuggestedURL(const GURL& suggested_url) override; + bool IsErrorOverridable() const override; + void ShowCaptivePortalInterstitial(const GURL& landing_url) override; + void ShowSSLInterstitial() override; + void ShowBadClockInterstitial(const base::Time& now, + ssl_errors::ClockState clock_state) override; + + private: + content::WebContents* web_contents_; + const net::SSLInfo& ssl_info_; + Profile* const profile_; + const int cert_error_; + const int options_mask_; + const GURL request_url_; + std::unique_ptr<CommonNameMismatchHandler> common_name_mismatch_handler_; + std::unique_ptr<SSLCertReporter> ssl_cert_reporter_; + const base::Callback<void(content::CertificateRequestResultType)> callback_; +}; + +SSLErrorHandlerDelegateImpl::~SSLErrorHandlerDelegateImpl() { + if (common_name_mismatch_handler_) { + common_name_mismatch_handler_->Cancel(); + common_name_mismatch_handler_.reset(); + } +} + +void SSLErrorHandlerDelegateImpl::CheckForCaptivePortal() { +#if BUILDFLAG(ENABLE_CAPTIVE_PORTAL_DETECTION) + CaptivePortalService* captive_portal_service = + CaptivePortalServiceFactory::GetForProfile(profile_); + captive_portal_service->DetectCaptivePortal(); +#else + NOTREACHED(); +#endif +} + +bool SSLErrorHandlerDelegateImpl::GetSuggestedUrl( + const std::vector<std::string>& dns_names, + GURL* suggested_url) const { + return CommonNameMismatchHandler::GetSuggestedUrl(request_url_, dns_names, + suggested_url); +} + +void SSLErrorHandlerDelegateImpl::CheckSuggestedUrl( + const GURL& suggested_url, + const CommonNameMismatchHandler::CheckUrlCallback& callback) { + scoped_refptr<net::URLRequestContextGetter> request_context( + profile_->GetRequestContext()); + common_name_mismatch_handler_.reset( + new CommonNameMismatchHandler(request_url_, request_context)); + + common_name_mismatch_handler_->CheckSuggestedUrl(suggested_url, callback); +} + +void SSLErrorHandlerDelegateImpl::NavigateToSuggestedURL( + const GURL& suggested_url) { + content::NavigationController::LoadURLParams load_params(suggested_url); + load_params.transition_type = ui::PAGE_TRANSITION_TYPED; + web_contents_->GetController().LoadURLWithParams(load_params); +} + +bool SSLErrorHandlerDelegateImpl::IsErrorOverridable() const { + return SSLBlockingPage::IsOverridable(options_mask_, profile_); +} + +void SSLErrorHandlerDelegateImpl::ShowCaptivePortalInterstitial( + const GURL& landing_url) { +#if BUILDFLAG(ENABLE_CAPTIVE_PORTAL_DETECTION) + // Show captive portal blocking page. The interstitial owns the blocking page. + (new CaptivePortalBlockingPage(web_contents_, request_url_, landing_url, + std::move(ssl_cert_reporter_), ssl_info_, + callback_)) + ->Show(); +#else + NOTREACHED(); +#endif +} + +void SSLErrorHandlerDelegateImpl::ShowSSLInterstitial() { + // Show SSL blocking page. The interstitial owns the blocking page. + (SSLBlockingPage::Create(web_contents_, cert_error_, ssl_info_, request_url_, + options_mask_, base::Time::NowFromSystemTime(), + std::move(ssl_cert_reporter_), callback_)) + ->Show(); +} + +void SSLErrorHandlerDelegateImpl::ShowBadClockInterstitial( + const base::Time& now, + ssl_errors::ClockState clock_state) { + // Show bad clock page. The interstitial owns the blocking page. + (new BadClockBlockingPage(web_contents_, cert_error_, ssl_info_, request_url_, + now, clock_state, std::move(ssl_cert_reporter_), + callback_)) + ->Show(); +} } // namespace DEFINE_WEB_CONTENTS_USER_DATA_KEY(SSLErrorHandler); DEFINE_WEB_CONTENTS_USER_DATA_KEY(CommonNameMismatchRedirectObserver); +static base::LazyInstance<ConfigSingleton>::Leaky g_config = + LAZY_INSTANCE_INITIALIZER; + void SSLErrorHandler::HandleSSLError( content::WebContents* web_contents, int cert_error, @@ -237,9 +350,16 @@ const base::Callback<void(content::CertificateRequestResultType)>& callback) { DCHECK(!FromWebContents(web_contents)); - SSLErrorHandler* error_handler = - new SSLErrorHandler(web_contents, cert_error, ssl_info, request_url, - options_mask, std::move(ssl_cert_reporter), callback); + + Profile* profile = + Profile::FromBrowserContext(web_contents->GetBrowserContext()); + + SSLErrorHandler* error_handler = new SSLErrorHandler( + std::unique_ptr<SSLErrorHandler::Delegate>( + new SSLErrorHandlerDelegateImpl( + web_contents, ssl_info, profile, cert_error, options_mask, + request_url, std::move(ssl_cert_reporter), callback)), + web_contents, profile, cert_error, ssl_info, request_url, callback); web_contents->SetUserData(UserDataKey(), error_handler); error_handler->StartHandlingError(); } @@ -267,23 +387,31 @@ g_config.Pointer()->SetNetworkTimeTrackerForTesting(tracker); } +// static +std::string SSLErrorHandler::GetHistogramNameForTesting() { + return kHistogram; +} + +bool SSLErrorHandler::IsTimerRunningForTesting() const { + return timer_.IsRunning(); +} + SSLErrorHandler::SSLErrorHandler( + std::unique_ptr<Delegate> delegate, content::WebContents* web_contents, + Profile* profile, int cert_error, const net::SSLInfo& ssl_info, const GURL& request_url, - int options_mask, - std::unique_ptr<SSLCertReporter> ssl_cert_reporter, const base::Callback<void(content::CertificateRequestResultType)>& callback) : content::WebContentsObserver(web_contents), + delegate_(std::move(delegate)), web_contents_(web_contents), + profile_(profile), cert_error_(cert_error), ssl_info_(ssl_info), request_url_(request_url), - options_mask_(options_mask), callback_(callback), - profile_(Profile::FromBrowserContext(web_contents->GetBrowserContext())), - ssl_cert_reporter_(std::move(ssl_cert_reporter)), weak_ptr_factory_(this) {} SSLErrorHandler::~SSLErrorHandler() { @@ -304,7 +432,8 @@ GURL suggested_url; if (IsSSLCommonNameMismatchHandlingEnabled() && cert_error_ == net::ERR_CERT_COMMON_NAME_INVALID && - IsErrorOverridable() && GetSuggestedUrl(dns_names, &suggested_url)) { + delegate_->IsErrorOverridable() && + delegate_->GetSuggestedUrl(dns_names, &suggested_url)) { RecordUMA(WWW_MISMATCH_FOUND); net::CertStatus extra_cert_errors = ssl_info_.cert_status ^ net::CERT_STATUS_COMMON_NAME_INVALID; @@ -317,7 +446,10 @@ ShowSSLInterstitial(); return; } - CheckSuggestedUrl(suggested_url); + delegate_->CheckSuggestedUrl( + suggested_url, + base::Bind(&SSLErrorHandler::CommonNameMismatchHandlerCallback, + weak_ptr_factory_.GetWeakPtr())); timer_.Start(FROM_HERE, g_config.Pointer()->interstitial_delay(), this, &SSLErrorHandler::ShowSSLInterstitial); @@ -330,6 +462,12 @@ return; } + // Always listen to captive portal notifications, otherwise build fails + // because profile_ isn't used. This is a no-op on platforms where + // captive portal detection is disabled. + registrar_.Add(this, chrome::NOTIFICATION_CAPTIVE_PORTAL_CHECK_RESULT, + content::Source<Profile>(profile_)); + #if BUILDFLAG(ENABLE_CAPTIVE_PORTAL_DETECTION) CaptivePortalTabHelper* captive_portal_tab_helper = CaptivePortalTabHelper::FromWebContents(web_contents_); @@ -337,11 +475,8 @@ captive_portal_tab_helper->OnSSLCertError(ssl_info_); } - registrar_.Add(this, chrome::NOTIFICATION_CAPTIVE_PORTAL_CHECK_RESULT, - content::Source<Profile>(profile_)); - if (IsCaptivePortalInterstitialEnabled()) { - CheckForCaptivePortal(); + delegate_->CheckForCaptivePortal(); timer_.Start(FROM_HERE, g_config.Pointer()->interstitial_delay(), this, &SSLErrorHandler::ShowSSLInterstitial); if (g_config.Pointer()->timer_started_callback()) @@ -353,54 +488,13 @@ ShowSSLInterstitial(); } -void SSLErrorHandler::CheckForCaptivePortal() { -#if BUILDFLAG(ENABLE_CAPTIVE_PORTAL_DETECTION) - CaptivePortalService* captive_portal_service = - CaptivePortalServiceFactory::GetForProfile(profile_); - captive_portal_service->DetectCaptivePortal(); -#else - NOTREACHED(); -#endif -} - -bool SSLErrorHandler::GetSuggestedUrl(const std::vector<std::string>& dns_names, - GURL* suggested_url) const { - return CommonNameMismatchHandler::GetSuggestedUrl(request_url_, dns_names, - suggested_url); -} - -void SSLErrorHandler::CheckSuggestedUrl(const GURL& suggested_url) { - scoped_refptr<net::URLRequestContextGetter> request_context( - profile_->GetRequestContext()); - common_name_mismatch_handler_.reset( - new CommonNameMismatchHandler(request_url_, request_context)); - - common_name_mismatch_handler_->CheckSuggestedUrl( - suggested_url, - base::Bind(&SSLErrorHandler::CommonNameMismatchHandlerCallback, - base::Unretained(this))); -} - -void SSLErrorHandler::NavigateToSuggestedURL(const GURL& suggested_url) { - content::NavigationController::LoadURLParams load_params(suggested_url); - load_params.transition_type = ui::PAGE_TRANSITION_TYPED; - web_contents()->GetController().LoadURLWithParams(load_params); -} - -bool SSLErrorHandler::IsErrorOverridable() const { - return SSLBlockingPage::IsOverridable(options_mask_, profile_); -} - void SSLErrorHandler::ShowCaptivePortalInterstitial(const GURL& landing_url) { #if BUILDFLAG(ENABLE_CAPTIVE_PORTAL_DETECTION) // Show captive portal blocking page. The interstitial owns the blocking page. - RecordUMA(IsErrorOverridable() + RecordUMA(delegate_->IsErrorOverridable() ? SHOW_CAPTIVE_PORTAL_INTERSTITIAL_OVERRIDABLE : SHOW_CAPTIVE_PORTAL_INTERSTITIAL_NONOVERRIDABLE); - (new CaptivePortalBlockingPage(web_contents_, request_url_, landing_url, - std::move(ssl_cert_reporter_), ssl_info_, - callback_)) - ->Show(); + delegate_->ShowCaptivePortalInterstitial(landing_url); // Once an interstitial is displayed, no need to keep the handler around. // This is the equivalent of "delete this". It also destroys the timer. web_contents_->RemoveUserData(UserDataKey()); @@ -411,13 +505,10 @@ void SSLErrorHandler::ShowSSLInterstitial() { // Show SSL blocking page. The interstitial owns the blocking page. - RecordUMA(IsErrorOverridable() ? SHOW_SSL_INTERSTITIAL_OVERRIDABLE - : SHOW_SSL_INTERSTITIAL_NONOVERRIDABLE); - - (SSLBlockingPage::Create(web_contents_, cert_error_, ssl_info_, request_url_, - options_mask_, base::Time::NowFromSystemTime(), - std::move(ssl_cert_reporter_), callback_)) - ->Show(); + RecordUMA(delegate_->IsErrorOverridable() + ? SHOW_SSL_INTERSTITIAL_OVERRIDABLE + : SHOW_SSL_INTERSTITIAL_NONOVERRIDABLE); + delegate_->ShowSSLInterstitial(); // Once an interstitial is displayed, no need to keep the handler around. // This is the equivalent of "delete this". web_contents_->RemoveUserData(UserDataKey()); @@ -427,17 +518,14 @@ const base::Time& now, ssl_errors::ClockState clock_state) { RecordUMA(SHOW_BAD_CLOCK); - (new BadClockBlockingPage(web_contents_, cert_error_, ssl_info_, request_url_, - now, clock_state, std::move(ssl_cert_reporter_), - callback_)) - ->Show(); + delegate_->ShowBadClockInterstitial(now, clock_state); // Once an interstitial is displayed, no need to keep the handler around. // This is the equivalent of "delete this". web_contents_->RemoveUserData(UserDataKey()); } void SSLErrorHandler::CommonNameMismatchHandlerCallback( - const CommonNameMismatchHandler::SuggestedUrlCheckResult& result, + CommonNameMismatchHandler::SuggestedUrlCheckResult result, const GURL& suggested_url) { timer_.Stop(); if (result == CommonNameMismatchHandler::SuggestedUrlCheckResult:: @@ -445,7 +533,7 @@ RecordUMA(WWW_MISMATCH_URL_AVAILABLE); CommonNameMismatchRedirectObserver::AddToConsoleAfterNavigation( web_contents(), request_url_.host(), suggested_url.host()); - NavigateToSuggestedURL(suggested_url); + delegate_->NavigateToSuggestedURL(suggested_url); } else { RecordUMA(WWW_MISMATCH_URL_NOT_AVAILABLE); ShowSSLInterstitial(); @@ -466,6 +554,8 @@ ShowCaptivePortalInterstitial(results->landing_url); else ShowSSLInterstitial(); +#else + NOTREACHED(); #endif } @@ -492,10 +582,7 @@ base::ResetAndReturn(&callback_) .Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY); } - if (common_name_mismatch_handler_) { - common_name_mismatch_handler_->Cancel(); - common_name_mismatch_handler_.reset(); - } + delegate_.reset(); // Deletes |this| and also destroys the timer. web_contents_->RemoveUserData(UserDataKey()); }
diff --git a/chrome/browser/ssl/ssl_error_handler.h b/chrome/browser/ssl/ssl_error_handler.h index c213c47..bdc443a 100644 --- a/chrome/browser/ssl/ssl_error_handler.h +++ b/chrome/browser/ssl/ssl_error_handler.h
@@ -60,6 +60,41 @@ public: typedef base::Callback<void(content::WebContents*)> TimerStartedCallback; + // Events for UMA. Do not rename or remove values, add new values to the end. + // Public for testing. + enum UMAEvent { + HANDLE_ALL = 0, + SHOW_CAPTIVE_PORTAL_INTERSTITIAL_NONOVERRIDABLE, + SHOW_CAPTIVE_PORTAL_INTERSTITIAL_OVERRIDABLE, + SHOW_SSL_INTERSTITIAL_NONOVERRIDABLE, + SHOW_SSL_INTERSTITIAL_OVERRIDABLE, + WWW_MISMATCH_FOUND, + WWW_MISMATCH_URL_AVAILABLE, + WWW_MISMATCH_URL_NOT_AVAILABLE, + SHOW_BAD_CLOCK, + SSL_ERROR_HANDLER_EVENT_COUNT + }; + + // This delegate allows unit tests to provide their own Chrome specific + // actions. + class Delegate { + public: + virtual ~Delegate() {} + virtual void CheckForCaptivePortal() = 0; + virtual bool GetSuggestedUrl(const std::vector<std::string>& dns_names, + GURL* suggested_url) const = 0; + virtual void CheckSuggestedUrl( + const GURL& suggested_url, + const CommonNameMismatchHandler::CheckUrlCallback& callback) = 0; + virtual void NavigateToSuggestedURL(const GURL& suggested_url) = 0; + virtual bool IsErrorOverridable() const = 0; + virtual void ShowCaptivePortalInterstitial(const GURL& landing_url) = 0; + virtual void ShowSSLInterstitial() = 0; + virtual void ShowBadClockInterstitial( + const base::Time& now, + ssl_errors::ClockState clock_state) = 0; + }; + // Entry point for the class. The parameters are the same as SSLBlockingPage // constructor. static void HandleSSLError( @@ -80,45 +115,39 @@ static void SetClockForTesting(base::Clock* testing_clock); static void SetNetworkTimeTrackerForTesting( network_time::NetworkTimeTracker* tracker); + static std::string GetHistogramNameForTesting(); + bool IsTimerRunningForTesting() const; protected: - // The parameters are the same as SSLBlockingPage's constructor. - SSLErrorHandler(content::WebContents* web_contents, - int cert_error, - const net::SSLInfo& ssl_info, - const GURL& request_url, - int options_mask, - std::unique_ptr<SSLCertReporter> ssl_cert_reporter, - const base::Callback< - void(content::CertificateRequestResultType)>& callback); + SSLErrorHandler( + std::unique_ptr<Delegate> delegate, + content::WebContents* web_contents, + Profile* profile, + int cert_error, + const net::SSLInfo& ssl_info, + const GURL& request_url, + const base::Callback<void(content::CertificateRequestResultType)>& + callback); ~SSLErrorHandler() override; // Called when an SSL cert error is encountered. Triggers a captive portal // check and fires a one shot timer to wait for a "captive portal detected" - // result to arrive. + // result to arrive. Protected for testing. void StartHandlingError(); - const base::OneShotTimer& get_timer() const { return timer_; } - // These are virtual for tests: - virtual void CheckForCaptivePortal(); - virtual bool GetSuggestedUrl(const std::vector<std::string>& dns_names, - GURL* suggested_url) const; - virtual void CheckSuggestedUrl(const GURL& suggested_url); - virtual void NavigateToSuggestedURL(const GURL& suggested_url); - virtual bool IsErrorOverridable() const; - virtual void ShowCaptivePortalInterstitial(const GURL& landing_url); - virtual void ShowSSLInterstitial(); - virtual void ShowBadClockInterstitial(const base::Time& now, - ssl_errors::ClockState clock_state); + private: + void ShowCaptivePortalInterstitial(const GURL& landing_url); + void ShowSSLInterstitial(); + void ShowBadClockInterstitial(const base::Time& now, + ssl_errors::ClockState clock_state); // Gets the result of whether the suggested URL is valid. Displays // common name mismatch interstitial or ssl interstitial accordingly. void CommonNameMismatchHandlerCallback( - const CommonNameMismatchHandler::SuggestedUrlCheckResult& result, + CommonNameMismatchHandler::SuggestedUrlCheckResult result, const GURL& suggested_url); - private: // content::NotificationObserver: void Observe( int type, @@ -139,21 +168,19 @@ void HandleCertDateInvalidError(); void HandleCertDateInvalidErrorImpl(base::TimeTicks started_handling_error); - content::WebContents* web_contents_; + std::unique_ptr<Delegate> delegate_; + content::WebContents* const web_contents_; + Profile* const profile_; const int cert_error_; const net::SSLInfo ssl_info_; const GURL request_url_; - const int options_mask_; base::Callback<void(content::CertificateRequestResultType)> callback_; - Profile* const profile_; content::NotificationRegistrar registrar_; base::OneShotTimer timer_; std::unique_ptr<CommonNameMismatchHandler> common_name_mismatch_handler_; - std::unique_ptr<SSLCertReporter> ssl_cert_reporter_; - base::WeakPtrFactory<SSLErrorHandler> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(SSLErrorHandler);
diff --git a/chrome/browser/ssl/ssl_error_handler_unittest.cc b/chrome/browser/ssl/ssl_error_handler_unittest.cc index b7eb8b6c..680a98a 100644 --- a/chrome/browser/ssl/ssl_error_handler_unittest.cc +++ b/chrome/browser/ssl/ssl_error_handler_unittest.cc
@@ -43,22 +43,44 @@ const char kCertDateErrorHistogram[] = "interstitial.ssl_error_handler.cert_date_error_delay"; -} // namespace +// Runs |quit_closure| on the UI thread once a URL request has been +// seen. Returns a request that hangs. +std::unique_ptr<net::test_server::HttpResponse> WaitForRequest( + const base::Closure& quit_closure, + const net::test_server::HttpRequest& request) { + content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, + quit_closure); + return base::MakeUnique<net::test_server::HungResponse>(); +} -class SSLErrorHandlerForTest : public SSLErrorHandler { +class TestSSLErrorHandler : public SSLErrorHandler { public: - SSLErrorHandlerForTest(Profile* profile, - content::WebContents* web_contents, - const net::SSLInfo& ssl_info) - : SSLErrorHandler( - web_contents, - net::MapCertStatusToNetError(ssl_info.cert_status), - ssl_info, - GURL(), - 0, - nullptr, - base::Callback<void(content::CertificateRequestResultType)>()), - profile_(profile), + TestSSLErrorHandler( + std::unique_ptr<Delegate> delegate, + content::WebContents* web_contents, + Profile* profile, + int cert_error, + const net::SSLInfo& ssl_info, + const GURL& request_url, + const base::Callback<void(content::CertificateRequestResultType)>& + callback) + : SSLErrorHandler(std::move(delegate), + web_contents, + profile, + cert_error, + ssl_info, + request_url, + callback) {} + + using SSLErrorHandler::StartHandlingError; +}; + +class TestSSLErrorHandlerDelegate : public SSLErrorHandler::Delegate { + public: + TestSSLErrorHandlerDelegate(Profile* profile, + content::WebContents* web_contents, + const net::SSLInfo& ssl_info) + : profile_(profile), captive_portal_checked_(false), suggested_url_exists_(false), suggested_url_checked_(false), @@ -68,8 +90,6 @@ redirected_to_suggested_url_(false), is_overridable_error_(true) {} - using SSLErrorHandler::StartHandlingError; - void SendCaptivePortalNotification( captive_portal::CaptivePortalResult result) { CaptivePortalService::Results results; @@ -84,10 +104,9 @@ void SendSuggestedUrlCheckResult( const CommonNameMismatchHandler::SuggestedUrlCheckResult& result, const GURL& suggested_url) { - CommonNameMismatchHandlerCallback(result, suggested_url); + suggested_url_callback_.Run(result, suggested_url); } - bool IsTimerRunning() const { return get_timer().IsRunning(); } int captive_portal_checked() const { return captive_portal_checked_; } int ssl_interstitial_shown() const { return ssl_interstitial_shown_; } int captive_portal_interstitial_shown() const { @@ -138,8 +157,12 @@ captive_portal_interstitial_shown_ = true; } - void CheckSuggestedUrl(const GURL& suggested_url) override { + void CheckSuggestedUrl( + const GURL& suggested_url, + const CommonNameMismatchHandler::CheckUrlCallback& callback) override { + DCHECK(suggested_url_callback_.is_null()); suggested_url_checked_ = true; + suggested_url_callback_ = callback; } void NavigateToSuggestedURL(const GURL& suggested_url) override { @@ -157,10 +180,13 @@ bool captive_portal_interstitial_shown_; bool redirected_to_suggested_url_; bool is_overridable_error_; + CommonNameMismatchHandler::CheckUrlCallback suggested_url_callback_; - DISALLOW_COPY_AND_ASSIGN(SSLErrorHandlerForTest); + DISALLOW_COPY_AND_ASSIGN(TestSSLErrorHandlerDelegate); }; +} // namespace + class SSLErrorHandlerNameMismatchTest : public ChromeRenderViewHostTestHarness { public: SSLErrorHandlerNameMismatchTest() : field_trial_list_(nullptr) {} @@ -171,8 +197,16 @@ ssl_info_.cert = net::ImportCertFromFile(net::GetTestCertsDirectory(), "ok_cert.pem"); ssl_info_.cert_status = net::CERT_STATUS_COMMON_NAME_INVALID; - error_handler_.reset( - new SSLErrorHandlerForTest(profile(), web_contents(), ssl_info_)); + + delegate_ = + new TestSSLErrorHandlerDelegate(profile(), web_contents(), ssl_info_); + error_handler_.reset(new TestSSLErrorHandler( + std::unique_ptr<SSLErrorHandler::Delegate>(delegate_), web_contents(), + profile(), net::MapCertStatusToNetError(ssl_info_.cert_status), + ssl_info_, + GURL(), // request_url + base::Callback<void(content::CertificateRequestResultType)>())); + // Enable finch experiment for captive portal interstitials. ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( "CaptivePortalInterstitial", "Enabled")); @@ -182,16 +216,18 @@ } void TearDown() override { - EXPECT_FALSE(error_handler()->IsTimerRunning()); + EXPECT_FALSE(error_handler()->IsTimerRunningForTesting()); error_handler_.reset(nullptr); ChromeRenderViewHostTestHarness::TearDown(); } - SSLErrorHandlerForTest* error_handler() { return error_handler_.get(); } + TestSSLErrorHandler* error_handler() { return error_handler_.get(); } + TestSSLErrorHandlerDelegate* delegate() { return delegate_; } private: net::SSLInfo ssl_info_; - std::unique_ptr<SSLErrorHandlerForTest> error_handler_; + std::unique_ptr<TestSSLErrorHandler> error_handler_; + TestSSLErrorHandlerDelegate* delegate_; base::FieldTrialList field_trial_list_; DISALLOW_COPY_AND_ASSIGN(SSLErrorHandlerNameMismatchTest); @@ -229,8 +265,15 @@ ssl_info_.cert = net::ImportCertFromFile(net::GetTestCertsDirectory(), "ok_cert.pem"); ssl_info_.cert_status = net::CERT_STATUS_DATE_INVALID; - error_handler_.reset( - new SSLErrorHandlerForTest(profile(), web_contents(), ssl_info_)); + + delegate_ = + new TestSSLErrorHandlerDelegate(profile(), web_contents(), ssl_info_); + error_handler_.reset(new TestSSLErrorHandler( + std::unique_ptr<SSLErrorHandler::Delegate>(delegate_), web_contents(), + profile(), net::MapCertStatusToNetError(ssl_info_.cert_status), + ssl_info_, + GURL(), // request_url + base::Callback<void(content::CertificateRequestResultType)>())); error_handler_->SetNetworkTimeTrackerForTesting(tracker_.get()); // Fix flakiness in case system time is off and triggers a bad clock @@ -240,13 +283,14 @@ void TearDown() override { if (error_handler()) { - EXPECT_FALSE(error_handler()->IsTimerRunning()); + EXPECT_FALSE(error_handler()->IsTimerRunningForTesting()); error_handler_.reset(nullptr); } ChromeRenderViewHostTestHarness::TearDown(); } - SSLErrorHandlerForTest* error_handler() { return error_handler_.get(); } + TestSSLErrorHandler* error_handler() { return error_handler_.get(); } + TestSSLErrorHandlerDelegate* delegate() { return delegate_; } network_time::FieldTrialTest* field_trial_test() { return field_trial_test_.get(); @@ -260,7 +304,9 @@ private: net::SSLInfo ssl_info_; - std::unique_ptr<SSLErrorHandlerForTest> error_handler_; + std::unique_ptr<TestSSLErrorHandler> error_handler_; + TestSSLErrorHandlerDelegate* delegate_; + std::unique_ptr<network_time::FieldTrialTest> field_trial_test_; base::SimpleTestClock* clock_; base::SimpleTestTickClock* tick_clock_; @@ -275,181 +321,275 @@ TEST_F(SSLErrorHandlerNameMismatchTest, ShouldShowSSLInterstitialOnTimerExpired) { - EXPECT_FALSE(error_handler()->IsTimerRunning()); + base::HistogramTester histograms; + EXPECT_FALSE(error_handler()->IsTimerRunningForTesting()); error_handler()->StartHandlingError(); - EXPECT_TRUE(error_handler()->IsTimerRunning()); - EXPECT_TRUE(error_handler()->captive_portal_checked()); - EXPECT_FALSE(error_handler()->ssl_interstitial_shown()); - EXPECT_FALSE(error_handler()->captive_portal_interstitial_shown()); + EXPECT_TRUE(error_handler()->IsTimerRunningForTesting()); + EXPECT_TRUE(delegate()->captive_portal_checked()); + EXPECT_FALSE(delegate()->ssl_interstitial_shown()); + EXPECT_FALSE(delegate()->captive_portal_interstitial_shown()); - error_handler()->ClearSeenOperations(); + delegate()->ClearSeenOperations(); base::RunLoop().RunUntilIdle(); - EXPECT_FALSE(error_handler()->IsTimerRunning()); - EXPECT_FALSE(error_handler()->captive_portal_checked()); - EXPECT_TRUE(error_handler()->ssl_interstitial_shown()); - EXPECT_FALSE(error_handler()->captive_portal_interstitial_shown()); + EXPECT_FALSE(error_handler()->IsTimerRunningForTesting()); + EXPECT_FALSE(delegate()->captive_portal_checked()); + EXPECT_TRUE(delegate()->ssl_interstitial_shown()); + EXPECT_FALSE(delegate()->captive_portal_interstitial_shown()); + + histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), 2); + histograms.ExpectBucketCount(SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::HANDLE_ALL, 1); + histograms.ExpectBucketCount( + SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::SHOW_SSL_INTERSTITIAL_OVERRIDABLE, 1); } TEST_F(SSLErrorHandlerNameMismatchTest, ShouldShowCustomInterstitialOnCaptivePortalResult) { - EXPECT_FALSE(error_handler()->IsTimerRunning()); + base::HistogramTester histograms; + EXPECT_FALSE(error_handler()->IsTimerRunningForTesting()); error_handler()->StartHandlingError(); - EXPECT_TRUE(error_handler()->IsTimerRunning()); - EXPECT_TRUE(error_handler()->captive_portal_checked()); - EXPECT_FALSE(error_handler()->ssl_interstitial_shown()); - EXPECT_FALSE(error_handler()->captive_portal_interstitial_shown()); + EXPECT_TRUE(error_handler()->IsTimerRunningForTesting()); + EXPECT_TRUE(delegate()->captive_portal_checked()); + EXPECT_FALSE(delegate()->ssl_interstitial_shown()); + EXPECT_FALSE(delegate()->captive_portal_interstitial_shown()); // Fake a captive portal result. - error_handler()->ClearSeenOperations(); - error_handler()->SendCaptivePortalNotification( + delegate()->ClearSeenOperations(); + delegate()->SendCaptivePortalNotification( captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL); base::RunLoop().RunUntilIdle(); - EXPECT_FALSE(error_handler()->IsTimerRunning()); - EXPECT_FALSE(error_handler()->captive_portal_checked()); - EXPECT_FALSE(error_handler()->ssl_interstitial_shown()); - EXPECT_TRUE(error_handler()->captive_portal_interstitial_shown()); + EXPECT_FALSE(error_handler()->IsTimerRunningForTesting()); + EXPECT_FALSE(delegate()->captive_portal_checked()); + EXPECT_FALSE(delegate()->ssl_interstitial_shown()); + EXPECT_TRUE(delegate()->captive_portal_interstitial_shown()); + + histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), 2); + histograms.ExpectBucketCount(SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::HANDLE_ALL, 1); + histograms.ExpectBucketCount( + SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::SHOW_CAPTIVE_PORTAL_INTERSTITIAL_OVERRIDABLE, 1); } TEST_F(SSLErrorHandlerNameMismatchTest, ShouldShowSSLInterstitialOnNoCaptivePortalResult) { - EXPECT_FALSE(error_handler()->IsTimerRunning()); + base::HistogramTester histograms; + EXPECT_FALSE(error_handler()->IsTimerRunningForTesting()); error_handler()->StartHandlingError(); - EXPECT_TRUE(error_handler()->IsTimerRunning()); - EXPECT_TRUE(error_handler()->captive_portal_checked()); - EXPECT_FALSE(error_handler()->ssl_interstitial_shown()); - EXPECT_FALSE(error_handler()->captive_portal_interstitial_shown()); + EXPECT_TRUE(error_handler()->IsTimerRunningForTesting()); + EXPECT_TRUE(delegate()->captive_portal_checked()); + EXPECT_FALSE(delegate()->ssl_interstitial_shown()); + EXPECT_FALSE(delegate()->captive_portal_interstitial_shown()); // Fake a "connected to internet" result for the captive portal check. // This should immediately trigger an SSL interstitial without waiting for // the timer to expire. - error_handler()->ClearSeenOperations(); - error_handler()->SendCaptivePortalNotification( + delegate()->ClearSeenOperations(); + delegate()->SendCaptivePortalNotification( captive_portal::RESULT_INTERNET_CONNECTED); base::RunLoop().RunUntilIdle(); - EXPECT_FALSE(error_handler()->IsTimerRunning()); - EXPECT_FALSE(error_handler()->captive_portal_checked()); - EXPECT_TRUE(error_handler()->ssl_interstitial_shown()); - EXPECT_FALSE(error_handler()->captive_portal_interstitial_shown()); + EXPECT_FALSE(error_handler()->IsTimerRunningForTesting()); + EXPECT_FALSE(delegate()->captive_portal_checked()); + EXPECT_TRUE(delegate()->ssl_interstitial_shown()); + EXPECT_FALSE(delegate()->captive_portal_interstitial_shown()); + + histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), 2); + histograms.ExpectBucketCount(SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::HANDLE_ALL, 1); + histograms.ExpectBucketCount( + SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::SHOW_SSL_INTERSTITIAL_OVERRIDABLE, 1); } TEST_F(SSLErrorHandlerNameMismatchTest, ShouldNotCheckSuggestedUrlIfNoSuggestedUrl) { + base::HistogramTester histograms; error_handler()->StartHandlingError(); - EXPECT_TRUE(error_handler()->captive_portal_checked()); - EXPECT_TRUE(error_handler()->IsTimerRunning()); - EXPECT_FALSE(error_handler()->suggested_url_checked()); + EXPECT_TRUE(delegate()->captive_portal_checked()); + EXPECT_TRUE(error_handler()->IsTimerRunningForTesting()); + EXPECT_FALSE(delegate()->suggested_url_checked()); base::RunLoop().RunUntilIdle(); - EXPECT_FALSE(error_handler()->IsTimerRunning()); - EXPECT_TRUE(error_handler()->ssl_interstitial_shown()); + EXPECT_FALSE(error_handler()->IsTimerRunningForTesting()); + EXPECT_TRUE(delegate()->ssl_interstitial_shown()); + + histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), 2); + histograms.ExpectBucketCount(SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::HANDLE_ALL, 1); + histograms.ExpectBucketCount( + SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::SHOW_SSL_INTERSTITIAL_OVERRIDABLE, 1); } TEST_F(SSLErrorHandlerNameMismatchTest, ShouldNotCheckCaptivePortalIfSuggestedUrlExists) { - EXPECT_FALSE(error_handler()->IsTimerRunning()); - error_handler()->set_suggested_url_exists(); + base::HistogramTester histograms; + EXPECT_FALSE(error_handler()->IsTimerRunningForTesting()); + delegate()->set_suggested_url_exists(); error_handler()->StartHandlingError(); - EXPECT_TRUE(error_handler()->IsTimerRunning()); - EXPECT_TRUE(error_handler()->suggested_url_checked()); - EXPECT_FALSE(error_handler()->captive_portal_checked()); + EXPECT_TRUE(error_handler()->IsTimerRunningForTesting()); + EXPECT_TRUE(delegate()->suggested_url_checked()); + EXPECT_FALSE(delegate()->captive_portal_checked()); base::RunLoop().RunUntilIdle(); - EXPECT_FALSE(error_handler()->IsTimerRunning()); - EXPECT_TRUE(error_handler()->ssl_interstitial_shown()); + EXPECT_FALSE(error_handler()->IsTimerRunningForTesting()); + EXPECT_TRUE(delegate()->ssl_interstitial_shown()); + + // Note that the suggested URL check is never completed, so there is no entry + // for WWW_MISMATCH_URL_AVAILABLE or WWW_MISMATCH_URL_NOT_AVAILABLE. + histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), 3); + histograms.ExpectBucketCount(SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::HANDLE_ALL, 1); + histograms.ExpectBucketCount(SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::WWW_MISMATCH_FOUND, 1); + histograms.ExpectBucketCount( + SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::SHOW_SSL_INTERSTITIAL_OVERRIDABLE, 1); } TEST_F(SSLErrorHandlerNameMismatchTest, ShouldNotHandleNameMismatchOnNonOverridableError) { - error_handler()->set_non_overridable_error(); - error_handler()->set_suggested_url_exists(); + base::HistogramTester histograms; + delegate()->set_non_overridable_error(); + delegate()->set_suggested_url_exists(); error_handler()->StartHandlingError(); - EXPECT_FALSE(error_handler()->suggested_url_checked()); - EXPECT_TRUE(error_handler()->captive_portal_checked()); - EXPECT_TRUE(error_handler()->IsTimerRunning()); + EXPECT_FALSE(delegate()->suggested_url_checked()); + EXPECT_TRUE(delegate()->captive_portal_checked()); + EXPECT_TRUE(error_handler()->IsTimerRunningForTesting()); base::RunLoop().RunUntilIdle(); - EXPECT_FALSE(error_handler()->IsTimerRunning()); - EXPECT_TRUE(error_handler()->ssl_interstitial_shown()); + EXPECT_FALSE(error_handler()->IsTimerRunningForTesting()); + EXPECT_TRUE(delegate()->ssl_interstitial_shown()); + + histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), 2); + histograms.ExpectBucketCount(SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::HANDLE_ALL, 1); + histograms.ExpectBucketCount( + SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::SHOW_SSL_INTERSTITIAL_NONOVERRIDABLE, 1); } #else // #if !BUILDFLAG(ENABLE_CAPTIVE_PORTAL_DETECTION) TEST_F(SSLErrorHandlerNameMismatchTest, ShouldShowSSLInterstitialOnCaptivePortalDetectionDisabled) { - EXPECT_FALSE(error_handler()->IsTimerRunning()); + base::HistogramTester histograms; + EXPECT_FALSE(error_handler()->IsTimerRunningForTesting()); error_handler()->StartHandlingError(); - EXPECT_FALSE(error_handler()->IsTimerRunning()); - EXPECT_FALSE(error_handler()->captive_portal_checked()); - EXPECT_TRUE(error_handler()->ssl_interstitial_shown()); - EXPECT_FALSE(error_handler()->captive_portal_interstitial_shown()); + EXPECT_FALSE(error_handler()->IsTimerRunningForTesting()); + EXPECT_FALSE(delegate()->captive_portal_checked()); + EXPECT_TRUE(delegate()->ssl_interstitial_shown()); + EXPECT_FALSE(delegate()->captive_portal_interstitial_shown()); + + histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), 2); + histograms.ExpectBucketCount(SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::HANDLE_ALL, 1); + histograms.ExpectBucketCount( + SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::SHOW_SSL_INTERSTITIAL_OVERRIDABLE, 1); } #endif // BUILDFLAG(ENABLE_CAPTIVE_PORTAL_DETECTION) TEST_F(SSLErrorHandlerNameMismatchTest, ShouldShowSSLInterstitialOnTimerExpiredWhenSuggestedUrlExists) { - error_handler()->set_suggested_url_exists(); + base::HistogramTester histograms; + delegate()->set_suggested_url_exists(); error_handler()->StartHandlingError(); - EXPECT_TRUE(error_handler()->IsTimerRunning()); - EXPECT_TRUE(error_handler()->suggested_url_checked()); - EXPECT_FALSE(error_handler()->ssl_interstitial_shown()); - EXPECT_FALSE(error_handler()->redirected_to_suggested_url()); + EXPECT_TRUE(error_handler()->IsTimerRunningForTesting()); + EXPECT_TRUE(delegate()->suggested_url_checked()); + EXPECT_FALSE(delegate()->ssl_interstitial_shown()); + EXPECT_FALSE(delegate()->redirected_to_suggested_url()); base::RunLoop().RunUntilIdle(); - EXPECT_FALSE(error_handler()->IsTimerRunning()); - EXPECT_TRUE(error_handler()->ssl_interstitial_shown()); - EXPECT_FALSE(error_handler()->redirected_to_suggested_url()); + EXPECT_FALSE(error_handler()->IsTimerRunningForTesting()); + EXPECT_TRUE(delegate()->ssl_interstitial_shown()); + EXPECT_FALSE(delegate()->redirected_to_suggested_url()); + + // Note that the suggested URL check is never completed, so there is no entry + // for WWW_MISMATCH_URL_AVAILABLE or WWW_MISMATCH_URL_NOT_AVAILABLE. + histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), 3); + histograms.ExpectBucketCount(SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::HANDLE_ALL, 1); + histograms.ExpectBucketCount(SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::WWW_MISMATCH_FOUND, 1); + histograms.ExpectBucketCount( + SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::SHOW_SSL_INTERSTITIAL_OVERRIDABLE, 1); } TEST_F(SSLErrorHandlerNameMismatchTest, ShouldRedirectOnSuggestedUrlCheckResult) { - error_handler()->set_suggested_url_exists(); + base::HistogramTester histograms; + delegate()->set_suggested_url_exists(); error_handler()->StartHandlingError(); - EXPECT_TRUE(error_handler()->IsTimerRunning()); - EXPECT_TRUE(error_handler()->suggested_url_checked()); - EXPECT_FALSE(error_handler()->ssl_interstitial_shown()); - EXPECT_FALSE(error_handler()->redirected_to_suggested_url()); + EXPECT_TRUE(error_handler()->IsTimerRunningForTesting()); + EXPECT_TRUE(delegate()->suggested_url_checked()); + EXPECT_FALSE(delegate()->ssl_interstitial_shown()); + EXPECT_FALSE(delegate()->redirected_to_suggested_url()); // Fake a valid suggested URL check result. // The URL returned by |SuggestedUrlCheckResult| can be different from // |suggested_url|, if there is a redirect. - error_handler()->SendSuggestedUrlCheckResult( + delegate()->SendSuggestedUrlCheckResult( CommonNameMismatchHandler::SuggestedUrlCheckResult:: SUGGESTED_URL_AVAILABLE, GURL("https://random.example.com")); - EXPECT_FALSE(error_handler()->IsTimerRunning()); - EXPECT_FALSE(error_handler()->ssl_interstitial_shown()); - EXPECT_TRUE(error_handler()->redirected_to_suggested_url()); + EXPECT_FALSE(error_handler()->IsTimerRunningForTesting()); + EXPECT_FALSE(delegate()->ssl_interstitial_shown()); + EXPECT_TRUE(delegate()->redirected_to_suggested_url()); + + histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), 3); + histograms.ExpectBucketCount(SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::HANDLE_ALL, 1); + histograms.ExpectBucketCount(SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::WWW_MISMATCH_FOUND, 1); + histograms.ExpectBucketCount(SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::WWW_MISMATCH_URL_AVAILABLE, 1); } TEST_F(SSLErrorHandlerNameMismatchTest, ShouldShowSSLInterstitialOnInvalidUrlCheckResult) { - error_handler()->set_suggested_url_exists(); + base::HistogramTester histograms; + delegate()->set_suggested_url_exists(); error_handler()->StartHandlingError(); - EXPECT_TRUE(error_handler()->IsTimerRunning()); - EXPECT_TRUE(error_handler()->suggested_url_checked()); - EXPECT_FALSE(error_handler()->ssl_interstitial_shown()); - EXPECT_FALSE(error_handler()->redirected_to_suggested_url()); + EXPECT_TRUE(error_handler()->IsTimerRunningForTesting()); + EXPECT_TRUE(delegate()->suggested_url_checked()); + EXPECT_FALSE(delegate()->ssl_interstitial_shown()); + EXPECT_FALSE(delegate()->redirected_to_suggested_url()); // Fake an Invalid Suggested URL Check result. - error_handler()->SendSuggestedUrlCheckResult( + delegate()->SendSuggestedUrlCheckResult( CommonNameMismatchHandler::SuggestedUrlCheckResult:: SUGGESTED_URL_NOT_AVAILABLE, GURL()); - EXPECT_FALSE(error_handler()->IsTimerRunning()); - EXPECT_TRUE(error_handler()->ssl_interstitial_shown()); - EXPECT_FALSE(error_handler()->redirected_to_suggested_url()); + EXPECT_FALSE(error_handler()->IsTimerRunningForTesting()); + EXPECT_TRUE(delegate()->ssl_interstitial_shown()); + EXPECT_FALSE(delegate()->redirected_to_suggested_url()); + + histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), 4); + histograms.ExpectBucketCount(SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::HANDLE_ALL, 1); + histograms.ExpectBucketCount(SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::WWW_MISMATCH_FOUND, 1); + histograms.ExpectBucketCount(SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::WWW_MISMATCH_URL_NOT_AVAILABLE, + 1); + histograms.ExpectBucketCount( + SSLErrorHandler::GetHistogramNameForTesting(), + SSLErrorHandler::SHOW_SSL_INTERSTITIAL_OVERRIDABLE, 1); } TEST_F(SSLErrorHandlerDateInvalidTest, TimeQueryStarted) { @@ -471,12 +611,12 @@ true, 0.0, network_time::NetworkTimeTracker::FETCHES_ON_DEMAND_ONLY); error_handler()->StartHandlingError(); - EXPECT_TRUE(error_handler()->IsTimerRunning()); + EXPECT_TRUE(error_handler()->IsTimerRunningForTesting()); tracker()->WaitForFetchForTesting(123123123); base::RunLoop().RunUntilIdle(); - EXPECT_TRUE(error_handler()->bad_clock_interstitial_shown()); - EXPECT_FALSE(error_handler()->IsTimerRunning()); + EXPECT_TRUE(delegate()->bad_clock_interstitial_shown()); + EXPECT_FALSE(error_handler()->IsTimerRunningForTesting()); // Check that the histogram for the delay was recorded. histograms.ExpectTotalCount(kCertDateErrorHistogram, 1); } @@ -494,23 +634,13 @@ // should not be shown. error_handler()->StartHandlingError(); - EXPECT_FALSE(error_handler()->IsTimerRunning()); - EXPECT_FALSE(error_handler()->bad_clock_interstitial_shown()); - EXPECT_TRUE(error_handler()->ssl_interstitial_shown()); + EXPECT_FALSE(error_handler()->IsTimerRunningForTesting()); + EXPECT_FALSE(delegate()->bad_clock_interstitial_shown()); + EXPECT_TRUE(delegate()->ssl_interstitial_shown()); // Check that the histogram for the delay was recorded. histograms.ExpectTotalCount(kCertDateErrorHistogram, 1); } -// Runs |quit_closure| on the UI thread once a URL request has been -// seen. Returns a request that hangs. -std::unique_ptr<net::test_server::HttpResponse> WaitForRequest( - const base::Closure& quit_closure, - const net::test_server::HttpRequest& request) { - content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, - quit_closure); - return base::MakeUnique<net::test_server::HungResponse>(); -} - // Tests that an SSL interstitial is shown if determing the accuracy of // the system clock times out (e.g. because a network time query hangs). TEST_F(SSLErrorHandlerDateInvalidTest, TimeQueryHangs) { @@ -531,13 +661,13 @@ field_trial_test()->SetNetworkQueriesWithVariationsService( true, 0.0, network_time::NetworkTimeTracker::FETCHES_ON_DEMAND_ONLY); error_handler()->StartHandlingError(); - EXPECT_TRUE(error_handler()->IsTimerRunning()); + EXPECT_TRUE(error_handler()->IsTimerRunningForTesting()); wait_for_time_query_loop.Run(); base::RunLoop().RunUntilIdle(); - EXPECT_FALSE(error_handler()->bad_clock_interstitial_shown()); - EXPECT_TRUE(error_handler()->ssl_interstitial_shown()); - EXPECT_FALSE(error_handler()->IsTimerRunning()); + EXPECT_FALSE(delegate()->bad_clock_interstitial_shown()); + EXPECT_TRUE(delegate()->ssl_interstitial_shown()); + EXPECT_FALSE(error_handler()->IsTimerRunningForTesting()); // Check that the histogram for the delay was recorded. histograms.ExpectTotalCount(kCertDateErrorHistogram, 1);
diff --git a/chrome/browser/task_manager/providers/task.cc b/chrome/browser/task_manager/providers/task.cc index 82d8656c..a49032f 100644 --- a/chrome/browser/task_manager/providers/task.cc +++ b/chrome/browser/task_manager/providers/task.cc
@@ -143,6 +143,10 @@ return blink::WebCache::ResourceTypeStats(); } +int Task::GetKeepaliveCount() const { + return -1; +} + bool Task::ReportsNetworkUsage() const { return network_usage_ != -1; }
diff --git a/chrome/browser/task_manager/providers/task.h b/chrome/browser/task_manager/providers/task.h index 0c04857..d112d38 100644 --- a/chrome/browser/task_manager/providers/task.h +++ b/chrome/browser/task_manager/providers/task.h
@@ -135,6 +135,9 @@ virtual bool ReportsWebCacheStats() const; virtual blink::WebCache::ResourceTypeStats GetWebCacheStats() const; + // Returns the keep-alive counter if the Task is an event page, -1 otherwise. + virtual int GetKeepaliveCount() const; + // Checking whether the task reports network usage. bool ReportsNetworkUsage() const;
diff --git a/chrome/browser/task_manager/providers/web_contents/extension_task.cc b/chrome/browser/task_manager/providers/web_contents/extension_task.cc index 0d47459..4ceb7b1 100644 --- a/chrome/browser/task_manager/providers/web_contents/extension_task.cc +++ b/chrome/browser/task_manager/providers/web_contents/extension_task.cc
@@ -46,7 +46,8 @@ : RendererTask(GetExtensionTitle(web_contents, extension, view_type), GetDefaultIcon(), web_contents, - web_contents->GetRenderProcessHost()) { + web_contents->GetRenderProcessHost()), + view_type_(view_type) { LoadExtensionIcon(extension); } @@ -93,6 +94,20 @@ return Task::EXTENSION; } +int ExtensionTask::GetKeepaliveCount() const { + if (view_type_ != extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) + return -1; + + const extensions::Extension* extension = + extensions::ProcessManager::Get(web_contents()->GetBrowserContext()) + ->GetExtensionForWebContents(web_contents()); + if (!extension) + return -1; + + return extensions::ProcessManager::Get(web_contents()->GetBrowserContext()) + ->GetLazyKeepaliveCount(extension); +} + void ExtensionTask::OnExtensionIconImageChanged(extensions::IconImage* image) { DCHECK_EQ(extension_icon_.get(), image);
diff --git a/chrome/browser/task_manager/providers/web_contents/extension_task.h b/chrome/browser/task_manager/providers/web_contents/extension_task.h index 27ad605..57fd1c8f 100644 --- a/chrome/browser/task_manager/providers/web_contents/extension_task.h +++ b/chrome/browser/task_manager/providers/web_contents/extension_task.h
@@ -28,12 +28,15 @@ extensions::ViewType view_type); ~ExtensionTask() override; - // task_manager::RendererTask: + // task_manager::RendererTask void UpdateTitle() override; void UpdateFavicon() override; void Activate() override; Type GetType() const override; + // task_manager::Task + int GetKeepaliveCount() const override; + // extensions::IconImage::Observer void OnExtensionIconImageChanged(extensions::IconImage* image) override; @@ -52,6 +55,8 @@ // The favicon of the extension represented by this task. std::unique_ptr<extensions::IconImage> extension_icon_; + const extensions::ViewType view_type_; + DISALLOW_COPY_AND_ASSIGN(ExtensionTask); };
diff --git a/chrome/browser/task_manager/sampling/task_manager_impl.cc b/chrome/browser/task_manager/sampling/task_manager_impl.cc index b86748f..6a92dcbc 100644 --- a/chrome/browser/task_manager/sampling/task_manager_impl.cc +++ b/chrome/browser/task_manager/sampling/task_manager_impl.cc
@@ -270,6 +270,14 @@ return true; } +int TaskManagerImpl::GetKeepaliveCount(TaskId task_id) const { + const Task* task = GetTaskByTaskId(task_id); + if (!task) + return -1; + + return task->GetKeepaliveCount(); +} + const TaskIdList& TaskManagerImpl::GetTaskIdsList() const { DCHECK(is_running_) << "Task manager is not running. You must observe the " "task manager for it to start running";
diff --git a/chrome/browser/task_manager/sampling/task_manager_impl.h b/chrome/browser/task_manager/sampling/task_manager_impl.h index 56c4ecb..982bebc 100644 --- a/chrome/browser/task_manager/sampling/task_manager_impl.h +++ b/chrome/browser/task_manager/sampling/task_manager_impl.h
@@ -85,6 +85,7 @@ bool GetWebCacheStats( TaskId task_id, blink::WebCache::ResourceTypeStats* stats) const override; + int GetKeepaliveCount(TaskId task_id) const override; const TaskIdList& GetTaskIdsList() const override; TaskIdList GetIdsOfTasksSharingSameProcess(TaskId task_id) const override; size_t GetNumberOfTasksOnSameProcess(TaskId task_id) const override;
diff --git a/chrome/browser/task_manager/task_manager_interface.h b/chrome/browser/task_manager/task_manager_interface.h index 2459903..30caeca 100644 --- a/chrome/browser/task_manager/task_manager_interface.h +++ b/chrome/browser/task_manager/task_manager_interface.h
@@ -201,6 +201,9 @@ TaskId task_id, blink::WebCache::ResourceTypeStats* stats) const = 0; + // Returns the keep-alive counter if the Task is an event page, -1 otherwise. + virtual int GetKeepaliveCount(TaskId task_id) const = 0; + // Gets the list of task IDs currently tracked by the task manager. Tasks that // share the same process id will always be consecutive. The list will be // sorted in a way that reflects the process tree: the browser process will be
diff --git a/chrome/browser/task_manager/task_manager_observer.h b/chrome/browser/task_manager/task_manager_observer.h index accb8e6..1c41206 100644 --- a/chrome/browser/task_manager/task_manager_observer.h +++ b/chrome/browser/task_manager/task_manager_observer.h
@@ -23,35 +23,36 @@ // Defines a list of types of resources that an observer needs to be refreshed // on every task manager refresh cycle. enum RefreshType { - REFRESH_TYPE_NONE = 0, - REFRESH_TYPE_CPU = 1, - REFRESH_TYPE_PHYSICAL_MEMORY = 1 << 1, - REFRESH_TYPE_MEMORY_DETAILS = 1 << 2, - REFRESH_TYPE_GPU_MEMORY = 1 << 3, - REFRESH_TYPE_V8_MEMORY = 1 << 4, - REFRESH_TYPE_SQLITE_MEMORY = 1 << 5, - REFRESH_TYPE_WEBCACHE_STATS = 1 << 6, - REFRESH_TYPE_NETWORK_USAGE = 1 << 7, - REFRESH_TYPE_NACL = 1 << 8, - REFRESH_TYPE_IDLE_WAKEUPS = 1 << 9, - REFRESH_TYPE_HANDLES = 1 << 10, - REFRESH_TYPE_START_TIME = 1 << 11, - REFRESH_TYPE_CPU_TIME = 1 << 12, + REFRESH_TYPE_NONE = 0, + REFRESH_TYPE_CPU = 1, + REFRESH_TYPE_PHYSICAL_MEMORY = 1 << 1, + REFRESH_TYPE_MEMORY_DETAILS = 1 << 2, + REFRESH_TYPE_GPU_MEMORY = 1 << 3, + REFRESH_TYPE_V8_MEMORY = 1 << 4, + REFRESH_TYPE_SQLITE_MEMORY = 1 << 5, + REFRESH_TYPE_WEBCACHE_STATS = 1 << 6, + REFRESH_TYPE_NETWORK_USAGE = 1 << 7, + REFRESH_TYPE_NACL = 1 << 8, + REFRESH_TYPE_IDLE_WAKEUPS = 1 << 9, + REFRESH_TYPE_HANDLES = 1 << 10, + REFRESH_TYPE_START_TIME = 1 << 11, + REFRESH_TYPE_CPU_TIME = 1 << 12, // Whether an observer is interested in knowing if a process is foregrounded // or backgrounded. - REFRESH_TYPE_PRIORITY = 1 << 13, + REFRESH_TYPE_PRIORITY = 1 << 13, #if defined(OS_LINUX) // For observers interested in getting the number of open file descriptors of // processes. - REFRESH_TYPE_FD_COUNT = 1 << 14, + REFRESH_TYPE_FD_COUNT = 1 << 14, #endif // defined(OS_LINUX) - REFRESH_TYPE_MEMORY_STATE = 1 << 15, + REFRESH_TYPE_MEMORY_STATE = 1 << 15, + REFRESH_TYPE_KEEPALIVE_COUNT = 1 << 16, - REFRESH_TYPE_MEMORY = REFRESH_TYPE_PHYSICAL_MEMORY | - REFRESH_TYPE_MEMORY_DETAILS, + REFRESH_TYPE_MEMORY = + REFRESH_TYPE_PHYSICAL_MEMORY | REFRESH_TYPE_MEMORY_DETAILS, }; // Defines the interface for observers of the task manager.
diff --git a/chrome/browser/task_manager/test_task_manager.cc b/chrome/browser/task_manager/test_task_manager.cc index 89ba2c4..5b90af6 100644 --- a/chrome/browser/task_manager/test_task_manager.cc +++ b/chrome/browser/task_manager/test_task_manager.cc
@@ -158,6 +158,10 @@ return false; } +int TestTaskManager::GetKeepaliveCount(TaskId task_id) const { + return -1; +} + const TaskIdList& TestTaskManager::GetTaskIdsList() const { return ids_; }
diff --git a/chrome/browser/task_manager/test_task_manager.h b/chrome/browser/task_manager/test_task_manager.h index 312f180..4af6f95 100644 --- a/chrome/browser/task_manager/test_task_manager.h +++ b/chrome/browser/task_manager/test_task_manager.h
@@ -67,6 +67,7 @@ bool GetWebCacheStats( TaskId task_id, blink::WebCache::ResourceTypeStats* stats) const override; + int GetKeepaliveCount(TaskId task_id) const override; const TaskIdList& GetTaskIdsList() const override; TaskIdList GetIdsOfTasksSharingSameProcess(TaskId task_id) const override; size_t GetNumberOfTasksOnSameProcess(TaskId task_id) const override;
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index eb01d3f57..94560da5 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -1097,6 +1097,8 @@ "webui/settings/chromeos/device_storage_handler.h", "webui/settings/chromeos/easy_unlock_settings_handler.cc", "webui/settings/chromeos/easy_unlock_settings_handler.h", + "webui/settings/chromeos/fingerprint_handler.cc", + "webui/settings/chromeos/fingerprint_handler.h", "webui/settings/chromeos/internet_handler.cc", "webui/settings/chromeos/internet_handler.h", "webui/settings/downloads_handler.cc",
diff --git a/chrome/browser/ui/libgtkui/gtk_ui.cc b/chrome/browser/ui/libgtkui/gtk_ui.cc index b3717b6a..bd6ec16 100644 --- a/chrome/browser/ui/libgtkui/gtk_ui.cc +++ b/chrome/browser/ui/libgtkui/gtk_ui.cc
@@ -433,8 +433,6 @@ LoadGtkValues(); - LoadCursorTheme(); - #if BUILDFLAG(ENABLE_BASIC_PRINTING) printing::PrintingContextLinux::SetCreatePrintDialogFunction( &PrintDialogGtk2::CreatePrintDialog); @@ -786,12 +784,16 @@ // regress startup time. Figure out how to do that when we can't access the // prefs system from here. - SkColor label_color = native_theme_->GetSystemColor( - ui::NativeTheme::kColorId_LabelEnabledColor); + UpdateDeviceScaleFactor(); + UpdateCursorTheme(); + + BuildFrameColors(); #if GTK_MAJOR_VERSION == 2 SkColor toolbar_color = native_theme_->GetSystemColor(ui::NativeTheme::kColorId_DialogBackground); + SkColor label_color = native_theme_->GetSystemColor( + ui::NativeTheme::kColorId_LabelEnabledColor); colors_[ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON] = color_utils::DeriveDefaultIconColor(label_color); @@ -805,6 +807,25 @@ ui::NativeTheme::kColorId_TextfieldReadOnlyBackground); inactive_selection_fg_color_ = native_theme_->GetSystemColor( ui::NativeTheme::kColorId_TextfieldReadOnlyColor); + + // We pick the text and background colors for the NTP out of the + // colors for a GtkEntry. We do this because GtkEntries background + // color is never the same as |toolbar_color|, is usually a white, + // and when it isn't a white, provides sufficient contrast to + // |toolbar_color|. Try this out with Darklooks, HighContrastInverse + // or ThinIce. + colors_[ThemeProperties::COLOR_NTP_BACKGROUND] = + native_theme_->GetSystemColor( + ui::NativeTheme::kColorId_TextfieldDefaultBackground); + colors_[ThemeProperties::COLOR_NTP_TEXT] = native_theme_->GetSystemColor( + ui::NativeTheme::kColorId_TextfieldDefaultColor); + // The NTP header is the color that surrounds the current active + // thumbnail on the NTP, and acts as the border of the "Recent + // Links" box. It would be awesome if they were separated so we + // could use GetBorderColor() for the border around the "Recent + // Links" section, but matching the frame color is more important. + colors_[ThemeProperties::COLOR_NTP_HEADER] = + colors_[ThemeProperties::COLOR_FRAME]; #else SkColor toolbar_color = GetBgColor("GtkToolbar#toolbar"); @@ -857,50 +878,22 @@ colors_[ThemeProperties::COLOR_TOOLBAR_TOP_SEPARATOR_INACTIVE] = entry_inactive_border; } + + colors_[ThemeProperties::COLOR_NTP_BACKGROUND] = GetBgColor(""); + colors_[ThemeProperties::COLOR_NTP_TEXT] = GetFgColor(""); + colors_[ThemeProperties::COLOR_NTP_HEADER] = GetBorderColor("GtkEntry#entry"); #endif - colors_[ThemeProperties::COLOR_CONTROL_BACKGROUND] = toolbar_color; colors_[ThemeProperties::COLOR_TOOLBAR] = toolbar_color; + colors_[ThemeProperties::COLOR_CONTROL_BACKGROUND] = toolbar_color; - UpdateDeviceScaleFactor(); - - // We pick the text and background colors for the NTP out of the colors for a - // GtkEntry. We do this because GtkEntries background color is never the same - // as |toolbar_color|, is usually a white, and when it isn't a white, - // provides sufficient contrast to |toolbar_color|. Try this out with - // Darklooks, HighContrastInverse or ThinIce. - - SkColor ntp_background = native_theme_->GetSystemColor( - ui::NativeTheme::kColorId_TextfieldDefaultBackground); - SkColor ntp_foreground = native_theme_->GetSystemColor( - ui::NativeTheme::kColorId_TextfieldDefaultColor); - - colors_[ThemeProperties::COLOR_NTP_BACKGROUND] = ntp_background; - colors_[ThemeProperties::COLOR_NTP_TEXT] = ntp_foreground; - - // The NTP header is the color that surrounds the current active thumbnail on - // the NTP, and acts as the border of the "Recent Links" box. It would be - // awesome if they were separated so we could use GetBorderColor() for the - // border around the "Recent Links" section, but matching the frame color is - // more important. - - BuildFrameColors(); - SkColor frame_color = colors_[ThemeProperties::COLOR_FRAME]; - colors_[ThemeProperties::COLOR_NTP_HEADER] = frame_color; - colors_[ThemeProperties::COLOR_NTP_SECTION] = toolbar_color; - colors_[ThemeProperties::COLOR_NTP_SECTION_TEXT] = label_color; - - SkColor link_color = + colors_[ThemeProperties::COLOR_NTP_LINK] = native_theme_->GetSystemColor(ui::NativeTheme::kColorId_LinkEnabled); - colors_[ThemeProperties::COLOR_NTP_LINK] = link_color; - colors_[ThemeProperties::COLOR_NTP_LINK_UNDERLINE] = link_color; - colors_[ThemeProperties::COLOR_NTP_SECTION_LINK] = link_color; - colors_[ThemeProperties::COLOR_NTP_SECTION_LINK_UNDERLINE] = link_color; // Generate the colors that we pass to WebKit. - focus_ring_color_ = frame_color; - SetScrollbarColors(); + focus_ring_color_ = native_theme_->GetSystemColor( + ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused); // Some GTK themes only define the text selection colors on the GtkEntry // class, so we need to use that for getting selection colors. @@ -917,7 +910,7 @@ ui::NativeTheme::kColorId_ThrobberWaitingColor); } -void GtkUi::LoadCursorTheme() { +void GtkUi::UpdateCursorTheme() { GtkSettings* settings = gtk_settings_get_default(); gchar* theme = nullptr;
diff --git a/chrome/browser/ui/libgtkui/gtk_ui.h b/chrome/browser/ui/libgtkui/gtk_ui.h index 3302327..a0662515 100644 --- a/chrome/browser/ui/libgtkui/gtk_ui.h +++ b/chrome/browser/ui/libgtkui/gtk_ui.h
@@ -119,8 +119,8 @@ // ThemeService interface and the colors we send to webkit. void LoadGtkValues(); - // Initialize the Xcursor theme and size with the GTK theme and size. - void LoadCursorTheme(); + // Sets the Xcursor theme and size with the GTK theme and size. + void UpdateCursorTheme(); // Reads in explicit theme frame colors from the ChromeGtkFrame style class // or generates them per our fallback algorithm.
diff --git a/chrome/browser/ui/task_manager/task_manager_columns.cc b/chrome/browser/ui/task_manager/task_manager_columns.cc index d4ad52af..4c533347 100644 --- a/chrome/browser/ui/task_manager/task_manager_columns.cc +++ b/chrome/browser/ui/task_manager/task_manager_columns.cc
@@ -21,73 +21,75 @@ // IMPORTANT: Do NOT change the below list without changing the COLUMN_LIST // macro below. const TableColumnData kColumns[] = { - { IDS_TASK_MANAGER_TASK_COLUMN, ui::TableColumn::LEFT, -1, 1, 120, 600, true, - true, true }, - { IDS_TASK_MANAGER_PROFILE_NAME_COLUMN, ui::TableColumn::LEFT, -1, 0, 60, 200, - true, true, false }, - { IDS_TASK_MANAGER_PHYSICAL_MEM_COLUMN, ui::TableColumn::RIGHT, -1, 0, - arraysize("800 MiB") * kCharWidth, -1, true, false, true }, - { IDS_TASK_MANAGER_SHARED_MEM_COLUMN, ui::TableColumn::RIGHT, -1, 0, - arraysize("800 MiB") * kCharWidth, -1, true, false, false }, - { IDS_TASK_MANAGER_PRIVATE_MEM_COLUMN, ui::TableColumn::RIGHT, -1, 0, - arraysize("800 MiB") * kCharWidth, -1, true, false, false }, + {IDS_TASK_MANAGER_TASK_COLUMN, ui::TableColumn::LEFT, -1, 1, 120, 600, true, + true, true}, + {IDS_TASK_MANAGER_PROFILE_NAME_COLUMN, ui::TableColumn::LEFT, -1, 0, 60, + 200, true, true, false}, + {IDS_TASK_MANAGER_PHYSICAL_MEM_COLUMN, ui::TableColumn::RIGHT, -1, 0, + arraysize("800 MiB") * kCharWidth, -1, true, false, true}, + {IDS_TASK_MANAGER_SHARED_MEM_COLUMN, ui::TableColumn::RIGHT, -1, 0, + arraysize("800 MiB") * kCharWidth, -1, true, false, false}, + {IDS_TASK_MANAGER_PRIVATE_MEM_COLUMN, ui::TableColumn::RIGHT, -1, 0, + arraysize("800 MiB") * kCharWidth, -1, true, false, false}, #if defined(OS_CHROMEOS) - { IDS_TASK_MANAGER_SWAPPED_MEM_COLUMN, ui::TableColumn::RIGHT, -1, 0, - arraysize("800 MiB") * kCharWidth, -1, true, false, false }, + {IDS_TASK_MANAGER_SWAPPED_MEM_COLUMN, ui::TableColumn::RIGHT, -1, 0, + arraysize("800 MiB") * kCharWidth, -1, true, false, false}, #endif - { IDS_TASK_MANAGER_CPU_COLUMN, ui::TableColumn::RIGHT, -1, 0, - arraysize("99.9") * kCharWidth, -1, true, false, true }, + {IDS_TASK_MANAGER_CPU_COLUMN, ui::TableColumn::RIGHT, -1, 0, + arraysize("99.9") * kCharWidth, -1, true, false, true}, #if defined(OS_WIN) - { IDS_TASK_MANAGER_CPU_TIME_COLUMN, ui::TableColumn::RIGHT, -1, 0, - arraysize("1234h 42m 30s") * kCharWidth, -1, true, false, false }, - { IDS_TASK_MANAGER_START_TIME_COLUMN, ui::TableColumn::RIGHT, -1, 0, - arraysize("12/13/14 11:44:30 PM") * kCharWidth, -1, true, true, false }, + {IDS_TASK_MANAGER_CPU_TIME_COLUMN, ui::TableColumn::RIGHT, -1, 0, + arraysize("1234h 42m 30s") * kCharWidth, -1, true, false, false}, + {IDS_TASK_MANAGER_START_TIME_COLUMN, ui::TableColumn::RIGHT, -1, 0, + arraysize("12/13/14 11:44:30 PM") * kCharWidth, -1, true, true, false}, #endif - { IDS_TASK_MANAGER_NET_COLUMN, ui::TableColumn::RIGHT, -1, 0, - arraysize("150 kiB/s") * kCharWidth, -1, true, false, true }, - { IDS_TASK_MANAGER_PROCESS_ID_COLUMN, ui::TableColumn::RIGHT, -1, 0, - arraysize("73099 ") * kCharWidth, -1, true, true, true }, + {IDS_TASK_MANAGER_NET_COLUMN, ui::TableColumn::RIGHT, -1, 0, + arraysize("150 kiB/s") * kCharWidth, -1, true, false, true}, + {IDS_TASK_MANAGER_PROCESS_ID_COLUMN, ui::TableColumn::RIGHT, -1, 0, + arraysize("73099 ") * kCharWidth, -1, true, true, true}, #if defined(OS_WIN) - { IDS_TASK_MANAGER_GDI_HANDLES_COLUMN, ui::TableColumn::RIGHT, -1, 0, 0, 0, - true, false, false }, - { IDS_TASK_MANAGER_USER_HANDLES_COLUMN, ui::TableColumn::RIGHT, -1, 0, 0, 0, - true, false, false }, + {IDS_TASK_MANAGER_GDI_HANDLES_COLUMN, ui::TableColumn::RIGHT, -1, 0, 0, 0, + true, false, false}, + {IDS_TASK_MANAGER_USER_HANDLES_COLUMN, ui::TableColumn::RIGHT, -1, 0, 0, 0, + true, false, false}, #endif - { IDS_TASK_MANAGER_WEBCORE_IMAGE_CACHE_COLUMN, ui::TableColumn::RIGHT, -1, 0, - arraysize("2000.0K (2000.0 live)") * kCharWidth, -1, true, false, false }, - { IDS_TASK_MANAGER_WEBCORE_SCRIPTS_CACHE_COLUMN, ui::TableColumn::RIGHT, -1, - 0, arraysize("2000.0K (2000.0 live)") * kCharWidth, -1, true, false, - false }, - { IDS_TASK_MANAGER_WEBCORE_CSS_CACHE_COLUMN, ui::TableColumn::RIGHT, -1, 0, - arraysize("2000.0K (2000.0 live)") * kCharWidth, -1, true, false, false }, - { IDS_TASK_MANAGER_VIDEO_MEMORY_COLUMN, ui::TableColumn::RIGHT, -1, 0, - arraysize("2000.0K") * kCharWidth, -1, true, false, false }, - { IDS_TASK_MANAGER_SQLITE_MEMORY_USED_COLUMN, ui::TableColumn::RIGHT, -1, 0, - arraysize("800 kB") * kCharWidth, -1, true, false, false }, + {IDS_TASK_MANAGER_WEBCORE_IMAGE_CACHE_COLUMN, ui::TableColumn::RIGHT, -1, 0, + arraysize("2000.0K (2000.0 live)") * kCharWidth, -1, true, false, false}, + {IDS_TASK_MANAGER_WEBCORE_SCRIPTS_CACHE_COLUMN, ui::TableColumn::RIGHT, -1, + 0, arraysize("2000.0K (2000.0 live)") * kCharWidth, -1, true, false, + false}, + {IDS_TASK_MANAGER_WEBCORE_CSS_CACHE_COLUMN, ui::TableColumn::RIGHT, -1, 0, + arraysize("2000.0K (2000.0 live)") * kCharWidth, -1, true, false, false}, + {IDS_TASK_MANAGER_VIDEO_MEMORY_COLUMN, ui::TableColumn::RIGHT, -1, 0, + arraysize("2000.0K") * kCharWidth, -1, true, false, false}, + {IDS_TASK_MANAGER_SQLITE_MEMORY_USED_COLUMN, ui::TableColumn::RIGHT, -1, 0, + arraysize("800 kB") * kCharWidth, -1, true, false, false}, #if !defined(DISABLE_NACL) - { IDS_TASK_MANAGER_NACL_DEBUG_STUB_PORT_COLUMN, ui::TableColumn::RIGHT, -1, 0, - arraysize("32767") * kCharWidth, -1, true, true, false }, + {IDS_TASK_MANAGER_NACL_DEBUG_STUB_PORT_COLUMN, ui::TableColumn::RIGHT, -1, + 0, arraysize("32767") * kCharWidth, -1, true, true, false}, #endif // !defined(DISABLE_NACL) - { IDS_TASK_MANAGER_JAVASCRIPT_MEMORY_ALLOCATED_COLUMN, ui::TableColumn::RIGHT, - -1, 0, arraysize("2000.0K (2000.0 live)") * kCharWidth, -1, true, false, - false }, - { IDS_TASK_MANAGER_IDLE_WAKEUPS_COLUMN, ui::TableColumn::RIGHT, -1, 0, - arraysize("idlewakeups") * kCharWidth, -1, true, false, false }, + {IDS_TASK_MANAGER_JAVASCRIPT_MEMORY_ALLOCATED_COLUMN, + ui::TableColumn::RIGHT, -1, 0, + arraysize("2000.0K (2000.0 live)") * kCharWidth, -1, true, false, false}, + {IDS_TASK_MANAGER_IDLE_WAKEUPS_COLUMN, ui::TableColumn::RIGHT, -1, 0, + arraysize("idlewakeups") * kCharWidth, -1, true, false, false}, #if defined(OS_LINUX) - { IDS_TASK_MANAGER_OPEN_FD_COUNT_COLUMN, ui::TableColumn::RIGHT, -1, 0, - arraysize("999") * kCharWidth, -1, true, false, false }, + {IDS_TASK_MANAGER_OPEN_FD_COUNT_COLUMN, ui::TableColumn::RIGHT, -1, 0, + arraysize("999") * kCharWidth, -1, true, false, false}, #endif // defined(OS_LINUX) - { IDS_TASK_MANAGER_PROCESS_PRIORITY_COLUMN, ui::TableColumn::LEFT, -1, 0, - arraysize("background") * kCharWidth, -1, true, true, false }, - { IDS_TASK_MANAGER_MEMORY_STATE_COLUMN, ui::TableColumn::LEFT, -1, 0, - arraysize("throttled") * kCharWidth, -1, true, false, false }, + {IDS_TASK_MANAGER_PROCESS_PRIORITY_COLUMN, ui::TableColumn::LEFT, -1, 0, + arraysize("background") * kCharWidth, -1, true, true, false}, + {IDS_TASK_MANAGER_MEMORY_STATE_COLUMN, ui::TableColumn::LEFT, -1, 0, + arraysize("throttled") * kCharWidth, -1, true, false, false}, + {IDS_TASK_MANAGER_KEEPALIVE_COUNT_COLUMN, ui::TableColumn::RIGHT, -1, 0, + arraysize("999") * kCharWidth, -1, false, false, false}, }; const size_t kColumnsSize = arraysize(kColumns); @@ -95,45 +97,43 @@ const char kSortColumnIdKey[] = "sort_column_id"; const char kSortIsAscendingKey[] = "sort_is_ascending"; -// We can't use the integer IDs of the columns converted to strings as session -// restore keys. These integer values can change from one build to another as -// they are generated. Instead we use the literal string value of the column -// ID symbol (i.e. for the ID IDS_TASK_MANAGER_TASK_COLUMN, we use the literal -// string "IDS_TASK_MANAGER_TASK_COLUMN". The following macros help us -// efficiently get the literal ID for the integer value. -#define COLUMNS_LIST(def) \ - def(IDS_TASK_MANAGER_TASK_COLUMN) \ - def(IDS_TASK_MANAGER_PROFILE_NAME_COLUMN) \ - def(IDS_TASK_MANAGER_PHYSICAL_MEM_COLUMN) \ - def(IDS_TASK_MANAGER_SHARED_MEM_COLUMN) \ - def(IDS_TASK_MANAGER_PRIVATE_MEM_COLUMN) \ - def(IDS_TASK_MANAGER_SWAPPED_MEM_COLUMN) \ - def(IDS_TASK_MANAGER_CPU_COLUMN) \ - def(IDS_TASK_MANAGER_START_TIME_COLUMN) \ - def(IDS_TASK_MANAGER_CPU_TIME_COLUMN) \ - def(IDS_TASK_MANAGER_NET_COLUMN) \ - def(IDS_TASK_MANAGER_PROCESS_ID_COLUMN) \ - def(IDS_TASK_MANAGER_GDI_HANDLES_COLUMN) \ - def(IDS_TASK_MANAGER_USER_HANDLES_COLUMN) \ - def(IDS_TASK_MANAGER_WEBCORE_IMAGE_CACHE_COLUMN) \ - def(IDS_TASK_MANAGER_WEBCORE_SCRIPTS_CACHE_COLUMN) \ - def(IDS_TASK_MANAGER_WEBCORE_CSS_CACHE_COLUMN) \ - def(IDS_TASK_MANAGER_VIDEO_MEMORY_COLUMN) \ - def(IDS_TASK_MANAGER_SQLITE_MEMORY_USED_COLUMN) \ - def(IDS_TASK_MANAGER_NACL_DEBUG_STUB_PORT_COLUMN) \ - def(IDS_TASK_MANAGER_JAVASCRIPT_MEMORY_ALLOCATED_COLUMN) \ - def(IDS_TASK_MANAGER_IDLE_WAKEUPS_COLUMN) \ - def(IDS_TASK_MANAGER_OPEN_FD_COUNT_COLUMN) \ - def(IDS_TASK_MANAGER_PROCESS_PRIORITY_COLUMN) \ - def(IDS_TASK_MANAGER_MEMORY_STATE_COLUMN) -// Add to the above list in the macro any new IDs added in the future. Also -// remove the removed ones. +// We can't derive session restore keys from the integer IDs of the columns +// since the IDs are generated, and so may change from one build to another. +// Instead we stringify the column ID symbol (i.e. for the ID +// IDS_TASK_MANAGER_TASK_COLUMN, we use the literal string +// "IDS_TASK_MANAGER_TASK_COLUMN"). -#define COLUMN_ID_AS_STRING(col_id) case col_id: return std::string(#col_id); +#define COLUMN_CASE(column_id) \ + case column_id: \ + return std::string(#column_id); std::string GetColumnIdAsString(int column_id) { switch (column_id) { - COLUMNS_LIST(COLUMN_ID_AS_STRING) + COLUMN_CASE(IDS_TASK_MANAGER_TASK_COLUMN); + COLUMN_CASE(IDS_TASK_MANAGER_PROFILE_NAME_COLUMN); + COLUMN_CASE(IDS_TASK_MANAGER_PHYSICAL_MEM_COLUMN); + COLUMN_CASE(IDS_TASK_MANAGER_SHARED_MEM_COLUMN); + COLUMN_CASE(IDS_TASK_MANAGER_PRIVATE_MEM_COLUMN); + COLUMN_CASE(IDS_TASK_MANAGER_SWAPPED_MEM_COLUMN); + COLUMN_CASE(IDS_TASK_MANAGER_CPU_COLUMN); + COLUMN_CASE(IDS_TASK_MANAGER_START_TIME_COLUMN); + COLUMN_CASE(IDS_TASK_MANAGER_CPU_TIME_COLUMN); + COLUMN_CASE(IDS_TASK_MANAGER_NET_COLUMN); + COLUMN_CASE(IDS_TASK_MANAGER_PROCESS_ID_COLUMN); + COLUMN_CASE(IDS_TASK_MANAGER_GDI_HANDLES_COLUMN); + COLUMN_CASE(IDS_TASK_MANAGER_USER_HANDLES_COLUMN); + COLUMN_CASE(IDS_TASK_MANAGER_WEBCORE_IMAGE_CACHE_COLUMN); + COLUMN_CASE(IDS_TASK_MANAGER_WEBCORE_SCRIPTS_CACHE_COLUMN); + COLUMN_CASE(IDS_TASK_MANAGER_WEBCORE_CSS_CACHE_COLUMN); + COLUMN_CASE(IDS_TASK_MANAGER_VIDEO_MEMORY_COLUMN); + COLUMN_CASE(IDS_TASK_MANAGER_SQLITE_MEMORY_USED_COLUMN); + COLUMN_CASE(IDS_TASK_MANAGER_NACL_DEBUG_STUB_PORT_COLUMN); + COLUMN_CASE(IDS_TASK_MANAGER_JAVASCRIPT_MEMORY_ALLOCATED_COLUMN); + COLUMN_CASE(IDS_TASK_MANAGER_IDLE_WAKEUPS_COLUMN); + COLUMN_CASE(IDS_TASK_MANAGER_OPEN_FD_COUNT_COLUMN); + COLUMN_CASE(IDS_TASK_MANAGER_PROCESS_PRIORITY_COLUMN); + COLUMN_CASE(IDS_TASK_MANAGER_MEMORY_STATE_COLUMN); + COLUMN_CASE(IDS_TASK_MANAGER_KEEPALIVE_COUNT_COLUMN); default: NOTREACHED(); return std::string();
diff --git a/chrome/browser/ui/task_manager/task_manager_table_model.cc b/chrome/browser/ui/task_manager/task_manager_table_model.cc index 086458e9..306f1a4 100644 --- a/chrome/browser/ui/task_manager/task_manager_table_model.cc +++ b/chrome/browser/ui/task_manager/task_manager_table_model.cc
@@ -234,6 +234,12 @@ return GetMemoryUsageText(stat.size, false); } + base::string16 GetKeepaliveCountText(int keepalive_count) const { + if (keepalive_count < 0) + return n_a_string(); + return base::IntToString16(keepalive_count); + } + const base::string16& n_a_string() const { return n_a_string_; } const base::string16& zero_string() const { return zero_string_; } const base::string16& backgrounded_string() const { @@ -456,6 +462,11 @@ observed_task_manager()->GetMemoryState(tasks_[row])); } + case IDS_TASK_MANAGER_KEEPALIVE_COUNT_COLUMN: { + return stringifier_->GetKeepaliveCountText( + observed_task_manager()->GetKeepaliveCount(tasks_[row])); + } + default: NOTREACHED(); return base::string16(); @@ -778,6 +789,10 @@ type = REFRESH_TYPE_MEMORY_STATE; break; + case IDS_TASK_MANAGER_KEEPALIVE_COUNT_COLUMN: + type = REFRESH_TYPE_KEEPALIVE_COUNT; + break; + #if defined(OS_LINUX) case IDS_TASK_MANAGER_OPEN_FD_COUNT_COLUMN: type = REFRESH_TYPE_FD_COUNT;
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc index 727682ef..2e0678b4a 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc
@@ -352,8 +352,9 @@ column_set->AddColumn(delegate->GetControlLabelGridAlignment(), GridLayout::CENTER, 0, GridLayout::USE_PREF, 0, 0); column_set->AddPaddingColumn( - 0, delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_HORIZONTAL_SPACING)); + 0, + delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING)); column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 1, GridLayout::USE_PREF, 0, 0); @@ -365,13 +366,15 @@ column_set->AddColumn(GridLayout::FILL, GridLayout::LEADING, 0, GridLayout::USE_PREF, 0, 0); column_set->AddPaddingColumn( - 1, delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_HORIZONTAL_SPACING)); + 1, + delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING)); column_set->AddColumn(GridLayout::FILL, GridLayout::LEADING, 0, GridLayout::USE_PREF, 0, 0); column_set->AddPaddingColumn( - 0, delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_HORIZONTAL_SPACING)); + 0, + delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING)); column_set->AddColumn(GridLayout::FILL, GridLayout::LEADING, 0, GridLayout::USE_PREF, 0, 0); column_set->LinkColumnSizes(0, 2, 4, -1); @@ -391,8 +394,9 @@ l10n_util::GetStringUTF16(IDS_BOOKMARK_AX_EDITOR_URL_LABEL)); layout->AddPaddingRow( - 0, delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_VERTICAL_SPACING)); + 0, + delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); layout->StartRow(0, labels_column_set_id); layout->AddView(url_label_); @@ -401,16 +405,18 @@ if (show_tree_) { layout->AddPaddingRow( - 0, delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_VERTICAL_SPACING)); + 0, + delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); layout->StartRow(1, single_column_view_set_id); layout->AddView(tree_view_->CreateParentIfNecessary()); } if (delegate->UseExtraDialogPadding()) { layout->AddPaddingRow( - 0, delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_VERTICAL_SPACING)); + 0, + delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); } if (!show_tree_ || bb_model_->loaded())
diff --git a/chrome/browser/ui/views/collected_cookies_views.cc b/chrome/browser/ui/views/collected_cookies_views.cc index a96ba855..29df017 100644 --- a/chrome/browser/ui/views/collected_cookies_views.cc +++ b/chrome/browser/ui/views/collected_cookies_views.cc
@@ -71,14 +71,12 @@ const int kTabbedPaneTopPadding = 14; const int kCookieInfoBottomPadding = 4; -LayoutDelegate::LayoutDistanceType GetTreeviewToButtonsDistanceType() { +LayoutDelegate::Metric GetTreeviewToButtonsMetric() { // Hack: in the Harmony specs, the buttons under the treeview are "unrelated" // to it (which looks better), but in the existing dialog they were related. return LayoutDelegate::Get()->IsHarmonyMode() - ? LayoutDelegate::LayoutDistanceType:: - UNRELATED_CONTROL_VERTICAL_SPACING - : LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_VERTICAL_SPACING; + ? LayoutDelegate::Metric::UNRELATED_CONTROL_VERTICAL_SPACING + : LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING; } } // namespace @@ -285,7 +283,7 @@ gfx::Size CollectedCookiesViews::GetPreferredSize() const { int preferred = LayoutDelegate::Get()->GetDialogPreferredWidth( - LayoutDelegate::DialogWidthType::MEDIUM); + LayoutDelegate::DialogWidth::MEDIUM); return gfx::Size(preferred ? preferred : View::GetPreferredSize().width(), View::GetPreferredSize().height()); } @@ -332,9 +330,10 @@ tabbed_pane->SelectTabAt(0); tabbed_pane->set_listener(this); if (LayoutDelegate::Get()->UseExtraDialogPadding()) { - layout->AddPaddingRow(0, LayoutDelegate::Get()->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_VERTICAL_SPACING)); + layout->AddPaddingRow( + 0, + LayoutDelegate::Get()->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); } layout->StartRow(0, single_column_layout_id); @@ -391,24 +390,26 @@ column_set = layout->AddColumnSet(three_columns_layout_id); column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0, GridLayout::USE_PREF, 0, 0); - column_set->AddPaddingColumn(0, LayoutDelegate::Get()->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType:: - RELATED_BUTTON_HORIZONTAL_SPACING)); + column_set->AddPaddingColumn( + 0, + LayoutDelegate::Get()->GetMetric( + LayoutDelegate::Metric::RELATED_BUTTON_HORIZONTAL_SPACING)); column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0, GridLayout::USE_PREF, 0, 0); layout->StartRow(0, single_column_layout_id); layout->AddView(allowed_label_); - layout->AddPaddingRow(0, LayoutDelegate::Get()->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType:: - UNRELATED_CONTROL_VERTICAL_SPACING)); + layout->AddPaddingRow( + 0, + LayoutDelegate::Get()->GetMetric( + LayoutDelegate::Metric::UNRELATED_CONTROL_VERTICAL_SPACING)); layout->StartRow(1, single_column_layout_id); layout->AddView(CreateScrollView(allowed_cookies_tree_), 1, 1, GridLayout::FILL, GridLayout::FILL, kTreeViewWidth, kTreeViewHeight); - layout->AddPaddingRow(0, LayoutDelegate::Get()->GetLayoutDistance( - GetTreeviewToButtonsDistanceType())); + layout->AddPaddingRow( + 0, LayoutDelegate::Get()->GetMetric(GetTreeviewToButtonsMetric())); layout->StartRow(0, three_columns_layout_id); layout->AddView(block_allowed_button_); @@ -465,24 +466,26 @@ column_set = layout->AddColumnSet(three_columns_layout_id); column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0, GridLayout::USE_PREF, 0, 0); - column_set->AddPaddingColumn(0, LayoutDelegate::Get()->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType:: - RELATED_BUTTON_HORIZONTAL_SPACING)); + column_set->AddPaddingColumn( + 0, + LayoutDelegate::Get()->GetMetric( + LayoutDelegate::Metric::RELATED_BUTTON_HORIZONTAL_SPACING)); column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0, GridLayout::USE_PREF, 0, 0); layout->StartRow(0, single_column_layout_id); layout->AddView(blocked_label_, 1, 1, GridLayout::FILL, GridLayout::FILL); - layout->AddPaddingRow(0, LayoutDelegate::Get()->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType:: - UNRELATED_CONTROL_VERTICAL_SPACING)); + layout->AddPaddingRow( + 0, + LayoutDelegate::Get()->GetMetric( + LayoutDelegate::Metric::UNRELATED_CONTROL_VERTICAL_SPACING)); layout->StartRow(1, single_column_layout_id); layout->AddView( CreateScrollView(blocked_cookies_tree_), 1, 1, GridLayout::FILL, GridLayout::FILL, kTreeViewWidth, kTreeViewHeight); - layout->AddPaddingRow(0, LayoutDelegate::Get()->GetLayoutDistance( - GetTreeviewToButtonsDistanceType())); + layout->AddPaddingRow( + 0, LayoutDelegate::Get()->GetMetric(GetTreeviewToButtonsMetric())); layout->StartRow(0, three_columns_layout_id); layout->AddView(allow_blocked_button_);
diff --git a/chrome/browser/ui/views/content_setting_bubble_contents.cc b/chrome/browser/ui/views/content_setting_bubble_contents.cc index 5ab7444a..6e285305 100644 --- a/chrome/browser/ui/views/content_setting_bubble_contents.cc +++ b/chrome/browser/ui/views/content_setting_bubble_contents.cc
@@ -186,7 +186,7 @@ gfx::Size ContentSettingBubbleContents::GetPreferredSize() const { gfx::Size preferred_size(views::View::GetPreferredSize()); int preferred_width = LayoutDelegate::Get()->GetDialogPreferredWidth( - LayoutDelegate::DialogWidthType::SMALL); + LayoutDelegate::DialogWidth::SMALL); if (!preferred_width) preferred_width = (!content_setting_bubble_model_->bubble_content() .domain_lists.empty() && @@ -210,17 +210,12 @@ GridLayout* layout = new views::GridLayout(this); SetLayoutManager(layout); const LayoutDelegate* layout_delegate = LayoutDelegate::Get(); - const int related_control_horizontal_spacing = - layout_delegate->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_HORIZONTAL_SPACING); - const int related_control_vertical_spacing = - layout_delegate->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType::RELATED_CONTROL_VERTICAL_SPACING); - const int unrelated_control_vertical_spacing = - layout_delegate->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType:: - UNRELATED_CONTROL_VERTICAL_SPACING); + const int related_control_horizontal_spacing = layout_delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING); + const int related_control_vertical_spacing = layout_delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING); + const int unrelated_control_vertical_spacing = layout_delegate->GetMetric( + LayoutDelegate::Metric::UNRELATED_CONTROL_VERTICAL_SPACING); const int kSingleColumnSetId = 0; views::ColumnSet* column_set = layout->AddColumnSet(kSingleColumnSetId); @@ -308,8 +303,9 @@ views::ColumnSet* indented_single_column_set = layout->AddColumnSet(indented_kSingleColumnSetId); indented_single_column_set->AddPaddingColumn( - 0, layout_delegate->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType::CHECKBOX_INDENT)); + 0, + layout_delegate->GetMetric( + LayoutDelegate::Metric::SUBSECTION_HORIZONTAL_INDENT)); indented_single_column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 1, GridLayout::USE_PREF, 0, 0); @@ -350,8 +346,9 @@ views::ColumnSet* menu_column_set = layout->AddColumnSet(kMediaMenuColumnSetId); menu_column_set->AddPaddingColumn( - 0, layout_delegate->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType::CHECKBOX_INDENT)); + 0, + layout_delegate->GetMetric( + LayoutDelegate::Metric::SUBSECTION_HORIZONTAL_INDENT)); menu_column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 0, GridLayout::USE_PREF, 0, 0); menu_column_set->AddPaddingColumn(0, related_control_horizontal_spacing);
diff --git a/chrome/browser/ui/views/cookie_info_view.cc b/chrome/browser/ui/views/cookie_info_view.cc index 1dd6e0db..cd736fe 100644 --- a/chrome/browser/ui/views/cookie_info_view.cc +++ b/chrome/browser/ui/views/cookie_info_view.cc
@@ -147,11 +147,12 @@ expires_value_field_ = new views::Textfield; views::GridLayout* layout = new views::GridLayout(this); - layout->SetInsets( - 0, LayoutDelegate::Get()->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType::BUTTON_HEDGE_MARGIN_NEW), - 0, LayoutDelegate::Get()->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType::BUTTON_HEDGE_MARGIN_NEW)); + layout->SetInsets(0, + LayoutDelegate::Get()->GetMetric( + LayoutDelegate::Metric::DIALOG_BUTTON_MARGIN), + 0, + LayoutDelegate::Get()->GetMetric( + LayoutDelegate::Metric::DIALOG_BUTTON_MARGIN)); SetLayoutManager(layout); int three_column_layout_id = 0; @@ -159,9 +160,10 @@ column_set->AddColumn(LayoutDelegate::Get()->GetControlLabelGridAlignment(), views::GridLayout::CENTER, 0, views::GridLayout::USE_PREF, 0, 0); - column_set->AddPaddingColumn(0, LayoutDelegate::Get()->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_HORIZONTAL_SPACING)); + column_set->AddPaddingColumn( + 0, + LayoutDelegate::Get()->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING)); column_set->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER, 0, views::GridLayout::USE_PREF, 0, 0); column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER,
diff --git a/chrome/browser/ui/views/harmony/harmony_layout_delegate.cc b/chrome/browser/ui/views/harmony/harmony_layout_delegate.cc index d3eaa40..7ffd685 100644 --- a/chrome/browser/ui/views/harmony/harmony_layout_delegate.cc +++ b/chrome/browser/ui/views/harmony/harmony_layout_delegate.cc
@@ -15,28 +15,24 @@ return harmony_layout_delegate_.Pointer(); } -int HarmonyLayoutDelegate::GetLayoutDistance(LayoutDistanceType type) const { - switch (type) { - case LayoutDistanceType::PANEL_HORIZ_MARGIN: +int HarmonyLayoutDelegate::GetMetric(Metric metric) const { + switch (metric) { + case Metric::DIALOG_BUTTON_MARGIN: return kHarmonyLayoutUnit; - case LayoutDistanceType::PANEL_VERT_MARGIN: + case Metric::PANEL_CONTENT_MARGIN: return kHarmonyLayoutUnit; - case LayoutDistanceType::RELATED_BUTTON_HORIZONTAL_SPACING: + case Metric::RELATED_BUTTON_HORIZONTAL_SPACING: return kHarmonyLayoutUnit / 2; - case LayoutDistanceType::RELATED_CONTROL_HORIZONTAL_SPACING: + case Metric::RELATED_CONTROL_HORIZONTAL_SPACING: return kHarmonyLayoutUnit; - case LayoutDistanceType::RELATED_CONTROL_VERTICAL_SPACING: + case Metric::RELATED_CONTROL_VERTICAL_SPACING: return kHarmonyLayoutUnit / 2; - case LayoutDistanceType::UNRELATED_CONTROL_VERTICAL_SPACING: - return kHarmonyLayoutUnit; - case LayoutDistanceType::UNRELATED_CONTROL_LARGE_VERTICAL_SPACING: - return kHarmonyLayoutUnit; - case LayoutDistanceType::BUTTON_VEDGE_MARGIN_NEW: - return kHarmonyLayoutUnit; - case LayoutDistanceType::BUTTON_HEDGE_MARGIN_NEW: - return kHarmonyLayoutUnit; - case LayoutDistanceType::CHECKBOX_INDENT: + case Metric::SUBSECTION_HORIZONTAL_INDENT: return 0; + case Metric::UNRELATED_CONTROL_VERTICAL_SPACING: + return kHarmonyLayoutUnit; + case Metric::UNRELATED_CONTROL_VERTICAL_SPACING_LARGE: + return kHarmonyLayoutUnit; } NOTREACHED(); return 0; @@ -55,13 +51,13 @@ return true; } -int HarmonyLayoutDelegate::GetDialogPreferredWidth(DialogWidthType type) const { - switch (type) { - case DialogWidthType::SMALL: +int HarmonyLayoutDelegate::GetDialogPreferredWidth(DialogWidth width) const { + switch (width) { + case DialogWidth::SMALL: return 320; - case DialogWidthType::MEDIUM: + case DialogWidth::MEDIUM: return 448; - case DialogWidthType::LARGE: + case DialogWidth::LARGE: return 512; } NOTREACHED();
diff --git a/chrome/browser/ui/views/harmony/harmony_layout_delegate.h b/chrome/browser/ui/views/harmony/harmony_layout_delegate.h index 61b2aa0..4f478db 100644 --- a/chrome/browser/ui/views/harmony/harmony_layout_delegate.h +++ b/chrome/browser/ui/views/harmony/harmony_layout_delegate.h
@@ -10,7 +10,7 @@ class HarmonyLayoutDelegate : public LayoutDelegate { public: // The Harmony layout unit. All distances are in terms of this unit. - static const int kHarmonyLayoutUnit = 16; + static constexpr int kHarmonyLayoutUnit = 16; HarmonyLayoutDelegate() {} ~HarmonyLayoutDelegate() override {} @@ -19,11 +19,11 @@ static HarmonyLayoutDelegate* Get(); // views::LayoutDelegate: - int GetLayoutDistance(LayoutDistanceType type) const override; + int GetMetric(Metric metric) const override; views::GridLayout::Alignment GetControlLabelGridAlignment() const override; bool UseExtraDialogPadding() const override; bool IsHarmonyMode() const override; - int GetDialogPreferredWidth(DialogWidthType type) const override; + int GetDialogPreferredWidth(DialogWidth width) const override; private: DISALLOW_COPY_AND_ASSIGN(HarmonyLayoutDelegate);
diff --git a/chrome/browser/ui/views/harmony/layout_delegate.cc b/chrome/browser/ui/views/harmony/layout_delegate.cc index 80a6dce..7ce3ec9 100644 --- a/chrome/browser/ui/views/harmony/layout_delegate.cc +++ b/chrome/browser/ui/views/harmony/layout_delegate.cc
@@ -20,28 +20,24 @@ : layout_delegate_.Pointer(); } -int LayoutDelegate::GetLayoutDistance(LayoutDistanceType type) const { - switch (type) { - case LayoutDistanceType::PANEL_HORIZ_MARGIN: - return views::kPanelHorizMargin; - case LayoutDistanceType::PANEL_VERT_MARGIN: - return views::kPanelVertMargin; - case LayoutDistanceType::RELATED_BUTTON_HORIZONTAL_SPACING: - return views::kRelatedButtonHSpacing; - case LayoutDistanceType::RELATED_CONTROL_HORIZONTAL_SPACING: - return views::kRelatedControlHorizontalSpacing; - case LayoutDistanceType::RELATED_CONTROL_VERTICAL_SPACING: - return views::kRelatedControlVerticalSpacing; - case LayoutDistanceType::UNRELATED_CONTROL_VERTICAL_SPACING: - return views::kUnrelatedControlVerticalSpacing; - case LayoutDistanceType::UNRELATED_CONTROL_LARGE_VERTICAL_SPACING: - return views::kUnrelatedControlLargeVerticalSpacing; - case LayoutDistanceType::BUTTON_VEDGE_MARGIN_NEW: - return views::kButtonVEdgeMarginNew; - case LayoutDistanceType::BUTTON_HEDGE_MARGIN_NEW: +int LayoutDelegate::GetMetric(Metric metric) const { + switch (metric) { + case Metric::DIALOG_BUTTON_MARGIN: return views::kButtonHEdgeMarginNew; - case LayoutDistanceType::CHECKBOX_INDENT: + case Metric::PANEL_CONTENT_MARGIN: + return views::kPanelHorizMargin; + case Metric::RELATED_BUTTON_HORIZONTAL_SPACING: + return views::kRelatedButtonHSpacing; + case Metric::RELATED_CONTROL_HORIZONTAL_SPACING: + return views::kRelatedControlHorizontalSpacing; + case Metric::RELATED_CONTROL_VERTICAL_SPACING: + return views::kRelatedControlVerticalSpacing; + case Metric::SUBSECTION_HORIZONTAL_INDENT: return views::kCheckboxIndent; + case Metric::UNRELATED_CONTROL_VERTICAL_SPACING: + return views::kUnrelatedControlVerticalSpacing; + case Metric::UNRELATED_CONTROL_VERTICAL_SPACING_LARGE: + return views::kUnrelatedControlLargeVerticalSpacing; } NOTREACHED(); return 0; @@ -60,6 +56,6 @@ return false; } -int LayoutDelegate::GetDialogPreferredWidth(DialogWidthType type) const { +int LayoutDelegate::GetDialogPreferredWidth(DialogWidth width) const { return 0; }
diff --git a/chrome/browser/ui/views/harmony/layout_delegate.h b/chrome/browser/ui/views/harmony/layout_delegate.h index c20092fd..737d56e8 100644 --- a/chrome/browser/ui/views/harmony/layout_delegate.h +++ b/chrome/browser/ui/views/harmony/layout_delegate.h
@@ -9,32 +9,30 @@ class LayoutDelegate { public: - enum class LayoutDistanceType { - // Left or right margin. - PANEL_HORIZ_MARGIN, - // Top or bottom margin. - PANEL_VERT_MARGIN, - // Horizontal spacing between controls that are logically related. + enum class Metric { + // Horizontal or vertical margin between the edge of a dialog and a + // contained button. + DIALOG_BUTTON_MARGIN, + // Horizontal or vertical margin between the edge of a panel and the + // contained content. + PANEL_CONTENT_MARGIN, + // Horizontal spacing between buttons that are logically related, e.g. + // for a button set. + RELATED_BUTTON_HORIZONTAL_SPACING, + // Horizontal spacing between other controls that are logically related. RELATED_CONTROL_HORIZONTAL_SPACING, // Vertical spacing between controls that are logically related. RELATED_CONTROL_VERTICAL_SPACING, - // Horizontal spacing between buttons that are logically related. - RELATED_BUTTON_HORIZONTAL_SPACING, + // Horizontal indent of a subsection relative to related items above, e.g. + // checkboxes below explanatory text/headings. + SUBSECTION_HORIZONTAL_INDENT, // Vertical spacing between controls that are logically unrelated. UNRELATED_CONTROL_VERTICAL_SPACING, // Larger vertical spacing between unrelated controls. - UNRELATED_CONTROL_LARGE_VERTICAL_SPACING, - // Vertical spacing between the edge of the window and the - // top or bottom of a button. - BUTTON_HEDGE_MARGIN_NEW, - // Horizontal spacing between the edge of the window and the - // left or right of a button. - BUTTON_VEDGE_MARGIN_NEW, - // Indent of checkboxes relative to related text. - CHECKBOX_INDENT, + UNRELATED_CONTROL_VERTICAL_SPACING_LARGE, }; - enum class DialogWidthType { + enum class DialogWidth { SMALL, MEDIUM, LARGE, @@ -44,14 +42,12 @@ virtual ~LayoutDelegate() {} // Returns the active LayoutDelegate singleton, depending on UI configuration. - // By default, this is the same instance returned by Get(), but if Harmony - // or another UI style is enabled, this may be an instance of a LayoutDelegate - // subclass instead. + // This may be an instance of this class or a subclass, e.g. a + // HarmonyLayoutDelegate. static LayoutDelegate* Get(); - // Returns a layout distance, indexed by |type|. These distances are in - // device-independent units. - virtual int GetLayoutDistance(LayoutDistanceType type) const; + // Returns the requested metric in DIPs. + virtual int GetMetric(Metric metric) const; // Returns the alignment used for control labels in a GridLayout; for example, // in this GridLayout: @@ -66,14 +62,17 @@ // Views for dialogs should not insert extra padding at their own edges. virtual bool UseExtraDialogPadding() const; - // Returns whether Harmony mode is enabled. This method is deprecated and - // should only be used in dire circumstances, such as when Harmony specifies a - // different distance type than was previously used. + // DEPRECATED. Returns whether Harmony mode is enabled. + // + // Instead of using this, create a generic solution that works for all UI + // types, e.g. by adding a new LayoutDistance value that means what you need. + // + // TODO(pkasting): Fix callers and remove this. virtual bool IsHarmonyMode() const; - // Returns the preferred width for a dialog of the specified width type. If - // there is no preferred width for |type|, returns 0. - virtual int GetDialogPreferredWidth(DialogWidthType type) const; + // Returns the preferred width in DIPs for a dialog of the specified |width|. + // May return 0 if the dialog has no preferred width. + virtual int GetDialogPreferredWidth(DialogWidth width) const; private: DISALLOW_COPY_AND_ASSIGN(LayoutDelegate);
diff --git a/chrome/browser/ui/views/layout_utils.cc b/chrome/browser/ui/views/layout_utils.cc index 5916fb9..27b2c088 100644 --- a/chrome/browser/ui/views/layout_utils.cc +++ b/chrome/browser/ui/views/layout_utils.cc
@@ -13,10 +13,8 @@ views::GridLayout* layout = new views::GridLayout(host); LayoutDelegate* delegate = LayoutDelegate::Get(); layout->SetInsets(gfx::Insets( - delegate->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType::PANEL_VERT_MARGIN), - delegate->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType::BUTTON_HEDGE_MARGIN_NEW))); + delegate->GetMetric(LayoutDelegate::Metric::PANEL_CONTENT_MARGIN), + delegate->GetMetric(LayoutDelegate::Metric::DIALOG_BUTTON_MARGIN))); host->SetLayoutManager(layout); return layout; }
diff --git a/chrome/browser/ui/views/login_view.cc b/chrome/browser/ui/views/login_view.cc index 04d7ccb9..2b50ecb 100644 --- a/chrome/browser/ui/views/login_view.cc +++ b/chrome/browser/ui/views/login_view.cc
@@ -58,9 +58,10 @@ column_set->AddPaddingColumn(0, kTextfieldStackHorizontalSpacing); column_set->AddColumn(layout_delegate->GetControlLabelGridAlignment(), GridLayout::CENTER, 0, GridLayout::USE_PREF, 0, 0); - column_set->AddPaddingColumn(0, layout_delegate->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_HORIZONTAL_SPACING)); + column_set->AddPaddingColumn( + 0, + layout_delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING)); column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 1, GridLayout::USE_PREF, 0, 0); if (layout_delegate->UseExtraDialogPadding()) @@ -73,33 +74,37 @@ message_label_->SetMultiLine(true); message_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); message_label_->SetAllowCharacterBreak(true); - layout->AddPaddingRow(0, layout_delegate->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_VERTICAL_SPACING)); + layout->AddPaddingRow( + 0, + layout_delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); layout->StartRow(0, single_column_view_set_id); layout->AddView(message_label_); } - layout->AddPaddingRow(0, layout_delegate->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType:: - UNRELATED_CONTROL_LARGE_VERTICAL_SPACING)); + layout->AddPaddingRow( + 0, + layout_delegate->GetMetric( + LayoutDelegate::Metric::UNRELATED_CONTROL_VERTICAL_SPACING_LARGE)); layout->StartRow(0, labels_column_set_id); layout->AddView(username_label_); layout->AddView(username_field_); - layout->AddPaddingRow(0, layout_delegate->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_VERTICAL_SPACING)); + layout->AddPaddingRow( + 0, + layout_delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); layout->StartRow(0, labels_column_set_id); layout->AddView(password_label_); layout->AddView(password_field_); if (layout_delegate->UseExtraDialogPadding()) { - layout->AddPaddingRow(0, layout_delegate->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType:: - UNRELATED_CONTROL_VERTICAL_SPACING)); + layout->AddPaddingRow( + 0, + layout_delegate->GetMetric( + LayoutDelegate::Metric::UNRELATED_CONTROL_VERTICAL_SPACING)); } if (login_model_data) {
diff --git a/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc b/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc index 30ca1bf..662e6d5 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc +++ b/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc
@@ -69,11 +69,10 @@ if (icon && label) { views::View* parent = new views::View(); - parent->SetLayoutManager( - new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, - LayoutDelegate::Get()->GetLayoutDistance( - LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_VERTICAL_SPACING))); + parent->SetLayoutManager(new views::BoxLayout( + views::BoxLayout::kHorizontal, 0, 0, + LayoutDelegate::Get()->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING))); parent->AddChildView(icon.release()); parent->AddChildView(label.release()); return parent; @@ -110,8 +109,8 @@ LayoutDelegate* delegate = LayoutDelegate::Get(); SetLayoutManager(new views::BoxLayout( views::BoxLayout::kVertical, 0, 0, - delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_VERTICAL_SPACING))); + delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING))); // Add the content string. views::Label* content_label = new views::Label( @@ -128,8 +127,9 @@ if (!item_list.empty()) { item_list_ = new views::Label(item_list); item_list_->SetBorder(views::CreateEmptyBorder( - 0, delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: - RELATED_CONTROL_HORIZONTAL_SPACING), + 0, + delegate->GetMetric( + LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING), 0, 0)); item_list_->SetMultiLine(true); item_list_->SizeToFit(width);
diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc index cbdeee7..9793463 100644 --- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc +++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
@@ -444,11 +444,10 @@ if (url.host_piece() == chrome::kChromeUIQuotaInternalsHost) return &NewWebUI<QuotaInternalsUI>; // Settings are implemented with native UI elements on Android. - // Handle chrome://settings if settings in a window and about in settings - // are enabled. + // Handle chrome://settings if settings in a window is enabled. if (url.host_piece() == chrome::kChromeUISettingsFrameHost || (url.host_piece() == chrome::kChromeUISettingsHost && - ::switches::AboutInSettingsEnabled())) { + ::switches::SettingsWindowEnabled())) { return &NewWebUI<options::OptionsUI>; } if (url.host_piece() == chrome::kChromeUISyncFileSystemInternalsHost)
diff --git a/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc index bb94fc9..8122d4fc 100644 --- a/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc +++ b/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc
@@ -358,8 +358,10 @@ js_display->Set("availableColorProfiles", available_color_profiles); if (display_manager->GetNumDisplays() > 1) { + // The settings UI must use the resolved display layout to show the + // actual applied layout. const display::DisplayPlacement placement = - display_manager->GetCurrentDisplayLayout().FindPlacementById( + display_manager->GetCurrentResolvedDisplayLayout().FindPlacementById( display.id()); if (placement.display_id != display::kInvalidDisplayId) { js_display->SetString(
diff --git a/chrome/browser/ui/webui/options/core_options_handler.cc b/chrome/browser/ui/webui/options/core_options_handler.cc index a647807..bd0a291b 100644 --- a/chrome/browser/ui/webui/options/core_options_handler.cc +++ b/chrome/browser/ui/webui/options/core_options_handler.cc
@@ -153,8 +153,6 @@ chrome::kSettingsSearchHelpURL); // About - localized_strings->SetBoolean("showAbout", - switches::AboutInSettingsEnabled()); localized_strings->SetString("aboutButton", l10n_util::GetStringUTF16(IDS_ABOUT_BUTTON));
diff --git a/chrome/browser/ui/webui/options/help_overlay_handler.cc b/chrome/browser/ui/webui/options/help_overlay_handler.cc index 9478d28..fafc0fc 100644 --- a/chrome/browser/ui/webui/options/help_overlay_handler.cc +++ b/chrome/browser/ui/webui/options/help_overlay_handler.cc
@@ -21,12 +21,13 @@ void HelpOverlayHandler::GetLocalizedValues( base::DictionaryValue* localized_strings) { - RegisterTitle(localized_strings, "aboutOverlay", IDS_ABOUT_TITLE); + if (::switches::SettingsWindowEnabled()) + RegisterTitle(localized_strings, "aboutOverlay", IDS_ABOUT_TITLE); HelpHandler::GetLocalizedValues(localized_strings); } void HelpOverlayHandler::RegisterMessages() { - if (::switches::AboutInSettingsEnabled()) + if (::switches::SettingsWindowEnabled()) web_ui()->AddMessageHandler(base::MakeUnique<HelpHandler>()); }
diff --git a/chrome/browser/ui/webui/print_preview/extension_printer_handler.cc b/chrome/browser/ui/webui/print_preview/extension_printer_handler.cc index 3e5cd88a..44770806 100644 --- a/chrome/browser/ui/webui/print_preview/extension_printer_handler.cc +++ b/chrome/browser/ui/webui/print_preview/extension_printer_handler.cc
@@ -33,7 +33,6 @@ #include "extensions/common/permissions/usb_device_permission.h" #include "extensions/common/permissions/usb_device_permission_data.h" #include "extensions/common/value_builder.h" -#include "printing/pdf_render_settings.h" #include "printing/pwg_raster_settings.h" using device::UsbDevice;
diff --git a/chrome/browser/ui/webui/settings/chromeos/fingerprint_handler.cc b/chrome/browser/ui/webui/settings/chromeos/fingerprint_handler.cc new file mode 100644 index 0000000..f25aaa7 --- /dev/null +++ b/chrome/browser/ui/webui/settings/chromeos/fingerprint_handler.cc
@@ -0,0 +1,127 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/webui/settings/chromeos/fingerprint_handler.h" + +#include "base/bind.h" +#include "base/memory/ptr_util.h" +#include "base/values.h" + +namespace chromeos { +namespace settings { + +FingerprintHandler::FingerprintHandler() {} + +FingerprintHandler::~FingerprintHandler() {} + +void FingerprintHandler::RegisterMessages() { + web_ui()->RegisterMessageCallback( + "getFingerprintsList", + base::Bind(&FingerprintHandler::HandleGetFingerprintsList, + base::Unretained(this))); + web_ui()->RegisterMessageCallback( + "startEnroll", + base::Bind(&FingerprintHandler::HandleStartEnroll, + base::Unretained(this))); + web_ui()->RegisterMessageCallback( + "cancelCurrentEnroll", + base::Bind(&FingerprintHandler::HandleCancelCurrentEnroll, + base::Unretained(this))); + web_ui()->RegisterMessageCallback( + "getEnrollmentLabel", + base::Bind(&FingerprintHandler::HandleGetEnrollmentLabel, + base::Unretained(this))); + web_ui()->RegisterMessageCallback( + "removeEnrollment", + base::Bind(&FingerprintHandler::HandleRemoveEnrollment, + base::Unretained(this))); + web_ui()->RegisterMessageCallback( + "changeEnrollmentLabel", + base::Bind(&FingerprintHandler::HandleChangeEnrollmentLabel, + base::Unretained(this))); + web_ui()->RegisterMessageCallback( + "startAuthentication", + base::Bind(&FingerprintHandler::HandleStartAuthentication, + base::Unretained(this))); + web_ui()->RegisterMessageCallback( + "endCurrentAuthentication", + base::Bind(&FingerprintHandler::HandleEndCurrentAuthentication, + base::Unretained(this))); +} + +void FingerprintHandler::OnJavascriptAllowed() {} + +void FingerprintHandler::OnJavascriptDisallowed() {} + +void FingerprintHandler::HandleGetFingerprintsList( + const base::ListValue* args) { + AllowJavascript(); + + CHECK_EQ(1U, args->GetSize()); + std::string callback_id; + CHECK(args->GetString(0, &callback_id)); + + // TODO(sammiequon): Send more than empty list. + base::ListValue fingerprints_list; + ResolveJavascriptCallback(base::StringValue(callback_id), fingerprints_list); +} + +void FingerprintHandler::HandleStartEnroll(const base::ListValue* args) { +} + +void FingerprintHandler::HandleCancelCurrentEnroll( + const base::ListValue* args) { +} + +void FingerprintHandler::HandleGetEnrollmentLabel(const base::ListValue* args) { + AllowJavascript(); + + CHECK_EQ(1U, args->GetSize()); + std::string callback_id; + CHECK(args->GetString(0, &callback_id)); + + // TODO(sammiequon): Send the proper label. + ResolveJavascriptCallback(base::StringValue(callback_id), + base::StringValue("Label")); +} + +void FingerprintHandler::HandleRemoveEnrollment(const base::ListValue* args) { + AllowJavascript(); + + CHECK_EQ(2U, args->GetSize()); + std::string callback_id; + int index; + CHECK(args->GetString(0, &callback_id)); + CHECK(args->GetInteger(1, &index)); + + // TODO(sammiequon): Send more than empty list. + base::ListValue fingerprints_list; + ResolveJavascriptCallback(base::StringValue(callback_id), fingerprints_list); +} + +void FingerprintHandler::HandleChangeEnrollmentLabel( + const base::ListValue* args) { + AllowJavascript(); + + CHECK_EQ(2U, args->GetSize()); + std::string callback_id; + std::string new_label; + CHECK(args->GetString(0, &callback_id)); + CHECK(args->GetString(1, &new_label)); + + // TODO(sammiequon): Send the proper label. + ResolveJavascriptCallback(base::StringValue(callback_id), + base::StringValue("Label")); +} + +void FingerprintHandler::HandleStartAuthentication( + const base::ListValue* args) { +} + +void FingerprintHandler::HandleEndCurrentAuthentication( + const base::ListValue* args) { +} + +} // namespace settings +} // namespace chromeos
diff --git a/chrome/browser/ui/webui/settings/chromeos/fingerprint_handler.h b/chrome/browser/ui/webui/settings/chromeos/fingerprint_handler.h new file mode 100644 index 0000000..8f65baa --- /dev/null +++ b/chrome/browser/ui/webui/settings/chromeos/fingerprint_handler.h
@@ -0,0 +1,44 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_FINGERPRINT_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_FINGERPRINT_HANDLER_H_ + +#include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" + +namespace base { +class ListValue; +} // namespace base + +namespace chromeos { +namespace settings { + +// Chrome OS fingerprint setup settings page UI handler. +class FingerprintHandler : public ::settings::SettingsPageUIHandler { + public: + FingerprintHandler(); + ~FingerprintHandler() override; + + // SettingsPageUIHandler overrides: + void RegisterMessages() override; + void OnJavascriptAllowed() override; + void OnJavascriptDisallowed() override; + + private: + void HandleGetFingerprintsList(const base::ListValue* args); + void HandleStartEnroll(const base::ListValue* args); + void HandleCancelCurrentEnroll(const base::ListValue* args); + void HandleGetEnrollmentLabel(const base::ListValue* args); + void HandleRemoveEnrollment(const base::ListValue* args); + void HandleChangeEnrollmentLabel(const base::ListValue* args); + void HandleStartAuthentication(const base::ListValue* args); + void HandleEndCurrentAuthentication(const base::ListValue* args); + + DISALLOW_COPY_AND_ASSIGN(FingerprintHandler); +}; + +} // namespace settings +} // namespace chromeos + +#endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_FINGERPRINT_HANDLER_H_
diff --git a/chrome/browser/ui/webui/settings/md_settings_ui.cc b/chrome/browser/ui/webui/settings/md_settings_ui.cc index 3a38cae..0965328 100644 --- a/chrome/browser/ui/webui/settings/md_settings_ui.cc +++ b/chrome/browser/ui/webui/settings/md_settings_ui.cc
@@ -59,6 +59,7 @@ #include "chrome/browser/ui/webui/settings/chromeos/device_power_handler.h" #include "chrome/browser/ui/webui/settings/chromeos/device_storage_handler.h" #include "chrome/browser/ui/webui/settings/chromeos/easy_unlock_settings_handler.h" +#include "chrome/browser/ui/webui/settings/chromeos/fingerprint_handler.h" #include "chrome/browser/ui/webui/settings/chromeos/internet_handler.h" #include "chrome/common/chrome_switches.h" #include "components/arc/arc_util.h" @@ -121,6 +122,8 @@ AddSettingsPageUIHandler( base::MakeUnique<chromeos::settings::CupsPrintersHandler>(web_ui)); AddSettingsPageUIHandler( + base::MakeUnique<chromeos::settings::FingerprintHandler>()); + AddSettingsPageUIHandler( base::MakeUnique<chromeos::settings::KeyboardHandler>(web_ui)); AddSettingsPageUIHandler( base::MakeUnique<chromeos::settings::PointerHandler>()); @@ -141,6 +144,7 @@ content::WebUIDataSource* html_source = content::WebUIDataSource::Create(url.host()); + html_source->AddString("hostname", url.host()); #if defined(OS_CHROMEOS) chromeos::settings::EasyUnlockSettingsHandler* easy_unlock_handler =
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc index 810c6db..6f26ffd 100644 --- a/chrome/common/chrome_features.cc +++ b/chrome/common/chrome_features.cc
@@ -180,6 +180,13 @@ const base::Feature kPermissionsBlacklist{ "PermissionsBlacklist", base::FEATURE_DISABLED_BY_DEFAULT}; +// Enables postscript generation instead of emf when printing to postscript +// capable printers. +#if defined(OS_WIN) +const base::Feature kPostScriptPrinting{"PostScriptPrinting", + base::FEATURE_DISABLED_BY_DEFAULT}; +#endif // OS_WIN + #if BUILDFLAG(ENABLE_PLUGINS) // Prefer HTML content by hiding Flash from the list of plugins. // https://crbug.com/626728
diff --git a/chrome/common/chrome_features.h b/chrome/common/chrome_features.h index 38bd2606..d78d6c7 100644 --- a/chrome/common/chrome_features.h +++ b/chrome/common/chrome_features.h
@@ -107,6 +107,10 @@ extern const base::Feature kPermissionsBlacklist; +#if defined(OS_WIN) +extern const base::Feature kPostScriptPrinting; +#endif + #if BUILDFLAG(ENABLE_PLUGINS) extern const base::Feature kPreferHtmlOverPlugins; #endif
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 027f2ab3..bb414a62 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc
@@ -163,10 +163,6 @@ // Tells the diagnostics mode to do the requested recovery step(s). const char kDiagnosticsRecovery[] = "diagnostics-recovery"; -// When kEnableSettingsWindow is used, About is shown as an overlay in Settings -// instead of as a separate page, unless this flag is specified. -const char kDisableAboutInSettings[] = "disable-about-in-settings"; - // Disables the display of a banner allowing the user to add a web // app to their shelf (or platform-specific equivalent) const char kDisableAddToShelf[] = "disable-add-to-shelf"; @@ -1142,12 +1138,6 @@ extern const char kEnableInputImeAPI[] = "enable-input-ime-api"; #endif -bool AboutInSettingsEnabled() { - return SettingsWindowEnabled() && - !base::CommandLine::ForCurrentProcess()->HasSwitch( - ::switches::kDisableAboutInSettings); -} - bool ExtensionsDisabled(const base::CommandLine& command_line) { return command_line.HasSwitch(switches::kDisableExtensions) || command_line.HasSwitch(switches::kDisableExtensionsExcept);
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index e4cd9d0..9bb2cbf 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h
@@ -65,7 +65,6 @@ extern const char kDiagnostics[]; extern const char kDiagnosticsFormat[]; extern const char kDiagnosticsRecovery[]; -extern const char kDisableAboutInSettings[]; extern const char kDisableAddToShelf[]; extern const char kDisableBackgroundNetworking[]; extern const char kDisableBundledPpapiFlash[]; @@ -352,7 +351,6 @@ extern const char kEnableInputImeAPI[]; #endif -bool AboutInSettingsEnabled(); bool ExtensionsDisabled(const base::CommandLine& command_line); bool MdFeedbackEnabled(); bool MdPolicyPageEnabled();
diff --git a/chrome/common/chrome_utility_printing_messages.h b/chrome/common/chrome_utility_printing_messages.h index bce3da90..f5712a7 100644 --- a/chrome/common/chrome_utility_printing_messages.h +++ b/chrome/common/chrome_utility_printing_messages.h
@@ -32,6 +32,7 @@ IPC_STRUCT_TRAITS_BEGIN(printing::PdfRenderSettings) IPC_STRUCT_TRAITS_MEMBER(area) + IPC_STRUCT_TRAITS_MEMBER(offsets) IPC_STRUCT_TRAITS_MEMBER(dpi) IPC_STRUCT_TRAITS_MEMBER(autorotate) IPC_STRUCT_TRAITS_MEMBER(mode) @@ -120,7 +121,7 @@ // Requests utility process to stop conversion and exit. IPC_MESSAGE_CONTROL0(ChromeUtilityMsg_RenderPDFPagesToMetafiles_Stop) -#endif // ENABLE_PRINTING && OS_WIN +#endif // BUILDFLAG(ENABLE_PRINTING) && defined(OS_WIN) //------------------------------------------------------------------------------ // Utility process host messages:
diff --git a/chrome/service/cloud_print/print_system_win.cc b/chrome/service/cloud_print/print_system_win.cc index 2641365..d0b731b 100644 --- a/chrome/service/cloud_print/print_system_win.cc +++ b/chrome/service/cloud_print/print_system_win.cc
@@ -444,10 +444,10 @@ // We should enable autorotation once server will be able to generate // PDF that matches paper size and orientation. if (utility_host->StartRenderPDFPagesToMetafile( - pdf_path, - printing::PdfRenderSettings( - render_area, render_dpi, false, - printing::PdfRenderSettings::Mode::NORMAL))) { + pdf_path, printing::PdfRenderSettings( + render_area, gfx::Point(0,0), render_dpi, + /*autorotate=*/false, + printing::PdfRenderSettings::Mode::NORMAL))) { // The object will self-destruct when the child process dies. ignore_result(utility_host.release()); } else {
diff --git a/chrome/utility/printing_handler.cc b/chrome/utility/printing_handler.cc index 390cd39b..6e97c7b2 100644 --- a/chrome/utility/printing_handler.cc +++ b/chrome/utility/printing_handler.cc
@@ -89,8 +89,16 @@ IPC::PlatformFileForTransit pdf_transit, const PdfRenderSettings& settings) { pdf_rendering_settings_ = settings; + chrome_pdf::SetPDFPostscriptPrintingLevel(0); // Not using postscript. chrome_pdf::SetPDFUseGDIPrinting(pdf_rendering_settings_.mode == PdfRenderSettings::Mode::GDI_TEXT); + if (pdf_rendering_settings_.mode == + PdfRenderSettings::Mode::POSTSCRIPT_LEVEL2) { + chrome_pdf::SetPDFPostscriptPrintingLevel(2); + } else if (pdf_rendering_settings_.mode == + PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3) { + chrome_pdf::SetPDFPostscriptPrintingLevel(3); + } base::File pdf_file = IPC::PlatformFileForTransitToFile(pdf_transit); int page_count = LoadPDF(std::move(pdf_file)); Send( @@ -102,8 +110,12 @@ IPC::PlatformFileForTransit output_file) { base::File emf_file = IPC::PlatformFileForTransitToFile(output_file); float scale_factor = 1.0f; - bool success = - RenderPdfPageToMetafile(page_number, std::move(emf_file), &scale_factor); + bool postscript = pdf_rendering_settings_.mode == + PdfRenderSettings::Mode::POSTSCRIPT_LEVEL2 || + pdf_rendering_settings_.mode == + PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3; + bool success = RenderPdfPageToMetafile(page_number, std::move(emf_file), + &scale_factor, postscript); Send(new ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageDone( success, scale_factor)); } @@ -112,7 +124,7 @@ ReleaseProcessIfNeeded(); } -#endif // OS_WIN +#endif // defined(OS_WIN) #if BUILDFLAG(ENABLE_PRINT_PREVIEW) void PrintingHandler::OnRenderPDFPagesToPWGRaster( @@ -130,7 +142,7 @@ } ReleaseProcessIfNeeded(); } -#endif // ENABLE_PRINT_PREVIEW +#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) #if defined(OS_WIN) int PrintingHandler::LoadPDF(base::File pdf_file) { @@ -153,7 +165,8 @@ bool PrintingHandler::RenderPdfPageToMetafile(int page_number, base::File output_file, - float* scale_factor) { + float* scale_factor, + bool postscript) { Emf metafile; metafile.Init(); @@ -164,18 +177,30 @@ // original coordinates and we'll be able to print in full resolution. // Before playback we'll need to counter the scaling up that will happen // in the service (print_system_win.cc). - *scale_factor = gfx::CalculatePageScale( - metafile.context(), pdf_rendering_settings_.area.right(), - pdf_rendering_settings_.area.bottom()); - gfx::ScaleDC(metafile.context(), *scale_factor); + // + // The postscript driver does not use the metafile size since it outputs + // postscript rather than a metafile. Instead it uses the printable area + // sent to RenderPDFPageToDC to determine the area to render. Therefore, + // don't scale the DC to match the metafile, and send the printer physical + // offsets to the driver. + if (!postscript) { + *scale_factor = gfx::CalculatePageScale( + metafile.context(), pdf_rendering_settings_.area.right(), + pdf_rendering_settings_.area.bottom()); + gfx::ScaleDC(metafile.context(), *scale_factor); + } // The underlying metafile is of type Emf and ignores the arguments passed // to StartPage. metafile.StartPage(gfx::Size(), gfx::Rect(), 1); + int offset_x = postscript ? pdf_rendering_settings_.offsets.x() : 0; + int offset_y = postscript ? pdf_rendering_settings_.offsets.y() : 0; + if (!chrome_pdf::RenderPDFPageToDC( &pdf_data_.front(), pdf_data_.size(), page_number, metafile.context(), - pdf_rendering_settings_.dpi, pdf_rendering_settings_.area.x(), - pdf_rendering_settings_.area.y(), + pdf_rendering_settings_.dpi, + pdf_rendering_settings_.area.x() - offset_x, + pdf_rendering_settings_.area.y() - offset_y, pdf_rendering_settings_.area.width(), pdf_rendering_settings_.area.height(), true, false, true, true, pdf_rendering_settings_.autorotate)) { @@ -309,6 +334,6 @@ } ReleaseProcessIfNeeded(); } -#endif // ENABLE_PRINT_PREVIEW +#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) } // namespace printing
diff --git a/chrome/utility/printing_handler.h b/chrome/utility/printing_handler.h index 0d71af2..88a7536a 100644 --- a/chrome/utility/printing_handler.h +++ b/chrome/utility/printing_handler.h
@@ -52,7 +52,8 @@ int LoadPDF(base::File pdf_file); bool RenderPdfPageToMetafile(int page_number, base::File output_file, - float* scale_factor); + float* scale_factor, + bool postscript); #endif // OS_WIN #if BUILDFLAG(ENABLE_PRINT_PREVIEW) bool RenderPDFPagesToPWGRaster(base::File pdf_file,
diff --git a/components/metrics/file_metrics_provider.cc b/components/metrics/file_metrics_provider.cc index 1972019e..24cfa9b 100644 --- a/components/metrics/file_metrics_provider.cc +++ b/components/metrics/file_metrics_provider.cc
@@ -122,6 +122,8 @@ : task_runner_(task_runner), pref_service_(local_state), weak_factory_(this) { + base::StatisticsRecorder::RegisterHistogramProvider( + weak_factory_.GetWeakPtr()); } FileMetricsProvider::~FileMetricsProvider() {} @@ -522,20 +524,6 @@ return !sources_for_previous_run_.empty(); } -void FileMetricsProvider::MergeHistogramDeltas() { - DCHECK(thread_checker_.CalledOnValidThread()); - - // Measure the total time spent processing all sources as well as the time - // per individual file. This method is called on the UI thread so it's - // important to know how much total "jank" may be introduced. - SCOPED_UMA_HISTOGRAM_TIMER("UMA.FileMetricsProvider.SnapshotTime.Total"); - - for (std::unique_ptr<SourceInfo>& source : sources_mapped_) { - SCOPED_UMA_HISTOGRAM_TIMER("UMA.FileMetricsProvider.SnapshotTime.File"); - MergeHistogramDeltasFromSource(source.get()); - } -} - void FileMetricsProvider::RecordInitialHistogramSnapshots( base::HistogramSnapshotManager* snapshot_manager) { DCHECK(thread_checker_.CalledOnValidThread()); @@ -564,4 +552,18 @@ } } +void FileMetricsProvider::MergeHistogramDeltas() { + DCHECK(thread_checker_.CalledOnValidThread()); + + // Measure the total time spent processing all sources as well as the time + // per individual file. This method is called on the UI thread so it's + // important to know how much total "jank" may be introduced. + SCOPED_UMA_HISTOGRAM_TIMER("UMA.FileMetricsProvider.SnapshotTime.Total"); + + for (std::unique_ptr<SourceInfo>& source : sources_mapped_) { + SCOPED_UMA_HISTOGRAM_TIMER("UMA.FileMetricsProvider.SnapshotTime.File"); + MergeHistogramDeltasFromSource(source.get()); + } +} + } // namespace metrics
diff --git a/components/metrics/file_metrics_provider.h b/components/metrics/file_metrics_provider.h index ba2e9f9..080a821 100644 --- a/components/metrics/file_metrics_provider.h +++ b/components/metrics/file_metrics_provider.h
@@ -13,6 +13,7 @@ #include "base/files/file_path.h" #include "base/gtest_prod_util.h" #include "base/memory/weak_ptr.h" +#include "base/metrics/statistics_recorder.h" #include "base/threading/thread_checker.h" #include "base/time/time.h" #include "components/metrics/metrics_provider.h" @@ -30,7 +31,8 @@ // Any number of files can be registered and will be polled once per upload // cycle (at startup and periodically thereafter -- about every 30 minutes // for desktop) for data to send. -class FileMetricsProvider : public MetricsProvider { +class FileMetricsProvider : public MetricsProvider, + public base::StatisticsRecorder::HistogramProvider { public: enum SourceType { // "Atomic" files are a collection of histograms that are written @@ -172,10 +174,12 @@ // metrics::MetricsDataProvider: void OnDidCreateMetricsLog() override; bool HasInitialStabilityMetrics() override; - void MergeHistogramDeltas() override; void RecordInitialHistogramSnapshots( base::HistogramSnapshotManager* snapshot_manager) override; + // base::StatisticsRecorder::HistogramProvider: + void MergeHistogramDeltas() override; + // A task-runner capable of performing I/O. scoped_refptr<base::TaskRunner> task_runner_;
diff --git a/components/metrics/metrics_provider.cc b/components/metrics/metrics_provider.cc index 50f621a..fd864e41 100644 --- a/components/metrics/metrics_provider.cc +++ b/components/metrics/metrics_provider.cc
@@ -50,9 +50,6 @@ ChromeUserMetricsExtension* uma_proto) { } -void MetricsProvider::MergeHistogramDeltas() { -} - void MetricsProvider::RecordHistogramSnapshots( base::HistogramSnapshotManager* snapshot_manager) { }
diff --git a/components/metrics/metrics_provider.h b/components/metrics/metrics_provider.h index 21cd17f9..54c0a89 100644 --- a/components/metrics/metrics_provider.h +++ b/components/metrics/metrics_provider.h
@@ -76,10 +76,6 @@ virtual void ProvideGeneralMetrics( ChromeUserMetricsExtension* uma_proto); - // Called during regular collection to explicitly merge histogram deltas - // to the global StatisticsRecorder. - virtual void MergeHistogramDeltas(); - // Called during regular collection to explicitly load histogram snapshots // using a snapshot manager. PrepareDeltas() will have already been called // and FinishDeltas() will be called later; calls to only PrepareDelta(),
diff --git a/components/metrics/metrics_service.cc b/components/metrics/metrics_service.cc index 55164d1f..7e5b492 100644 --- a/components/metrics/metrics_service.cc +++ b/components/metrics/metrics_service.cc
@@ -559,11 +559,6 @@ } } -void MetricsService::MergeHistogramDeltas() { - for (MetricsProvider* provider : metrics_providers_) - provider->MergeHistogramDeltas(); -} - //------------------------------------------------------------------------------ // private methods //------------------------------------------------------------------------------
diff --git a/components/metrics/metrics_service.h b/components/metrics/metrics_service.h index f00dcc76..36427b1 100644 --- a/components/metrics/metrics_service.h +++ b/components/metrics/metrics_service.h
@@ -198,9 +198,6 @@ int message_size, bool is_cellular); - // Merge any data from metrics providers into the global StatisticsRecorder. - void MergeHistogramDeltas(); - protected: // Exposed for testing. MetricsLogManager* log_manager() { return &log_manager_; }
diff --git a/components/printing/common/print_messages.h b/components/printing/common/print_messages.h index 36794997..9a90bc11 100644 --- a/components/printing/common/print_messages.h +++ b/components/printing/common/print_messages.h
@@ -20,6 +20,7 @@ #include "printing/page_size_margins.h" #include "printing/print_job_constants.h" #include "third_party/WebKit/public/web/WebPrintScalingOption.h" +#include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/ipc/geometry/gfx_param_traits.h" #include "ui/gfx/ipc/skia/gfx_skia_param_traits.h" @@ -306,6 +307,10 @@ // The printable area the page author specified. IPC_STRUCT_MEMBER(gfx::Rect, content_area) + + // The physical offsets of the printer in DPI. Used for PS printing. + IPC_STRUCT_MEMBER(gfx::Point, physical_offsets) + IPC_STRUCT_END() // TODO(dgn) Rename *ScriptedPrint messages because they are not called only
diff --git a/components/printing/renderer/print_web_view_helper.cc b/components/printing/renderer/print_web_view_helper.cc index 4f49e16..89c4601 100644 --- a/components/printing/renderer/print_web_view_helper.cc +++ b/components/printing/renderer/print_web_view_helper.cc
@@ -1100,6 +1100,7 @@ // printing and it expects real printable_area value. // See http://crbug.com/123408 PrintMsg_Print_Params& print_params = print_pages_params_->params; + printer_printable_area_ = print_params.printable_area; print_params.printable_area = gfx::Rect(print_params.page_size); // Render Pages for printing. @@ -1334,7 +1335,7 @@ base::TimeTicks begin_time = base::TimeTicks::Now(); PrintPageInternal(page_params, print_preview_context_.prepared_frame(), - initial_render_metafile, nullptr, nullptr); + initial_render_metafile, nullptr, nullptr, nullptr); print_preview_context_.RenderedPreviewPage( base::TimeTicks::Now() - begin_time); if (draft_metafile.get()) { @@ -1835,7 +1836,8 @@ blink::WebLocalFrame* frame, PdfMetafileSkia* metafile, gfx::Size* page_size_in_dpi, - gfx::Rect* content_area_in_dpi) { + gfx::Rect* content_area_in_dpi, + gfx::Rect* printable_area_in_dpi) { PageSizeMargins page_layout_in_points; double css_scale_factor = 1.0f; @@ -1865,6 +1867,9 @@ *content_area_in_dpi = gfx::Rect(0, 0, page_size_in_dpi->width(), page_size_in_dpi->height()); } + if (printable_area_in_dpi) { + *printable_area_in_dpi = printer_printable_area_; + } gfx::Rect canvas_area = params.params.display_header_footer ? gfx::Rect(page_size) : content_area;
diff --git a/components/printing/renderer/print_web_view_helper.h b/components/printing/renderer/print_web_view_helper.h index e603411..7c1fdbd 100644 --- a/components/printing/renderer/print_web_view_helper.h +++ b/components/printing/renderer/print_web_view_helper.h
@@ -290,7 +290,8 @@ blink::WebLocalFrame* frame, PdfMetafileSkia* metafile, gfx::Size* page_size_in_dpi, - gfx::Rect* content_area_in_dpi); + gfx::Rect* content_area_in_dpi, + gfx::Rect* printable_area_in_dpi); #endif // defined(OS_MACOSX) // Platform specific helper function for rendering page(s) to |metafile|. @@ -382,6 +383,7 @@ bool reset_prep_frame_view_; std::unique_ptr<PrintMsg_PrintPages_Params> print_pages_params_; + gfx::Rect printer_printable_area_; bool is_print_ready_metafile_sent_; bool ignore_css_margins_;
diff --git a/components/printing/renderer/print_web_view_helper_linux.cc b/components/printing/renderer/print_web_view_helper_linux.cc index 498432ce..f09e4b2 100644 --- a/components/printing/renderer/print_web_view_helper_linux.cc +++ b/components/printing/renderer/print_web_view_helper_linux.cc
@@ -58,7 +58,7 @@ page_params.params = params.params; for (int page_number : printed_pages) { page_params.page_number = page_number; - PrintPageInternal(page_params, frame, &metafile, nullptr, nullptr); + PrintPageInternal(page_params, frame, &metafile, nullptr, nullptr, nullptr); } // blink::printEnd() for PDF should be called before metafile is closed.
diff --git a/components/printing/renderer/print_web_view_helper_pdf_win.cc b/components/printing/renderer/print_web_view_helper_pdf_win.cc index 173c38a..acd25c2b 100644 --- a/components/printing/renderer/print_web_view_helper_pdf_win.cc +++ b/components/printing/renderer/print_web_view_helper_pdf_win.cc
@@ -24,6 +24,7 @@ std::vector<gfx::Size> page_size_in_dpi(printed_pages.size()); std::vector<gfx::Rect> content_area_in_dpi(printed_pages.size()); + std::vector<gfx::Rect> printable_area_in_dpi(printed_pages.size()); PdfMetafileSkia metafile(PDF_SKIA_DOCUMENT_TYPE); CHECK(metafile.Init()); @@ -32,11 +33,8 @@ page_params.params = params.params; for (size_t i = 0; i < printed_pages.size(); ++i) { page_params.page_number = printed_pages[i]; - PrintPageInternal(page_params, - frame, - &metafile, - &page_size_in_dpi[i], - &content_area_in_dpi[i]); + PrintPageInternal(page_params, frame, &metafile, &page_size_in_dpi[i], + &content_area_in_dpi[i], &printable_area_in_dpi[i]); } // blink::printEnd() for PDF should be called before metafile is closed. @@ -59,6 +57,8 @@ printed_page_params.page_number = printed_pages[i]; printed_page_params.page_size = page_size_in_dpi[i]; printed_page_params.content_area = content_area_in_dpi[i]; + printed_page_params.physical_offsets = + gfx::Point(printable_area_in_dpi[i].x(), printable_area_in_dpi[i].y()); Send(new PrintHostMsg_DidPrintPage(routing_id(), printed_page_params)); // Send the rest of the pages with an invalid metafile handle. // TODO(erikchen): Fix semantics. See https://crbug.com/640840
diff --git a/components/sessions/core/serialized_navigation_entry.cc b/components/sessions/core/serialized_navigation_entry.cc index 08685eb..ca686b0 100644 --- a/components/sessions/core/serialized_navigation_entry.cc +++ b/components/sessions/core/serialized_navigation_entry.cc
@@ -8,6 +8,7 @@ #include "base/pickle.h" #include "base/strings/utf_string_conversions.h" +#include "base/trace_event/memory_usage_estimator.h" #include "components/sessions/core/serialized_navigation_driver.h" #include "components/sync/base/time.h" #include "components/sync/protocol/session_specifics.pb.h" @@ -500,4 +501,19 @@ return sync_data; } +size_t SerializedNavigationEntry::EstimateMemoryUsage() const { + using base::trace_event::EstimateMemoryUsage; + return + EstimateMemoryUsage(referrer_url_) + + EstimateMemoryUsage(virtual_url_) + + EstimateMemoryUsage(title_) + + EstimateMemoryUsage(encoded_page_state_) + + EstimateMemoryUsage(original_request_url_) + + EstimateMemoryUsage(search_terms_) + + EstimateMemoryUsage(favicon_url_) + + EstimateMemoryUsage(redirect_chain_) + + EstimateMemoryUsage(content_pack_categories_) + + EstimateMemoryUsage(extended_info_map_); +} + } // namespace sessions
diff --git a/components/sessions/core/serialized_navigation_entry.h b/components/sessions/core/serialized_navigation_entry.h index 8601c97..3a8e665 100644 --- a/components/sessions/core/serialized_navigation_entry.h +++ b/components/sessions/core/serialized_navigation_entry.h
@@ -128,6 +128,8 @@ return extended_info_map_; } + size_t EstimateMemoryUsage() const; + private: friend class ContentSerializedNavigationBuilder; friend class ContentSerializedNavigationDriver; @@ -139,6 +141,8 @@ int index_; // Member variables corresponding to NavigationEntry fields. + // If you add a new field that can allocate memory, please also add + // it to the EstimatedMemoryUsage() implementation. int unique_id_; GURL referrer_url_; int referrer_policy_;
diff --git a/components/sessions/core/tab_restore_service.cc b/components/sessions/core/tab_restore_service.cc index 8bf3195..bd3183f 100644 --- a/components/sessions/core/tab_restore_service.cc +++ b/components/sessions/core/tab_restore_service.cc
@@ -4,6 +4,8 @@ #include "components/sessions/core/tab_restore_service.h" +#include "base/trace_event/memory_usage_estimator.h" + namespace sessions { // TimeFactory----------------------------------------------------------------- @@ -18,12 +20,31 @@ TabRestoreService::Entry::~Entry() = default; TabRestoreService::Entry::Entry(Type type) : id(next_entry_id++), type(type) {} +size_t TabRestoreService::Entry::EstimateMemoryUsage() const { + return 0; +} + TabRestoreService::Tab::Tab() : Entry(TAB) {} TabRestoreService::Tab::~Tab() = default; +size_t TabRestoreService::Tab::EstimateMemoryUsage() const { + using base::trace_event::EstimateMemoryUsage; + return + EstimateMemoryUsage(navigations) + + EstimateMemoryUsage(extension_app_id) + + EstimateMemoryUsage(user_agent_override); +} + TabRestoreService::Window::Window() : Entry(WINDOW) {} TabRestoreService::Window::~Window() = default; +size_t TabRestoreService::Window::EstimateMemoryUsage() const { + using base::trace_event::EstimateMemoryUsage; + return + EstimateMemoryUsage(tabs) + + EstimateMemoryUsage(app_name); +} + // TabRestoreService ---------------------------------------------------------- TabRestoreService::~TabRestoreService() {
diff --git a/components/sessions/core/tab_restore_service.h b/components/sessions/core/tab_restore_service.h index a851f81..2746da2 100644 --- a/components/sessions/core/tab_restore_service.h +++ b/components/sessions/core/tab_restore_service.h
@@ -69,6 +69,9 @@ // closed during this session. bool from_last_session = false; + // Estimates memory usage. By default returns 0. + virtual size_t EstimateMemoryUsage() const; + protected: explicit Entry(Type type); @@ -77,10 +80,15 @@ }; // Represents a previously open tab. + // If you add a new field that can allocate memory, please also add + // it to the EstimatedMemoryUsage() implementation. struct SESSIONS_EXPORT Tab : public Entry { Tab(); ~Tab() override; + // Entry: + size_t EstimateMemoryUsage() const override; + // The navigations. std::vector<SerializedNavigationEntry> navigations; @@ -108,10 +116,15 @@ }; // Represents a previously open window. + // If you add a new field that can allocate memory, please also add + // it to the EstimatedMemoryUsage() implementation. struct SESSIONS_EXPORT Window : public Entry { Window(); ~Window() override; + // Entry: + size_t EstimateMemoryUsage() const override; + // The tabs that comprised the window, in order. std::vector<std::unique_ptr<Tab>> tabs;
diff --git a/components/sessions/core/tab_restore_service_helper.cc b/components/sessions/core/tab_restore_service_helper.cc index 841f075..bbb41f5e 100644 --- a/components/sessions/core/tab_restore_service_helper.cc +++ b/components/sessions/core/tab_restore_service_helper.cc
@@ -4,6 +4,7 @@ #include "components/sessions/core/tab_restore_service_helper.h" +#include <inttypes.h> #include <stddef.h> #include <algorithm> @@ -13,6 +14,11 @@ #include "base/memory/ptr_util.h" #include "base/metrics/histogram.h" #include "base/stl_util.h" +#include "base/strings/stringprintf.h" +#include "base/threading/thread_task_runner_handle.h" +#include "base/trace_event/memory_dump_manager.h" +#include "base/trace_event/memory_usage_estimator.h" +#include "base/trace_event/process_memory_dump.h" #include "components/sessions/core/live_tab.h" #include "components/sessions/core/live_tab_context.h" #include "components/sessions/core/serialized_navigation_entry.h" @@ -48,11 +54,17 @@ restoring_(false), time_factory_(time_factory) { DCHECK(tab_restore_service_); + base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( + this, + "TabRestoreServiceHelper", + base::ThreadTaskRunnerHandle::Get()); } TabRestoreServiceHelper::~TabRestoreServiceHelper() { for (auto& observer : observer_list_) observer.TabRestoreServiceDestroyed(tab_restore_service_); + base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider( + this); } void TabRestoreServiceHelper::AddObserver( @@ -327,6 +339,57 @@ return entries_.end(); } +bool TabRestoreServiceHelper::OnMemoryDump( + const base::trace_event::MemoryDumpArgs& args, + base::trace_event::ProcessMemoryDump* pmd) { + using base::trace_event::MemoryAllocatorDump; + + const char* system_allocator_name = + base::trace_event::MemoryDumpManager::GetInstance() + ->system_allocator_pool_name(); + + std::string entries_dump_name = base::StringPrintf( + "tab_restore/service_helper_0x%" PRIXPTR "/entries", + reinterpret_cast<uintptr_t>(this)); + pmd->CreateAllocatorDump(entries_dump_name) + ->AddScalar(MemoryAllocatorDump::kNameObjectCount, + MemoryAllocatorDump::kUnitsObjects, + entries_.size()); + + for (const auto& entry : entries_) { + const char* type_string = ""; + switch (entry->type) { + case TabRestoreService::WINDOW: + type_string = "window"; + break; + case TabRestoreService::TAB: + type_string = "tab"; + break; + } + + std::string entry_dump_name = base::StringPrintf( + "%s/%s_0x%" PRIXPTR, + entries_dump_name.c_str(), + type_string, + reinterpret_cast<uintptr_t>(entry.get())); + auto* entry_dump = pmd->CreateAllocatorDump(entry_dump_name); + + entry_dump->AddScalar(MemoryAllocatorDump::kNameSize, + MemoryAllocatorDump::kUnitsBytes, + entry->EstimateMemoryUsage()); + + auto age = base::Time::Now() - entry->timestamp; + entry_dump->AddScalar("age", + MemoryAllocatorDump::kUnitsObjects, + age.InSeconds()); + + if (system_allocator_name) + pmd->AddSuballocation(entry_dump->guid(), system_allocator_name); + } + + return true; +} + // static bool TabRestoreServiceHelper::ValidateEntry(const Entry& entry) { switch (entry.type) {
diff --git a/components/sessions/core/tab_restore_service_helper.h b/components/sessions/core/tab_restore_service_helper.h index 3568e55..1d503b08 100644 --- a/components/sessions/core/tab_restore_service_helper.h +++ b/components/sessions/core/tab_restore_service_helper.h
@@ -11,6 +11,7 @@ #include "base/macros.h" #include "base/observer_list.h" #include "base/time/time.h" +#include "base/trace_event/memory_dump_provider.h" #include "components/sessions/core/session_id.h" #include "components/sessions/core/session_types.h" #include "components/sessions/core/sessions_export.h" @@ -27,7 +28,8 @@ // Helper class used to implement InMemoryTabRestoreService and // PersistentTabRestoreService. See tab_restore_service.h for method-level // comments. -class SESSIONS_EXPORT TabRestoreServiceHelper { +class SESSIONS_EXPORT TabRestoreServiceHelper + : public base::trace_event::MemoryDumpProvider { public: typedef TabRestoreService::Entries Entries; typedef TabRestoreService::Entry Entry; @@ -67,7 +69,7 @@ TabRestoreServiceClient* client, TimeFactory* time_factory); - ~TabRestoreServiceHelper(); + ~TabRestoreServiceHelper() override; // Helper methods used to implement TabRestoreService. void AddObserver(TabRestoreServiceObserver* observer); @@ -106,6 +108,10 @@ // resides is returned. Entries::iterator GetEntryIteratorById(SessionID::id_type id); + // From base::trace_event::MemoryDumpProvider + bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, + base::trace_event::ProcessMemoryDump* pmd) override; + // Calls either ValidateTab or ValidateWindow as appropriate. static bool ValidateEntry(const Entry& entry);
diff --git a/content/browser/bluetooth/bluetooth_device_chooser_controller.cc b/content/browser/bluetooth/bluetooth_device_chooser_controller.cc index ac2ac7b2..7221db3b 100644 --- a/content/browser/bluetooth/bluetooth_device_chooser_controller.cc +++ b/content/browser/bluetooth/bluetooth_device_chooser_controller.cc
@@ -79,11 +79,9 @@ bool BluetoothDeviceChooserController::use_test_scan_duration_ = false; namespace { -// Max length of device name in filter. A name coming from an adv packet -// is max 29 bytes (adv packet max size 31 bytes - 2 byte length field), -// but the name can also be acquired via gap.device_name, so it is limited -// to the max EIR packet size of 240 bytes. See Core Spec 5.0, vol 3, C, 8.1.2. -constexpr size_t kMaxLengthForDeviceName = 240; +// Max length of device name in filter. Bluetooth 5.0 3.C.3.2.2.3 states that +// the maximum device name length is 248 bytes (UTF-8 encoded). +constexpr size_t kMaxLengthForDeviceName = 248; // The duration of a Bluetooth Scan in seconds. constexpr int kScanDuration = 60;
diff --git a/content/browser/compositor/gpu_browser_compositor_output_surface.cc b/content/browser/compositor/gpu_browser_compositor_output_surface.cc index f0184f5..8ad8384 100644 --- a/content/browser/compositor/gpu_browser_compositor_output_surface.cc +++ b/content/browser/compositor/gpu_browser_compositor_output_surface.cc
@@ -24,8 +24,7 @@ scoped_refptr<ui::ContextProviderCommandBuffer> context, const UpdateVSyncParametersCallback& update_vsync_parameters_callback, std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> - overlay_candidate_validator, - bool support_stencil) + overlay_candidate_validator) : BrowserCompositorOutputSurface(std::move(context), update_vsync_parameters_callback, std::move(overlay_candidate_validator)), @@ -34,9 +33,8 @@ capabilities_.flipped_output_surface = context_provider()->ContextCapabilities().flips_vertically; } - // TODO(reveman): Check context as there's no guarantee we support this - // even if we request it. - capabilities_.supports_stencil = support_stencil; + capabilities_.supports_stencil = + context_provider()->ContextCapabilities().num_stencil_bits > 0; } GpuBrowserCompositorOutputSurface::~GpuBrowserCompositorOutputSurface() {
diff --git a/content/browser/compositor/gpu_browser_compositor_output_surface.h b/content/browser/compositor/gpu_browser_compositor_output_surface.h index 6e970a0..c2505264 100644 --- a/content/browser/compositor/gpu_browser_compositor_output_surface.h +++ b/content/browser/compositor/gpu_browser_compositor_output_surface.h
@@ -40,8 +40,7 @@ scoped_refptr<ui::ContextProviderCommandBuffer> context, const UpdateVSyncParametersCallback& update_vsync_parameters_callback, std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> - overlay_candidate_validator, - bool support_stencil); + overlay_candidate_validator); ~GpuBrowserCompositorOutputSurface() override;
diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc index 0fdb7636..713812a 100644 --- a/content/browser/compositor/gpu_process_transport_factory.cc +++ b/content/browser/compositor/gpu_process_transport_factory.cc
@@ -533,8 +533,7 @@ if (!use_mus) { display_output_surface = base::MakeUnique<GpuBrowserCompositorOutputSurface>( - context_provider, vsync_callback, std::move(validator), - support_stencil); + context_provider, vsync_callback, std::move(validator)); } else { #if defined(USE_AURA) std::unique_ptr<MusBrowserCompositorOutputSurface> mus_output_surface;
diff --git a/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc b/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc index 98fb73f9..a6e74153 100644 --- a/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc +++ b/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc
@@ -31,8 +31,7 @@ gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) : GpuBrowserCompositorOutputSurface(std::move(context), update_vsync_parameters_callback, - std::move(overlay_candidate_validator), - true /* support_stencil */), + std::move(overlay_candidate_validator)), gpu_memory_buffer_manager_(gpu_memory_buffer_manager) { capabilities_.uses_default_gl_framebuffer = false; capabilities_.flipped_output_surface = true;
diff --git a/content/browser/compositor/mus_browser_compositor_output_surface.cc b/content/browser/compositor/mus_browser_compositor_output_surface.cc index 6966482..383bde4 100644 --- a/content/browser/compositor/mus_browser_compositor_output_surface.cc +++ b/content/browser/compositor/mus_browser_compositor_output_surface.cc
@@ -31,8 +31,7 @@ overlay_candidate_validator) : GpuBrowserCompositorOutputSurface(std::move(context), update_vsync_parameters_callback, - std::move(overlay_candidate_validator), - false /* support_stencil */), + std::move(overlay_candidate_validator)), window_(window), begin_frame_source_(nullptr) { aura::WindowPortMus* window_port = aura::WindowPortMus::Get(window_);
diff --git a/content/browser/histogram_internals_request_job.cc b/content/browser/histogram_internals_request_job.cc index c726e077..3dd61a3b 100644 --- a/content/browser/histogram_internals_request_job.cc +++ b/content/browser/histogram_internals_request_job.cc
@@ -7,6 +7,7 @@ #include "base/metrics/histogram_macros.h" #include "base/metrics/statistics_recorder.h" #include "content/browser/histogram_synchronizer.h" +#include "content/public/browser/browser_thread.h" #include "net/base/escape.h" #include "net/base/net_errors.h" #include "net/url_request/url_request.h" @@ -15,8 +16,9 @@ namespace content { HistogramInternalsRequestJob::HistogramInternalsRequestJob( - net::URLRequest* request, net::NetworkDelegate* network_delegate) - : net::URLRequestSimpleJob(request, network_delegate) { + net::URLRequest* request, + net::NetworkDelegate* network_delegate) + : net::URLRequestSimpleJob(request, network_delegate), weak_factory_(this) { const std::string& spec = request->url().possibly_invalid_spec(); const url::Parsed& parsed = request->url().parsed_for_possibly_invalid_spec(); // + 1 to skip the slash at the beginning of the path. @@ -26,6 +28,8 @@ path_.assign(spec.substr(offset)); } +HistogramInternalsRequestJob::~HistogramInternalsRequestJob() {} + void AboutHistogram(std::string* data, const std::string& path) { HistogramSynchronizer::FetchHistograms(); @@ -54,6 +58,17 @@ base::StatisticsRecorder::WriteHTMLGraph(unescaped_query, data); } +void HistogramInternalsRequestJob::Start() { + // First import histograms from all providers and then start the URL fetch + // job. It's not possible to call URLRequestSimpleJob::Start through Bind, + // it ends up re-calling this method, so a small helper method is used. + content::BrowserThread::PostTaskAndReply( + content::BrowserThread::UI, FROM_HERE, + base::Bind(&base::StatisticsRecorder::ImportProvidedHistograms), + base::Bind(&HistogramInternalsRequestJob::StartUrlRequest, + weak_factory_.GetWeakPtr())); +} + int HistogramInternalsRequestJob::GetData( std::string* mime_type, std::string* charset, @@ -67,4 +82,8 @@ return net::OK; } +void HistogramInternalsRequestJob::StartUrlRequest() { + URLRequestSimpleJob::Start(); +} + } // namespace content
diff --git a/content/browser/histogram_internals_request_job.h b/content/browser/histogram_internals_request_job.h index 63ce622..475188d 100644 --- a/content/browser/histogram_internals_request_job.h +++ b/content/browser/histogram_internals_request_job.h
@@ -8,6 +8,7 @@ #include <string> #include "base/macros.h" +#include "base/memory/weak_ptr.h" #include "net/url_request/url_request_simple_job.h" namespace content { @@ -17,17 +18,24 @@ HistogramInternalsRequestJob(net::URLRequest* request, net::NetworkDelegate* network_delegate); + // net::URLRequestSimpleJob: + void Start() override; int GetData(std::string* mime_type, std::string* charset, std::string* data, const net::CompletionCallback& callback) const override; private: - ~HistogramInternalsRequestJob() override {} + ~HistogramInternalsRequestJob() override; + + // Starts the real URL request. + void StartUrlRequest(); // The string to select histograms which have |path_| as a substring. std::string path_; + base::WeakPtrFactory<HistogramInternalsRequestJob> weak_factory_; + DISALLOW_IMPLICIT_CONSTRUCTORS(HistogramInternalsRequestJob); };
diff --git a/content/browser/streams/OWNERS b/content/browser/streams/OWNERS index e1165dc..8f49285 100644 --- a/content/browser/streams/OWNERS +++ b/content/browser/streams/OWNERS
@@ -1,4 +1,3 @@ tyoshino@chromium.org -# TEAM: blink-network-stack@google.com # COMPONENT: Blink>Network>StreamsAPI
diff --git a/content/browser/websockets/OWNERS b/content/browser/websockets/OWNERS index f1ec1be7..4bffd3a3 100644 --- a/content/browser/websockets/OWNERS +++ b/content/browser/websockets/OWNERS
@@ -2,5 +2,4 @@ tyoshino@chromium.org yhirano@chromium.org -# TEAM: blink-network-stack@google.com # COMPONENT: Blink>Network>WebSockets
diff --git a/content/common/service_manager/service_manager_connection_impl.cc b/content/common/service_manager/service_manager_connection_impl.cc index 3e0008c..4e511907 100644 --- a/content/common/service_manager/service_manager_connection_impl.cc +++ b/content/common/service_manager/service_manager_connection_impl.cc
@@ -213,6 +213,9 @@ void RemoveConnectionFilterOnIOThread(int filter_id) { base::AutoLock lock(lock_); auto it = connection_filters_.find(filter_id); + // TODO(crbug.com/687247): This DCHECK is hit when the browser is shut down + // by the service manager (e.g. in response to an ash crash under mash). + // Figure out why. DCHECK(it != connection_filters_.end()); connection_filters_.erase(it); }
diff --git a/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.cc b/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.cc index 9dd447ef..cf5f88a6 100644 --- a/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.cc +++ b/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.cc
@@ -440,7 +440,7 @@ scoped_refptr<NiceMockBluetoothAdapter> adapter(GetEmptyAdapter()); adapter->AddMockDevice(GetBaseDevice(adapter.get(), - "a_device_name_that_is_longer_than_29_bytes_but_shorter_than_240_bytes")); + "a_device_name_that_is_longer_than_29_bytes_but_shorter_than_248_bytes")); return adapter; }
diff --git a/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h b/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h index 9eb85ef..a770c8b8 100644 --- a/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h +++ b/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h
@@ -139,7 +139,7 @@ // Internal structure // - DeviceNameLongerThan29Bytes // - Mock Functions: - // - GetName(): Returns "a_device_name_that_is_longer_than_29_bytes_but_shorter_than_240_bytes" + // - GetName(): Returns "a_device_name_that_is_longer_than_29_bytes_but_shorter_than_248_bytes" static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> GetDeviceNameLongerThan29BytesAdapter();
diff --git a/gpu/command_buffer/common/capabilities.cc b/gpu/command_buffer/common/capabilities.cc index 11e91176..a7227f6d 100644 --- a/gpu/command_buffer/common/capabilities.cc +++ b/gpu/command_buffer/common/capabilities.cc
@@ -24,6 +24,7 @@ max_viewport_height(0), num_compressed_texture_formats(0), num_shader_binary_formats(0), + num_stencil_bits(0), bind_generates_resource_chromium(0), max_3d_texture_size(0), max_array_texture_layers(0),
diff --git a/gpu/command_buffer/common/capabilities.h b/gpu/command_buffer/common/capabilities.h index a46e18a..01ab198 100644 --- a/gpu/command_buffer/common/capabilities.h +++ b/gpu/command_buffer/common/capabilities.h
@@ -83,6 +83,7 @@ int max_viewport_height; int num_compressed_texture_formats; int num_shader_binary_formats; + int num_stencil_bits; // For the default framebuffer. int bind_generates_resource_chromium; int max_3d_texture_size;
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 11fa18c..7234d13 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -2377,6 +2377,9 @@ GLsizei viewport_max_width_; GLsizei viewport_max_height_; + // Cached value for the number of stencil bits for the default framebuffer. + GLint num_stencil_bits_; + // Command buffer stats. base::TimeDelta total_processing_commands_time_; @@ -3049,6 +3052,7 @@ group_->gpu_preferences().enable_gpu_service_logging_gpu), viewport_max_width_(0), viewport_max_height_(0), + num_stencil_bits_(0), texture_state_(group_->feature_info()->workarounds()), gpu_decoder_category_(TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED( TRACE_DISABLED_BY_DEFAULT("gpu_decoder"))), @@ -3397,6 +3401,9 @@ back_buffer_has_depth_ = attrib_helper.depth_size != 0 && depth_bits > 0; back_buffer_has_stencil_ = attrib_helper.stencil_size != 0 && stencil_bits > 0; + num_stencil_bits_ = stencil_bits; + } else { + num_stencil_bits_ = attrib_helper.stencil_size; } state_.viewport_width = surface->GetSize().width(); @@ -3682,6 +3689,8 @@ DoGetIntegerv(GL_MAX_SAMPLES, &caps.max_samples, 1); } + caps.num_stencil_bits = num_stencil_bits_; + caps.egl_image_external = feature_info_->feature_flags().oes_egl_image_external; caps.texture_format_astc =
diff --git a/gpu/ipc/common/gpu_command_buffer_traits_multi.h b/gpu/ipc/common/gpu_command_buffer_traits_multi.h index c2a83e36..5282bb8 100644 --- a/gpu/ipc/common/gpu_command_buffer_traits_multi.h +++ b/gpu/ipc/common/gpu_command_buffer_traits_multi.h
@@ -55,6 +55,7 @@ IPC_STRUCT_TRAITS_MEMBER(max_vertex_uniform_vectors) IPC_STRUCT_TRAITS_MEMBER(num_compressed_texture_formats) IPC_STRUCT_TRAITS_MEMBER(num_shader_binary_formats) + IPC_STRUCT_TRAITS_MEMBER(num_stencil_bits) IPC_STRUCT_TRAITS_MEMBER(bind_generates_resource_chromium) IPC_STRUCT_TRAITS_MEMBER(max_3d_texture_size)
diff --git a/media/remoting/courier_renderer.cc b/media/remoting/courier_renderer.cc index 30a3dce..b83c7f7 100644 --- a/media/remoting/courier_renderer.cc +++ b/media/remoting/courier_renderer.cc
@@ -15,6 +15,7 @@ #include "base/message_loop/message_loop.h" #include "base/numerics/safe_math.h" #include "base/threading/thread_task_runner_handle.h" +#include "base/time/default_tick_clock.h" #include "base/time/time.h" #include "media/base/bind_to_current_loop.h" #include "media/base/buffering_state.h" @@ -71,6 +72,7 @@ rpc_handle_(rpc_broker_->GetUniqueHandle()), remote_renderer_handle_(RpcBroker::kInvalidHandle), video_renderer_sink_(video_renderer_sink), + clock_(new base::DefaultTickClock()), weak_factory_(this) { VLOG(2) << __func__; // Note: The constructor is running on the main thread, but will be destroyed @@ -710,7 +712,7 @@ if (!flush_cb_.is_null()) return; // Don't manage and check the queue when Flush() is on-going. - base::TimeTicks current_time = base::TimeTicks::Now(); + base::TimeTicks current_time = clock_->NowTicks(); if (current_time < ignore_updates_until_time_) return; // Not stable yet. @@ -758,7 +760,7 @@ return; } - base::TimeTicks current_time = base::TimeTicks::Now(); + base::TimeTicks current_time = clock_->NowTicks(); if (current_time < ignore_updates_until_time_) return; // Not stable yet. @@ -796,7 +798,7 @@ sum_video_frames_dropped_ = 0; sum_video_frames_decoded_ = 0; stats_updated_ = false; - ignore_updates_until_time_ = base::TimeTicks::Now() + kStabilizationPeriod; + ignore_updates_until_time_ = clock_->NowTicks() + kStabilizationPeriod; if (state_ != STATE_ERROR && (audio_demuxer_stream_adapter_ || video_demuxer_stream_adapter_)) { @@ -813,7 +815,7 @@ // resuming playback. Since the goal here is to measure the sustained content // bitrates, ignore the byte counts the first time since the last // ResetMeasurements() call. - const base::TimeTicks current_time = base::TimeTicks::Now(); + const base::TimeTicks current_time = clock_->NowTicks(); if (current_time < ignore_updates_until_time_ + kDataFlowPollPeriod) { if (audio_demuxer_stream_adapter_) audio_demuxer_stream_adapter_->GetBytesWrittenAndReset();
diff --git a/media/remoting/courier_renderer.h b/media/remoting/courier_renderer.h index 87b462a..62a06ee 100644 --- a/media/remoting/courier_renderer.h +++ b/media/remoting/courier_renderer.h
@@ -225,6 +225,8 @@ // Records events and measurements of interest. RendererMetricsRecorder metrics_recorder_; + std::unique_ptr<base::TickClock> clock_; + // A timer that polls the DemuxerStreamAdapters periodically to measure // the data flow rates for metrics. base::RepeatingTimer data_flow_poll_timer_;
diff --git a/media/remoting/courier_renderer_unittest.cc b/media/remoting/courier_renderer_unittest.cc index 5ac6561..062a1f5 100644 --- a/media/remoting/courier_renderer_unittest.cc +++ b/media/remoting/courier_renderer_unittest.cc
@@ -6,6 +6,7 @@ #include "base/memory/ptr_util.h" #include "base/run_loop.h" +#include "base/test/simple_test_tick_clock.h" #include "base/threading/thread_task_runner_handle.h" #include "media/base/pipeline_status.h" #include "media/base/renderer_client.h" @@ -33,6 +34,23 @@ return data; } +PipelineStatistics DefaultStats() { + PipelineStatistics stats; + stats.audio_bytes_decoded = 1234U; + stats.video_bytes_decoded = 2345U; + stats.video_frames_decoded = 3000U; + stats.video_frames_dropped = 91U; + stats.audio_memory_usage = 5678; + stats.video_memory_usage = 6789; + stats.video_keyframe_distance_average = base::TimeDelta::Max(); + return stats; +} + +bool IsDefaultStats(const PipelineStatistics& stats) { + const PipelineStatistics default_stats = DefaultStats(); + return memcmp(&stats, &default_stats, sizeof(PipelineStatistics)) == 0; +} + class RendererClientImpl : public RendererClient { public: RendererClientImpl() { @@ -232,6 +250,10 @@ return renderer_->state_ == CourierRenderer::STATE_PLAYING; } + bool DidEncounterFatalError() const { + return renderer_->state_ == CourierRenderer::STATE_ERROR; + } + void OnReceivedRpc(std::unique_ptr<pb::RpcMessage> message) { renderer_->OnReceivedRpc(std::move(message)); } @@ -247,6 +269,10 @@ renderer_.reset(new CourierRenderer(base::ThreadTaskRunnerHandle::Get(), controller_->GetWeakPtr(), nullptr)); + clock_ = new base::SimpleTestTickClock(); + renderer_->clock_.reset(clock_); + clock_->Advance(base::TimeDelta::FromSeconds(1)); + RunPendingTasks(); } @@ -271,11 +297,45 @@ ASSERT_EQ(renderer_->current_max_time_, current_max); } + // Issues RPC_RC_ONTIMEUPDATE RPC message. + void IssueTimeUpdateRpc(base::TimeDelta media_time, + base::TimeDelta max_media_time) { + std::unique_ptr<remoting::pb::RpcMessage> rpc( + new remoting::pb::RpcMessage()); + rpc->set_handle(5); + rpc->set_proc(remoting::pb::RpcMessage::RPC_RC_ONTIMEUPDATE); + auto* time_message = rpc->mutable_rendererclient_ontimeupdate_rpc(); + time_message->set_time_usec(media_time.InMicroseconds()); + time_message->set_max_time_usec(max_media_time.InMicroseconds()); + OnReceivedRpc(std::move(rpc)); + RunPendingTasks(); + } + + // Issues RPC_RC_ONSTATISTICSUPDATE RPC message with DefaultStats(). + void IssueStatisticsUpdateRpc() { + EXPECT_CALL(*render_client_, OnStatisticsUpdate(_)).Times(1); + const PipelineStatistics stats = DefaultStats(); + std::unique_ptr<remoting::pb::RpcMessage> rpc( + new remoting::pb::RpcMessage()); + rpc->set_handle(5); + rpc->set_proc(remoting::pb::RpcMessage::RPC_RC_ONSTATISTICSUPDATE); + auto* message = rpc->mutable_rendererclient_onstatisticsupdate_rpc(); + message->set_audio_bytes_decoded(stats.audio_bytes_decoded); + message->set_video_bytes_decoded(stats.video_bytes_decoded); + message->set_video_frames_decoded(stats.video_frames_decoded); + message->set_video_frames_dropped(stats.video_frames_dropped); + message->set_audio_memory_usage(stats.audio_memory_usage); + message->set_video_memory_usage(stats.video_memory_usage); + OnReceivedRpc(std::move(rpc)); + RunPendingTasks(); + } + base::MessageLoop message_loop_; std::unique_ptr<RendererController> controller_; std::unique_ptr<RendererClientImpl> render_client_; std::unique_ptr<FakeDemuxerStreamProvider> demuxer_stream_provider_; std::unique_ptr<CourierRenderer> renderer_; + base::SimpleTestTickClock* clock_; // Owned by |renderer_|; // RPC handles. const int receiver_renderer_handle_; @@ -385,28 +445,15 @@ } TEST_F(CourierRendererTest, OnTimeUpdate) { - // Issues RPC_RC_ONTIMEUPDATE RPC message. base::TimeDelta media_time = base::TimeDelta::FromMicroseconds(100); base::TimeDelta max_media_time = base::TimeDelta::FromMicroseconds(500); - std::unique_ptr<pb::RpcMessage> rpc(new pb::RpcMessage()); - rpc->set_handle(5); - rpc->set_proc(pb::RpcMessage::RPC_RC_ONTIMEUPDATE); - auto* time_message = rpc->mutable_rendererclient_ontimeupdate_rpc(); - time_message->set_time_usec(media_time.InMicroseconds()); - time_message->set_max_time_usec(max_media_time.InMicroseconds()); - OnReceivedRpc(std::move(rpc)); + IssueTimeUpdateRpc(media_time, max_media_time); ValidateCurrentTime(media_time, max_media_time); // Issues RPC_RC_ONTIMEUPDATE RPC message with invalid time base::TimeDelta media_time2 = base::TimeDelta::FromMicroseconds(-100); base::TimeDelta max_media_time2 = base::TimeDelta::FromMicroseconds(500); - std::unique_ptr<pb::RpcMessage> rpc2(new pb::RpcMessage()); - rpc2->set_handle(5); - rpc2->set_proc(pb::RpcMessage::RPC_RC_ONTIMEUPDATE); - auto* time_message2 = rpc2->mutable_rendererclient_ontimeupdate_rpc(); - time_message2->set_time_usec(media_time2.InMicroseconds()); - time_message2->set_max_time_usec(max_media_time2.InMicroseconds()); - OnReceivedRpc(std::move(rpc2)); + IssueTimeUpdateRpc(media_time2, max_media_time2); // Because of invalid value, the time will not be updated and remain the same. ValidateCurrentTime(media_time, max_media_time); } @@ -480,32 +527,9 @@ TEST_F(CourierRendererTest, OnStatisticsUpdate) { InitializeRenderer(); - ASSERT_NE(render_client_->stats().audio_bytes_decoded, 1234U); - ASSERT_NE(render_client_->stats().video_bytes_decoded, 2345U); - ASSERT_NE(render_client_->stats().video_frames_decoded, 3456U); - ASSERT_NE(render_client_->stats().video_frames_dropped, 4567U); - ASSERT_NE(render_client_->stats().audio_memory_usage, 5678); - ASSERT_NE(render_client_->stats().video_memory_usage, 6789); - // Issues RPC_RC_ONSTATISTICSUPDATE RPC message. - EXPECT_CALL(*render_client_, OnStatisticsUpdate(_)).Times(1); - std::unique_ptr<pb::RpcMessage> rpc(new pb::RpcMessage()); - rpc->set_handle(5); - rpc->set_proc(pb::RpcMessage::RPC_RC_ONSTATISTICSUPDATE); - auto* message = rpc->mutable_rendererclient_onstatisticsupdate_rpc(); - message->set_audio_bytes_decoded(1234U); - message->set_video_bytes_decoded(2345U); - message->set_video_frames_decoded(3456U); - message->set_video_frames_dropped(4567U); - message->set_audio_memory_usage(5678); - message->set_video_memory_usage(6789); - OnReceivedRpc(std::move(rpc)); - RunPendingTasks(); - ASSERT_EQ(render_client_->stats().audio_bytes_decoded, 1234U); - ASSERT_EQ(render_client_->stats().video_bytes_decoded, 2345U); - ASSERT_EQ(render_client_->stats().video_frames_decoded, 3456U); - ASSERT_EQ(render_client_->stats().video_frames_dropped, 4567U); - ASSERT_EQ(render_client_->stats().audio_memory_usage, 5678); - ASSERT_EQ(render_client_->stats().video_memory_usage, 6789); + ASSERT_FALSE(IsDefaultStats(render_client_->stats())); + IssueStatisticsUpdateRpc(); + ASSERT_TRUE(IsDefaultStats(render_client_->stats())); } TEST_F(CourierRendererTest, OnDurationChange) { @@ -538,7 +562,60 @@ RunPendingTasks(); } -// TODO(xjz): Tests for detecting PACING_TOO_SLOWLY and FRAME_DROP_RATE_HIGH. +TEST_F(CourierRendererTest, OnPacingTooSlowly) { + InitializeRenderer(); + + controller_->GetRpcBroker()->SetMessageCallbackForTesting(base::Bind( + &CourierRendererTest::OnSendMessageToSink, base::Unretained(this))); + // There should be no error reported with this playback rate. + renderer_->SetPlaybackRate(0.8); + RunPendingTasks(); + clock_->Advance(base::TimeDelta::FromSeconds(3)); + for (int i = 0; i < 8; ++i) { + ASSERT_FALSE(DidEncounterFatalError()); + IssueTimeUpdateRpc(base::TimeDelta::FromMilliseconds(100 + i * 800), + base::TimeDelta::FromSeconds(16)); + clock_->Advance(base::TimeDelta::FromSeconds(1)); + RunPendingTasks(); + } + ASSERT_FALSE(DidEncounterFatalError()); // No delay at this playback rate. + + // Change playback rate. Pacing keeps same as above. Should report error. + renderer_->SetPlaybackRate(1); + RunPendingTasks(); + clock_->Advance(base::TimeDelta::FromSeconds(3)); + + for (int i = 8; i < 13; ++i) { + ASSERT_FALSE(DidEncounterFatalError()); // Not enough measurements. + IssueTimeUpdateRpc(base::TimeDelta::FromMilliseconds(100 + i * 800), + base::TimeDelta::FromSeconds(16)); + clock_->Advance(base::TimeDelta::FromSeconds(1)); + RunPendingTasks(); + } + + for (int i = 13; i < 16; ++i) { + // Don't report error at the first and second time that encounters delay. + ASSERT_FALSE(DidEncounterFatalError()); + IssueTimeUpdateRpc(base::TimeDelta::FromMilliseconds(100 + i * 800), + base::TimeDelta::FromSeconds(16)); + clock_->Advance(base::TimeDelta::FromSeconds(1)); + RunPendingTasks(); + } + // Reports error when encounters delay continuously for 3 times. + ASSERT_TRUE(DidEncounterFatalError()); +} + +TEST_F(CourierRendererTest, OnFrameDropRateHigh) { + InitializeRenderer(); + + for (int i = 0; i < 7; ++i) { + ASSERT_FALSE(DidEncounterFatalError()); // Not enough measurements. + IssueStatisticsUpdateRpc(); + clock_->Advance(base::TimeDelta::FromSeconds(1)); + RunPendingTasks(); + } + ASSERT_TRUE(DidEncounterFatalError()); +} } // namespace remoting } // namespace media
diff --git a/net/data/websocket/OWNERS b/net/data/websocket/OWNERS index f1ec1be7..4bffd3a3 100644 --- a/net/data/websocket/OWNERS +++ b/net/data/websocket/OWNERS
@@ -2,5 +2,4 @@ tyoshino@chromium.org yhirano@chromium.org -# TEAM: blink-network-stack@google.com # COMPONENT: Blink>Network>WebSockets
diff --git a/net/websockets/OWNERS b/net/websockets/OWNERS index 9530ca9..290a917 100644 --- a/net/websockets/OWNERS +++ b/net/websockets/OWNERS
@@ -2,5 +2,4 @@ ricea@chromium.org yhirano@chromium.org -# TEAM: blink-network-stack@google.com # COMPONENT: Blink>Network>WebSockets
diff --git a/printing/pdf_render_settings.h b/printing/pdf_render_settings.h index 60425ec..545def0 100644 --- a/printing/pdf_render_settings.h +++ b/printing/pdf_render_settings.h
@@ -11,6 +11,7 @@ #include "ipc/ipc_message_utils.h" #include "ipc/ipc_param_traits.h" #include "printing/printing_export.h" +#include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/ipc/geometry/gfx_param_traits.h" #include "ui/gfx/ipc/skia/gfx_skia_param_traits.h" @@ -23,18 +24,29 @@ NORMAL = 0, #if defined(OS_WIN) GDI_TEXT, - LAST = GDI_TEXT, + POSTSCRIPT_LEVEL2, + POSTSCRIPT_LEVEL3, + LAST = POSTSCRIPT_LEVEL3, #else LAST = NORMAL, #endif }; PdfRenderSettings() : dpi(0), autorotate(false), mode(Mode::NORMAL) {} - PdfRenderSettings(gfx::Rect area, int dpi, bool autorotate, Mode mode) - : area(area), dpi(dpi), autorotate(autorotate), mode(mode) {} + PdfRenderSettings(gfx::Rect area, + gfx::Point offsets, + int dpi, + bool autorotate, + Mode mode) + : area(area), + offsets(offsets), + dpi(dpi), + autorotate(autorotate), + mode(mode) {} ~PdfRenderSettings() {} gfx::Rect area; + gfx::Point offsets; int dpi; bool autorotate; Mode mode; @@ -43,4 +55,3 @@ } // namespace printing #endif // PRINTING_PDF_RENDER_SETTINGS_H_ -
diff --git a/printing/print_settings.cc b/printing/print_settings.cc index 00e1cce..a234cd9 100644 --- a/printing/print_settings.cc +++ b/printing/print_settings.cc
@@ -153,7 +153,7 @@ supports_alpha_blend_ = true; #if defined(OS_WIN) print_text_with_gdi_ = false; - printer_is_xps_ = false; + printer_type_ = PrintSettings::PrinterType::TYPE_NONE; #endif }
diff --git a/printing/print_settings.h b/printing/print_settings.h index 67ad091c..1311ddb 100644 --- a/printing/print_settings.h +++ b/printing/print_settings.h
@@ -34,6 +34,15 @@ // OS-independent print settings. class PRINTING_EXPORT PrintSettings { public: +#if defined(OS_WIN) + enum PrinterType { + TYPE_NONE = 0, + TYPE_XPS, + TYPE_POSTSCRIPT_LEVEL2, + TYPE_POSTSCRIPT_LEVEL3 + }; +#endif + // Media properties requested by the user. Default instance represents // default media selection. struct RequestedMedia { @@ -154,8 +163,14 @@ void set_print_text_with_gdi(bool use_gdi) { print_text_with_gdi_ = use_gdi; } bool print_text_with_gdi() const { return print_text_with_gdi_; } - void set_printer_is_xps(bool is_xps) { printer_is_xps_ = is_xps; } - bool printer_is_xps() const { return printer_is_xps_; } + void set_printer_type(PrinterType type) { printer_type_ = type; } + bool printer_is_xps() const { return printer_type_ == PrinterType::TYPE_XPS;} + bool printer_is_ps2() const { + return printer_type_ == PrinterType::TYPE_POSTSCRIPT_LEVEL2; + } + bool printer_is_ps3() const { + return printer_type_ == PrinterType::TYPE_POSTSCRIPT_LEVEL3; + } #endif // Cookie generator. It is used to initialize PrintedDocument with its @@ -228,8 +243,7 @@ // True to print text with GDI. bool print_text_with_gdi_; - // True if the printer is an XPS printer. - bool printer_is_xps_; + PrinterType printer_type_; #endif // If margin type is custom, this is what was requested.
diff --git a/printing/print_settings_initializer_win.cc b/printing/print_settings_initializer_win.cc index 0776e9e..6d3ee33aa 100644 --- a/printing/print_settings_initializer_win.cc +++ b/printing/print_settings_initializer_win.cc
@@ -31,6 +31,38 @@ return strcmp(buf, technology) == 0; } +bool IsPrinterPostScript(HDC hdc, int* level) { + static constexpr char kPostScriptDriver[] = "PostScript"; + if (!IsTechnology(hdc, kPostScriptDriver)) { + return false; + } + + // Query the PS Level if possible. Many PS printers do not implement this. + if (HasEscapeSupprt(hdc, GET_PS_FEATURESETTING)) { + constexpr int param = FEATURESETTING_PSLEVEL; + const char* param_char_ptr = reinterpret_cast<const char*>(¶m); + int param_out = -1; + char* param_out_char_ptr = reinterpret_cast<char*>(¶m_out); + if (ExtEscape(hdc, GET_PS_FEATURESETTING, sizeof(param), param_char_ptr, + sizeof(param_out), param_out_char_ptr) > 0) { + if (param_out < 2 || param_out > 3) + return false; + + *level = param_out; + return true; + } + } + + // If it looks like a PS printer. + if (HasEscapeSupprt(hdc, POSTSCRIPT_PASSTHROUGH) && + HasEscapeSupprt(hdc, POSTSCRIPT_DATA)) { + *level = 2; + return true; + } + + return false; +} + bool IsPrinterXPS(HDC hdc) { static constexpr char kXPSDriver[] = "http://schemas.microsoft.com/xps/2005/06"; @@ -84,8 +116,23 @@ print_settings->SetPrinterPrintableArea(physical_size_device_units, printable_area_device_units, false); - - print_settings->set_printer_is_xps(IsPrinterXPS(hdc)); + if (IsPrinterXPS(hdc)) { + print_settings->set_printer_type(PrintSettings::PrinterType::TYPE_XPS); + return; + } + int level; + if (IsPrinterPostScript(hdc, &level)) { + if (level == 2) { + print_settings->set_printer_type( + PrintSettings::PrinterType::TYPE_POSTSCRIPT_LEVEL2); + return; + } + DCHECK_EQ(3, level); + print_settings->set_printer_type( + PrintSettings::PrinterType::TYPE_POSTSCRIPT_LEVEL3); + return; + } + print_settings->set_printer_type(PrintSettings::PrinterType::TYPE_NONE); } } // namespace printing
diff --git a/services/service_manager/background/background_service_manager.cc b/services/service_manager/background/background_service_manager.cc index 09b2e86..d74a8a6 100644 --- a/services/service_manager/background/background_service_manager.cc +++ b/services/service_manager/background/background_service_manager.cc
@@ -25,6 +25,19 @@ #include "services/service_manager/standalone/context.h" namespace service_manager { +namespace { + +// Calls |callback| on |callback_task_runner|'s thread. +void CallCallbackWithIdentity( + const scoped_refptr<base::TaskRunner> callback_task_runner, + const base::Callback<void(const Identity&)>& callback, + const Identity& identity) { + DCHECK(callback); + DCHECK(identity.IsValid()); + callback_task_runner->PostTask(FROM_HERE, base::Bind(callback, identity)); +} + +} // namespace BackgroundServiceManager::BackgroundServiceManager( service_manager::ServiceProcessLauncher::Delegate* launcher_delegate, @@ -62,6 +75,29 @@ base::Passed(&pid_receiver_request))); } +void BackgroundServiceManager::SetInstanceQuitCallback( + base::Callback<void(const Identity&)> callback) { + DCHECK(callback); + // Hop to the background thread. The provided callback will be called on + // whichever thread called this function. + background_thread_.task_runner()->PostTask( + FROM_HERE, + base::Bind( + &BackgroundServiceManager::SetInstanceQuitCallbackOnBackgroundThread, + base::Unretained(this), base::ThreadTaskRunnerHandle::Get(), + callback)); +} + +void BackgroundServiceManager::SetInstanceQuitCallbackOnBackgroundThread( + const scoped_refptr<base::SingleThreadTaskRunner>& callback_task_runner, + const base::Callback<void(const Identity&)>& callback) { + DCHECK(callback_task_runner); + DCHECK(callback); + // Calls |callback| with the identity of the service that is quitting. + context_->service_manager()->SetInstanceQuitCallback( + base::Bind(&CallCallbackWithIdentity, callback_task_runner, callback)); +} + void BackgroundServiceManager::InitializeOnBackgroundThread( service_manager::ServiceProcessLauncher::Delegate* launcher_delegate, std::unique_ptr<base::Value> catalog_contents) {
diff --git a/services/service_manager/background/background_service_manager.h b/services/service_manager/background/background_service_manager.h index eb024f8..2e58974 100644 --- a/services/service_manager/background/background_service_manager.h +++ b/services/service_manager/background/background_service_manager.h
@@ -7,6 +7,7 @@ #include <memory> +#include "base/callback_forward.h" #include "base/macros.h" #include "base/threading/thread.h" #include "services/service_manager/public/cpp/identity.h" @@ -15,6 +16,7 @@ #include "services/service_manager/runner/host/service_process_launcher.h" namespace base { +class SingleThreadTaskRunner; class Value; class WaitableEvent; } @@ -22,6 +24,7 @@ namespace service_manager { class Context; +class Identity; class ServiceManager; // BackgroundServiceManager runs a Service Manager on a dedicated background @@ -43,6 +46,12 @@ mojom::ServicePtr service, mojom::PIDReceiverRequest pid_receiver_request); + // Provide a callback to be notified whenever a service is destroyed. + // Typically the creator of BackgroundServiceManager will use this to shut + // down when some set of services it created is destroyed. The |callback| is + // called on whichever thread called this function. + void SetInstanceQuitCallback(base::Callback<void(const Identity&)> callback); + private: void InitializeOnBackgroundThread( service_manager::ServiceProcessLauncher::Delegate* launcher_delegate, @@ -52,6 +61,10 @@ const Identity& identity, mojom::ServicePtrInfo service_info, mojom::PIDReceiverRequest pid_receiver_request); + void SetInstanceQuitCallbackOnBackgroundThread( + const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner, + const base::Callback<void(const Identity&)>& callback); + void OnInstanceQuitOnBackgroundThread(const Identity& identity); base::Thread background_thread_;
diff --git a/services/service_manager/background/tests/OWNERS b/services/service_manager/background/tests/OWNERS new file mode 100644 index 0000000..08850f4 --- /dev/null +++ b/services/service_manager/background/tests/OWNERS
@@ -0,0 +1,2 @@ +per-file *.mojom=set noparent +per-file *.mojom=file://ipc/SECURITY_OWNERS
diff --git a/services/service_manager/background/tests/background_service_manager_unittest.cc b/services/service_manager/background/tests/background_service_manager_unittest.cc index f315cd2..02c4df9d 100644 --- a/services/service_manager/background/tests/background_service_manager_unittest.cc +++ b/services/service_manager/background/tests/background_service_manager_unittest.cc
@@ -20,6 +20,7 @@ const char kTestName[] = "background_service_manager_unittest"; const char kAppName[] = "background_service_manager_test_service"; +// The parent unit test suite service, not the underlying test service. class ServiceImpl : public Service { public: ServiceImpl() {} @@ -40,8 +41,6 @@ closure.Run(); } -} // namespace - // Uses BackgroundServiceManager to start the service manager in the background // and connects to background_service_manager_test_service, verifying we can // send a message to the service. @@ -71,4 +70,41 @@ EXPECT_TRUE(got_result); } +// The out param cannot be last due to base::Bind() currying. +void QuitCallback(bool* callback_called, + const base::Closure& quit_closure, + const Identity& identity) { + EXPECT_EQ(kAppName, identity.name()); + *callback_called = true; + quit_closure.Run(); +} + +// Verifies that quitting a service invokes the quit callback. +TEST(BackgroundServiceManagerTest, SetInstanceQuitCallback) { + BackgroundServiceManager background_service_manager(nullptr, nullptr); + base::MessageLoop message_loop; + mojom::ServicePtr service; + ServiceContext service_context(base::MakeUnique<ServiceImpl>(), + mojom::ServiceRequest(&service)); + background_service_manager.RegisterService( + Identity(kTestName, mojom::kRootUserID), std::move(service), nullptr); + + mojom::TestServicePtr test_service; + service_context.connector()->BindInterface(kAppName, &test_service); + + // Set a callback for when the service quits that will quit |run_loop|. + base::RunLoop run_loop; + bool callback_called = false; + background_service_manager.SetInstanceQuitCallback( + base::Bind(&QuitCallback, &callback_called, run_loop.QuitClosure())); + + // Ask the service to quit itself. + test_service->Quit(); + run_loop.Run(); + + // The run loop was quit by the callback and not by something else. + EXPECT_TRUE(callback_called); +} + +} // namespace } // namespace service_manager
diff --git a/services/service_manager/background/tests/test.mojom b/services/service_manager/background/tests/test.mojom index efbdb67b..d6f62a1 100644 --- a/services/service_manager/background/tests/test.mojom +++ b/services/service_manager/background/tests/test.mojom
@@ -6,4 +6,7 @@ interface TestService { Test() => (); + + // Asks the test service to quit itself. + Quit(); };
diff --git a/services/service_manager/background/tests/test_service.cc b/services/service_manager/background/tests/test_service.cc index 06a5cb5..18de6bd 100644 --- a/services/service_manager/background/tests/test_service.cc +++ b/services/service_manager/background/tests/test_service.cc
@@ -7,10 +7,13 @@ #include "services/service_manager/public/c/main.h" #include "services/service_manager/public/cpp/interface_registry.h" #include "services/service_manager/public/cpp/service.h" +#include "services/service_manager/public/cpp/service_context.h" #include "services/service_manager/public/cpp/service_runner.h" namespace service_manager { +// A service that exports a simple interface for testing. Used to test the +// parent background service manager. class TestClient : public Service, public InterfaceFactory<mojom::TestService>, public mojom::TestService { @@ -40,6 +43,8 @@ callback.Run(); } + void Quit() override { context()->RequestQuit(); } + mojo::BindingSet<mojom::TestService> bindings_; DISALLOW_COPY_AND_ASSIGN(TestClient);
diff --git a/services/service_manager/public/cpp/service.h b/services/service_manager/public/cpp/service.h index 08ae594..250b8ab 100644 --- a/services/service_manager/public/cpp/service.h +++ b/services/service_manager/public/cpp/service.h
@@ -52,7 +52,7 @@ // may be reaped shortly afterward if applicable. // // Return true from this method to tell the ServiceContext to signal its - // shutdown extenrally (i.e. to invoke it's "connection lost" closure if set), + // shutdown externally (i.e. to invoke its "connection lost" closure if set), // or return false to defer the signal. If deferred, the Service should // explicitly call QuitNow() on the ServiceContext when it's ready to be // torn down.
diff --git a/services/ui/surfaces/display_compositor.cc b/services/ui/surfaces/display_compositor.cc index c00278a..6c922fd 100644 --- a/services/ui/surfaces/display_compositor.cc +++ b/services/ui/surfaces/display_compositor.cc
@@ -6,8 +6,10 @@ #include <utility> +#include "base/command_line.h" #include "base/memory/ptr_util.h" #include "base/threading/thread_task_runner_handle.h" +#include "cc/base/switches.h" #include "cc/output/in_process_context_provider.h" #include "cc/output/texture_mailbox_deleter.h" #include "cc/surfaces/display.h" @@ -141,10 +143,15 @@ std::unique_ptr<cc::DisplayScheduler> scheduler( new cc::DisplayScheduler(task_runner_.get(), max_frames_pending)); + cc::RendererSettings settings; + settings.show_overdraw_feedback = + base::CommandLine::ForCurrentProcess()->HasSwitch( + cc::switches::kShowOverdrawFeedback); + return base::MakeUnique<cc::Display>( - nullptr /* bitmap_manager */, gpu_memory_buffer_manager_.get(), - cc::RendererSettings(), frame_sink_id, begin_frame_source, - std::move(display_output_surface), std::move(scheduler), + nullptr /* bitmap_manager */, gpu_memory_buffer_manager_.get(), settings, + frame_sink_id, begin_frame_source, std::move(display_output_surface), + std::move(scheduler), base::MakeUnique<cc::TextureMailboxDeleter>(task_runner_.get())); }
diff --git a/services/ui/surfaces/display_output_surface.cc b/services/ui/surfaces/display_output_surface.cc index f2aad393f..e635a42 100644 --- a/services/ui/surfaces/display_output_surface.cc +++ b/services/ui/surfaces/display_output_surface.cc
@@ -26,6 +26,8 @@ weak_ptr_factory_(this) { capabilities_.flipped_output_surface = context_provider->ContextCapabilities().flips_vertically; + capabilities_.supports_stencil = + context_provider->ContextCapabilities().num_stencil_bits > 0; context_provider->SetSwapBuffersCompletionCallback( base::Bind(&DisplayOutputSurface::OnGpuSwapBuffersCompleted, weak_ptr_factory_.GetWeakPtr()));
diff --git a/services/ui/surfaces/display_output_surface_ozone.cc b/services/ui/surfaces/display_output_surface_ozone.cc index 86812cb..ea218b2 100644 --- a/services/ui/surfaces/display_output_surface_ozone.cc +++ b/services/ui/surfaces/display_output_surface_ozone.cc
@@ -33,7 +33,6 @@ context_provider->ContextSupport()) { capabilities_.uses_default_gl_framebuffer = false; capabilities_.flipped_output_surface = true; - capabilities_.supports_stencil = true; // Set |max_frames_pending| to 2 for surfaceless, which aligns scheduling // more closely with the previous surfaced behavior. // With a surface, swap buffer ack used to return early, before actually
diff --git a/services/ui/ws/platform_display_default.cc b/services/ui/ws/platform_display_default.cc index c9f1b97..e47e1f4 100644 --- a/services/ui/ws/platform_display_default.cc +++ b/services/ui/ws/platform_display_default.cc
@@ -64,8 +64,7 @@ #if defined(OS_WIN) platform_window_ = base::MakeUnique<ui::WinWindow>(this, bounds); #elif defined(USE_X11) && !defined(OS_CHROMEOS) - platform_window_ = base::MakeUnique<ui::X11Window>(this); - platform_window_->SetBounds(bounds); + platform_window_ = base::MakeUnique<ui::X11Window>(this, bounds); #elif defined(OS_ANDROID) platform_window_ = base::MakeUnique<ui::PlatformWindowAndroid>(this); platform_window_->SetBounds(bounds);
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index e28a15c..3285752 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -52,6 +52,9 @@ "test": "ash_unittests" }, { + "args": [ + "--ozone-platform=x11" + ], "swarming": { "can_use_on_swarming_builders": true }, @@ -501,6 +504,9 @@ "test": "views_mus_unittests" }, { + "args": [ + "--ozone-platform=x11" + ], "swarming": { "can_use_on_swarming_builders": true },
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index fa58096..4089d88 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -1666,7 +1666,7 @@ ], "experiments": [ { - "name": "EnabledCGUV20", + "name": "EnabledCGRUV20", "params": { "config_url": "https://www.gstatic.com/chrome/wifiprefetch/precache_config_g20" }
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index 9d23ec56..3e5be7b 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -156,119 +156,49 @@ # LayoutNG - is a new layout system for Blink. # TODO(glebl): remove once new float/margin collapsing algorithm checked in. -crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-non-replaced-width-005.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-replaced-width-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-038.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-015.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-008.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/012.html [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/table-height-algorithm-024.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/table-caption-optional-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/overflow-applies-to-004.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/overflow-applies-to-003.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/split-inline-sibling-of-float-crash.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/intruding-float-not-removed-from-next-sibling-crash.html [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/outline-color-applies-to-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-change-composited-scrolling.html [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-031.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-style-088.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/010.html [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-style-079.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-020.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-028.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/006.html [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-non-replaced-width-002.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-non-replaced-width-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/table-height-algorithm-023.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/overflow-applies-to-007.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-spacing-applies-to-015.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/positioned-float-crash.html [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/outline-color-applies-to-002.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/006.html [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-023.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/outline-color-applies-to-015.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/outline-color-applies-to-007.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/019.html [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/outline-color-applies-to-006.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/overflow-applies-to-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-017.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-011.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/overflow-applies-to-006.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-037.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-width-003.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/010.html [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/outline-color-applies-to-004.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-height-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-collapse-offset-002.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-006.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-030.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-009.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-034.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/canvas-with-floats-marked-for-layout.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/011.html [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-022.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-crash2.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/041.html [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-001d.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-005.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-021.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-039.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-016.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-026.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/outline-color-applies-to-013.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-025.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/table-height-algorithm-012.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/overflow-applies-to-002.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/012.html [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/fixed-table-layout-015.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/017.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/056.html [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/table-caption-horizontal-alignment-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/clip-001.html [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-032.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/outline-color-applies-to-009.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-035.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/overflow-applies-to-013.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-036.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-replaced-width-003.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/outline-color-applies-to-012.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-024.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-004.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-width-002.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/outline-color-applies-to-005.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-029.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-033.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/fixed-table-layout-006.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-018.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-014.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/table-caption-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-027.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-003.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/table-caption-002.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/outline-color-applies-to-003.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/fixed-table-layout-013.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/034.html [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-max-height-001.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-021a.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/020.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/011.html [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/abspos-containing-block-initial-009e.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/059.html [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-element-019.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/overflow-applies-to-008.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-non-replaced-width-003.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/overflow-applies-to-015.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/018.html [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-replaced-width-005.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/table-columns-example-001.htm [ Skip ] + #### css2.1/20110323 -#### Passed: 262 -#### Skipped: 147 +#### Passed: 112 +#### Skipped: 297 +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-height-002.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-height-003.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-height-004.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-height-005.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-height-006.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-height-007.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-height-008.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-height-009.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-height-010.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-height-011.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-height-012.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-max-height-002.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-max-height-003.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-max-height-004.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-max-height-005.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-max-height-006.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-max-height-007.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-max-height-008.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-max-height-009.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-max-height-010.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-max-height-011.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-max-height-012.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-002.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-003.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-004.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-005.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-006.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-007.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-008.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-009.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-010.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-011.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-012.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-013.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-014.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-015.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-016.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-017.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-018.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-019.htm [ Skip ] @@ -277,20 +207,32 @@ crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-022.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-023.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-non-replaced-width-024.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-001.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-002.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-003.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-004.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-005.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-007.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-008.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-009.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-010.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-011.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-012.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-014.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-016.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-017.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-018.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-019.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-021.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-022.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-023.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-024.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-025.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-026.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-028.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-029.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-030.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-031.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-032.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-033.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-height-035.htm [ Skip ] @@ -318,16 +260,34 @@ crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-width-071.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/absolute-replaced-width-076.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/abspos-containing-block-initial-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/abspos-containing-block-initial-004a.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/abspos-containing-block-initial-004b.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/abspos-containing-block-initial-004c.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/abspos-containing-block-initial-004d.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/abspos-containing-block-initial-005a.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/abspos-containing-block-initial-005b.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/abspos-containing-block-initial-005c.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/abspos-containing-block-initial-005d.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/abspos-containing-block-initial-009a.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/abspos-containing-block-initial-009b.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/abspos-non-replaced-width-margin-000.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/abspos-replaced-width-margin-000.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/background-intrinsic-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/background-intrinsic-002.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/background-intrinsic-003.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/background-intrinsic-004.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/background-intrinsic-005.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/background-intrinsic-006.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/background-intrinsic-007.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/background-intrinsic-008.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/background-intrinsic-009.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-001.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-002.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-003.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-004.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-005.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-006.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-007.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-008.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-009.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-010.htm [ Skip ] @@ -335,18 +295,43 @@ crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-012.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-013.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-014.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-015.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-height-016.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-width-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-width-002.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-width-003.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-width-004.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-width-005.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-width-006.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-width-007.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-non-replaced-width-008.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-replaced-height-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-replaced-height-002.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-replaced-height-003.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-replaced-height-004.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-replaced-height-005.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-replaced-height-007.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-replaced-width-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/block-replaced-width-006.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-collapse-offset-002.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-style-079.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-conflict-style-088.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/border-spacing-applies-to-015.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/c541-word-sp-001.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/c543-txt-decor-000.html [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/dynamic-top-change-001.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/dynamic-top-change-002.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/dynamic-top-change-003.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/dynamic-top-change-004.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/empty-inline-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/empty-inline-002.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/empty-inline-003.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-non-replaced-height-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-non-replaced-width-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-non-replaced-width-002.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-non-replaced-width-003.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-non-replaced-width-004.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-non-replaced-width-005.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-non-replaced-width-006.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-non-replaced-width-007.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-non-replaced-width-008.htm [ Skip ] @@ -360,8 +345,11 @@ crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-replaced-height-004.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-replaced-height-005.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-replaced-height-007.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-replaced-width-001.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-replaced-width-002.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-replaced-width-003.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-replaced-width-004.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-replaced-width-005.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-replaced-width-006.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/float-replaced-width-011.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/floating-replaced-height-008.htm [ Skip ] @@ -371,20 +359,51 @@ crbug.com/635619 virtual/layout_ng/css2.1/20110323/floats-wrap-top-below-bfc-002l.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/floats-wrap-top-below-bfc-002r.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/floats-wrap-top-below-bfc-003l.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/floats-wrap-top-below-bfc-003r.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/floats-wrap-top-below-inline-002l.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/floats-wrap-top-below-inline-002r.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/floats-wrap-top-below-inline-003l.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/floats-wrap-top-below-inline-003r.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/height-applies-to-010a.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/height-percentage-005.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/height-width-inline-table-001.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/height-width-table-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-non-replaced-height-001.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-non-replaced-height-002.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-non-replaced-width-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-non-replaced-width-002.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-non-replaced-width-003.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-non-replaced-width-004.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-replaced-height-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-replaced-height-002.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-replaced-height-003.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-replaced-height-004.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-replaced-height-005.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-replaced-height-007.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-replaced-height-008.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-replaced-width-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-block-replaced-width-006.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-box-002.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-non-replaced-height-002.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-non-replaced-height-003.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-non-replaced-width-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-non-replaced-width-002.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-height-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-height-002.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-height-003.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-height-004.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-height-005.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-height-007.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-height-008.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-width-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-width-006.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-width-011.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-width-012.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-width-013.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-width-014.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-replaced-width-015.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/inline-table-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/list-style-position-005.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-applies-to-001.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-applies-to-002.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-applies-to-003.htm [ Skip ] @@ -392,6 +411,7 @@ crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-applies-to-005.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-applies-to-006.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-applies-to-007.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-applies-to-008.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-applies-to-009.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-applies-to-010.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-applies-to-012.htm [ Skip ] @@ -399,38 +419,71 @@ crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-applies-to-014.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-applies-to-015.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-collapse-012.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-collapse-027.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-collapse-clear-012.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-collapse-clear-013.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-collapse-clear-014.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-collapse-clear-015.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-collapse-clear-016.htm [ Skip ] -crbug.com/635619 virtual/layout_ng/css2.1/20110323/margin-collapse-clear-017.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/max-height-percentage-003.html [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/outline-color-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/outline-color-applies-to-008.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/outline-color-applies-to-009.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/outline-color-applies-to-010.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/outline-color-applies-to-014.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/overflow-applies-to-007.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/overflow-applies-to-009.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/overflow-applies-to-012.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/overflow-applies-to-013.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/overflow-applies-to-014.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/overflow-applies-to-015.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/replaced-elements-001.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/replaced-intrinsic-001.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/replaced-intrinsic-002.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/replaced-intrinsic-003.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/replaced-intrinsic-004.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/replaced-intrinsic-005.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/replaced-intrinsic-ratio-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/replaced-min-max-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/table-caption-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/table-caption-002.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/table-caption-horizontal-alignment-001.htm [ Skip ] crbug.com/635619 virtual/layout_ng/css2.1/20110323/table-caption-margins-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/table-caption-optional-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/table-caption-optional-002.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/table-height-algorithm-023.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/table-height-algorithm-024.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/text-indent-014.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/text-indent-intrinsic-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/text-indent-intrinsic-002.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/text-indent-intrinsic-003.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/text-indent-intrinsic-004.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/width-non-replaced-inline-001.htm [ Skip ] +crbug.com/635619 virtual/layout_ng/css2.1/20110323/width-replaced-element-001.htm [ Skip ] #### fast/block/basic -#### Passed: 12 -#### Skipped: 20 +#### Passed: 3 +#### Skipped: 29 crbug.com/635619 virtual/layout_ng/fast/block/basic/001.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/basic/002.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/basic/003.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/004.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/005.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/006.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/007.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/008.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/009.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/010.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/basic/011.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/basic/012.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/basic/013.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/basic/014.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/015.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/basic/016.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/018.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/basic/019.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/basic/020.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/basic/adding-near-anonymous-block.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/basic/fieldset-stretch-to-legend.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/basic/min-pref-width-nowrap-floats.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/basic/minheight.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/basic/percent-height-inside-anonymous-block.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/basic/quirk-height.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/basic/quirk-percent-height-grandchild.html [ Skip ] @@ -440,33 +493,50 @@ crbug.com/635619 virtual/layout_ng/fast/block/basic/white-space-pre-wraps.html [ Skip ] #### fast/block/margin-collapse -#### Passed: 27 -#### Skipped: 63 +#### Passed: 8 +#### Skipped: 82 crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/001.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/002.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/003.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/004.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/005.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/006.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/010.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/011.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/012.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/015.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/016.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/017.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/018.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/019.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/020.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/021.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/022.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/025.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/026.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/027.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/028.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/029.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/030.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/031.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/032.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/033.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/034.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/035.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/037.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/038.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/039.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/040.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/041.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/042.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/043.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/044.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/045.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/055.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/056.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/057.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/058.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/059.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/062.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/063.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/100.html [ Skip ] @@ -480,6 +550,10 @@ crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/003.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/004.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/005.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/006.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/010.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/011.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/012.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/015.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/016.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/017.html [ Skip ] @@ -489,12 +563,11 @@ crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/021.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/022.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inline/025.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/clear-dynamically-added-float.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/clear-nested-float-more-than-one-previous-sibling-away.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/clearance-less-than-margin.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/empty-clear-blocks.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/line-beside-float-complex-margin-collapsing.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/positioned-element-margin-change.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/negative-margins.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/self-collapsing-block-creates-block-formatting-context.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/self-collapsing-block-with-float-child-collapsed-margins.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/self-collapsing-block-with-float-child.html [ Skip ] @@ -504,11 +577,10 @@ crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/table-beside-float-complex-margin-collapsing.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/webkit-margin-collapse-container.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/webkit-margin-collapse-separate-position.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/webkit-margin-collapse-siblings.html [ Skip ] #### fast/block/float -#### Passed: 45 -#### Skipped: 152 +#### Passed: 56 +#### Skipped: 150 crbug.com/635619 virtual/layout_ng/fast/block/float/001.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/002.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/003.html [ Skip ] @@ -545,12 +617,19 @@ crbug.com/635619 virtual/layout_ng/fast/block/float/034.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/035.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/4145535Crash.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/add-float-back-to-anonymous-block.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/float/add-abspos-before-float-in-block-children-block.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/add-inline-before-float-and-after-anonymous-block.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/add-inline-before-float-in-block-children-block.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/add-inline-between-floats-with-preceding-anonymous-box.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/add-inline-to-block-flow-and-ensure-layout-on-containers-of-removed-floats.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/add-inline-to-block-flow-with-block-children-that-do-not-need-anonymous-boxes.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/float/add-inlines-in-block-children-block.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-when-negative-margin-top-2.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-when-negative-margin-top-3.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-when-negative-margin-top-4.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-when-negative-margin-top-5.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-when-negative-margin-top-6.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-when-negative-margin-top.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-with-negative-margins.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/avoidance-percent-width-compat.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/avoidance-percent-width-strict.html [ Skip ] @@ -566,7 +645,6 @@ crbug.com/635619 virtual/layout_ng/fast/block/float/clear-negative-margin-top.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/clear-to-fit.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/containing-block-change-compositing.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/crash-on-absolute-positioning.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/dynamic-unfloat-pref-width.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/editable-text-overlapping-float.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/element-clears-float-without-clearance.html [ Skip ] @@ -578,37 +656,32 @@ crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-next-sibling.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-next-sibling2.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-next-sibling3.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-next-sibling4.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-next-sibling5.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-next-sibling-crash.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-pre-block.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/float-on-line-obeys-container-padding.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/float-on-zero-height-line.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/float-overflow-hidden-containing-block-width.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/float-overhangs-root.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/float-should-dirty-line-even-when-it-doesnt-intersect-it.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/float/floats-and-text-indent-rl.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/float/floats-and-text-indent.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/floats-do-not-overhang-from-block-formatting-context.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/floats-not-cleared-crash.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/floats-offset-image-quirk-line-height.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/floats-offset-image-quirk.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/floats-offset-image-strict-line-height.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/floats-offset-image-strict.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/floats-offset-inline-block-quirk-line-height.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/floats-offset-inline-block-strict-line-height.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/float/floats-with-margin-should-not-wrap.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/floats-wrap-inside-inline-001.htm [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/floats-wrap-inside-inline-002.htm [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/floats-wrap-inside-inline-003.htm [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/floats-wrap-inside-inline-004.htm [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/floats-wrap-inside-inline-006.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/floats-wrap-inside-inline-007.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/floats-with-margin-should-not-wrap.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/formatting-context-changes.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/in-margin.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/independent-align-positioning.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/intruding-float-add-in-sibling-block-on-static-position.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/intruding-float-add-in-sibling-block-on-static-position2.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/intruding-float-not-removed-from-descendant-crash.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/intruding-float-not-removed-writing-mode.xhtml [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/intruding-float-remove-from-sibling-block-on-absolute-position.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/intruding-float-remove-from-sibling-block-on-absolute-position2.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/intruding-float-remove-from-sibling-block-on-fixed-position.html [ Skip ] @@ -635,7 +708,6 @@ crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-float-add-in-static-position-block2.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-float-container-add-compositing.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-float-container-remove-compositing.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-float-crashes-when-sibling-becomes-formatting-context.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-float-remove-from-absolute-position-block.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-float-remove-from-absolute-position-block2.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-float-remove-from-fixed-position-block.html [ Skip ] @@ -655,16 +727,17 @@ crbug.com/635619 virtual/layout_ng/fast/block/float/shrink-to-avoid-float-complexity.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/shrink-to-fit-width.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/table-relayout.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/trailing-float-with-columns.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/trailing-float-with-content.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/float/trailing-float.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/vertical-move-relayout.html [ Skip ] crbug.com/635619 virtual/layout_ng/fast/block/float/width-update-after-clear.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-when-negative-margin-top-2.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-when-negative-margin-top-3.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-when-negative-margin-top-4.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-when-negative-margin-top-5.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-when-negative-margin-top-6.html [ Skip ] -crbug.com/635619 virtual/layout_ng/fast/block/float/avoid-floats-when-negative-margin-top.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/float/trailing-float-with-columns.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/float/intruding-float-not-removed-writing-mode.xhtml [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-next-sibling-crash.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-next-sibling4.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/float/canvas-with-floats-marked-for-layout.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/float/crash-on-absolute-positioning.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/float/float-not-removed-from-next-sibling5.html [ Skip ] +crbug.com/635619 virtual/layout_ng/fast/block/float/overhanging-float-crashes-when-sibling-becomes-formatting-context.html [ Skip ] # ====== LayoutNG-only failures until here ====== # Requires ServiceWorkerNavigationPreload feature enabled. Run under @@ -1770,7 +1843,6 @@ crbug.com/613659 external/wpt/quirks-mode/percentage-height-calculation.html [ Failure ] crbug.com/613661 external/wpt/quirks-mode/table-cell-nowrap-minimum-width-calculation.html [ Failure ] crbug.com/613663 external/wpt/quirks-mode/table-cell-width-calculation.html [ Failure ] -crbug.com/613663 external/wpt/quirks-mode/unitless-length.html [ Failure Timeout ] # Note: this test was previously marked as slow on Debug builds. Skipping until crash is fixed crbug.com/619978 fast/css/giant-stylesheet-crash.html [ Skip ] @@ -1801,6 +1873,11 @@ crbug.com/685778 virtual/mojo-loading/http/tests/dom/promise-rejection-events.html [ Pass Failure ] # ====== New tests from w3c-test-autoroller added here ====== +crbug.com/626703 [ Trusty Mac10.11 Mac10.10 Retina Win7 Win10 Mac10.9 ] external/wpt/streams/writable-streams/close.dedicatedworker.html [ Timeout ] +crbug.com/626703 [ Trusty Mac10.11 Mac10.10 Retina Win7 Win10 Mac10.9 ] external/wpt/streams/writable-streams/close.html [ Timeout ] +crbug.com/626703 [ Trusty Mac10.11 Mac10.10 Retina Win7 Win10 Mac10.9 ] external/wpt/streams/writable-streams/close.serviceworker.https.html [ Timeout ] +crbug.com/626703 [ Trusty Mac10.11 Mac10.10 Retina Win7 Win10 Mac10.9 ] external/wpt/service-workers/service-worker/registration-useCache.https.html [ Timeout ] +crbug.com/626703 [ Trusty Mac10.11 Mac10.10 Retina Win7 Win10 Mac10.9 ] external/wpt/streams/writable-streams/close.sharedworker.html [ Timeout ] crbug.com/626703 external/csswg-test/css-flexbox-1/layout-algorithm_algo-cross-line-001.html [ Failure ] crbug.com/626703 external/wpt/dom/nodes/Document-characterSet-normalization.html [ Timeout ] crbug.com/626703 external/wpt/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-2.html [ Timeout ] @@ -1918,7 +1995,6 @@ crbug.com/666703 external/wpt/html/browsers/sandboxing/sandbox-disallow-same-origin.html [ Timeout ] crbug.com/626703 external/wpt/fullscreen/api/element-request-fullscreen-two-iframes-manual.html [ Timeout ] crbug.com/626703 external/wpt/html/dom/documents/dom-tree-accessors/Document.currentScript.html [ Timeout ] -crbug.com/626703 external/wpt/service-workers/service-worker/extendable-event-async-waituntil.https.html [ Pass Timeout ] crbug.com/655458 external/wpt/workers/constructors/SharedWorker/undefined-arguments.html [ Failure ] crbug.com/655458 external/wpt/workers/baseurl/alpha/worker.html [ Failure ] @@ -2102,8 +2178,6 @@ crbug.com/670024 external/wpt/webmessaging/broadcastchannel/sandbox.html [ Failure ] crbug.com/660384 external/wpt/webmessaging/with-ports/001.html [ Failure ] crbug.com/660384 external/wpt/webmessaging/without-ports/001.html [ Failure ] -crbug.com/665820 external/wpt/webmessaging/with-ports/010.html [ Failure ] -crbug.com/665820 external/wpt/webmessaging/without-ports/010.html [ Failure ] crbug.com/673526 external/wpt/webmessaging/message-channels/close.html [ Failure ] # Added 2016-12-06
diff --git a/third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/device-name-longer-than-29-bytes.html b/third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/device-name-longer-than-29-bytes.html index ee8a4b34..1132bcc 100644 --- a/third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/device-name-longer-than-29-bytes.html +++ b/third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/device-name-longer-than-29-bytes.html
@@ -5,10 +5,10 @@ <script> 'use strict'; promise_test(() => { - const DEVICE_NAME = 'a_device_name_that_is_longer_than_29_bytes_but_shorter_than_240_bytes'; + const DEVICE_NAME = 'a_device_name_that_is_longer_than_29_bytes_but_shorter_than_248_bytes'; return setBluetoothFakeAdapter('DeviceNameLongerThan29BytesAdapter') .then(() => requestDeviceWithKeyDown({ filters: [{name: DEVICE_NAME}]})) .then(device => assert_equals(device.name, DEVICE_NAME)); -}, 'A device name between 29 and 240 bytes is valid.'); +}, 'A device name between 29 and 248 bytes is valid.'); </script>
diff --git a/third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/max-length-for-name-in-adv-name.html b/third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/max-length-for-name-in-adv-name.html index 7a8f843..c4e3fca5 100644 --- a/third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/max-length-for-name-in-adv-name.html +++ b/third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/max-length-for-name-in-adv-name.html
@@ -5,15 +5,13 @@ <script> 'use strict'; promise_test(() => { - const name_too_long = generate_string(241, 'a'); + const name_too_long = generate_string(249, 'a'); return assert_promise_rejects_with_message( requestDeviceWithKeyDown({filters: [{name: name_too_long}]}), new DOMException( 'Failed to execute \'requestDevice\' on \'Bluetooth\': ' + - 'A \'name\' or \'namePrefix\' longer than 240 bytes ' + - 'results in no devices being found, because a device can\'t ' + - 'acquire a name longer than 240 bytes.', - 'NotFoundError'), - 'Device name longer than 240'); -}, 'A device name longer than 240 bytes must reject.'); + 'A device name can\'t be longer than 248 bytes.', + 'TypeError'), + 'Device name longer than 248'); +}, 'A device name longer than 248 bytes must reject.'); </script>
diff --git a/third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/max-length-for-name-in-adv-namePrefix.html b/third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/max-length-for-name-in-adv-namePrefix.html index f227465..4b088e52 100644 --- a/third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/max-length-for-name-in-adv-namePrefix.html +++ b/third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/max-length-for-name-in-adv-namePrefix.html
@@ -5,15 +5,13 @@ <script> 'use strict'; promise_test(() => { - let name_too_long = generate_string(241, 'a'); + let name_too_long = generate_string(249, 'a'); return assert_promise_rejects_with_message( requestDeviceWithKeyDown({filters: [{namePrefix: name_too_long}]}), new DOMException( 'Failed to execute \'requestDevice\' on \'Bluetooth\': ' + - 'A \'name\' or \'namePrefix\' longer than 240 bytes ' + - 'results in no devices being found, because a device can\'t ' + - 'acquire a name longer than 240 bytes.', - 'NotFoundError'), - 'Device name prefix longer than 240'); -}, 'A device name prefix longer than 240 must reject.'); + 'A device name can\'t be longer than 248 bytes.', + 'TypeError'), + 'Device name prefix longer than 248'); +}, 'A device name prefix longer than 248 must reject.'); </script>
diff --git a/third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-device-name-name.html b/third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-device-name-name.html index 0ec1edba..de430b3 100644 --- a/third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-device-name-name.html +++ b/third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-device-name-name.html
@@ -5,16 +5,14 @@ <script> promise_test(() => { // \u2764's UTF-8 respresentation is 3 bytes long. - // 81 chars * 3 bytes/char = 243 bytes - const unicode_name = generate_string(81, '\u2764'); + // 83 chars * 3 bytes/char = 249 bytes + const unicode_name = generate_string(83, '\u2764'); return assert_promise_rejects_with_message( requestDeviceWithKeyDown({filters: [{name: unicode_name}]}), new DOMException( 'Failed to execute \'requestDevice\' on \'Bluetooth\': ' + - 'A \'name\' or \'namePrefix\' longer than 240 bytes ' + - 'results in no devices being found, because a device can\'t ' + - 'acquire a name longer than 240 bytes.', - 'NotFoundError')); -}, 'Unicode string with utf8 representation between (240, 248] bytes in ' + - '\'name\' must throw NotFoundError.'); + 'A device name can\'t be longer than 248 bytes.', + 'TypeError')); +}, 'Unicode string with utf8 representation longer than 248 bytes in ' + + '\'name\' must throw TypeError.'); </script>
diff --git a/third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-device-name-namePrefix.html b/third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-device-name-namePrefix.html index b366514..9fc02e7 100644 --- a/third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-device-name-namePrefix.html +++ b/third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-device-name-namePrefix.html
@@ -5,16 +5,14 @@ <script> promise_test(() => { // \u2764's UTF-8 respresentation is 3 bytes long. - // 81 chars * 3 bytes/char = 243 bytes - let unicode_name = generate_string(81, '\u2764'); + // 83 chars * 3 bytes/char = 249 bytes + let unicode_name = generate_string(83, '\u2764'); return assert_promise_rejects_with_message( requestDeviceWithKeyDown({filters: [{namePrefix: unicode_name}]}), new DOMException( 'Failed to execute \'requestDevice\' on \'Bluetooth\': ' + - 'A \'name\' or \'namePrefix\' longer than 240 bytes ' + - 'results in no devices being found, because a device can\'t ' + - 'acquire a name longer than 240 bytes.', - 'NotFoundError')); -}, 'Unicode string with utf8 representation between (240, 248] bytes in ' + + 'A device name can\'t be longer than 248 bytes.', + 'TypeError')); +}, 'Unicode string with utf8 representation longer than 248 bytes in ' + '\'namePrefix\' must throw NotFoundError.'); </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/IndexedDB/idbcursor-continuePrimaryKey.htm b/third_party/WebKit/LayoutTests/external/wpt/IndexedDB/idbcursor-continuePrimaryKey.htm new file mode 100644 index 0000000..773141c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/IndexedDB/idbcursor-continuePrimaryKey.htm
@@ -0,0 +1,134 @@ +<!doctype html> +<meta charset="utf8"> +<title>IndexedDB: IDBCursor method continuePrimaryKey()</title> +<link rel="help" + href="http://w3c.github.io/IndexedDB/#dom-idbcursor-continueprimarykey"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="support.js"></script> + +<script> +'use strict'; + +indexeddb_test( + (t, db, txn) => { + const store = db.createObjectStore('store'); + const index = store.createIndex('index', 'indexKey', {multiEntry: true}); + + store.put({indexKey: ['a', 'b']}, 1); + store.put({indexKey: ['a', 'b']}, 2); + store.put({indexKey: ['a', 'b']}, 3); + store.put({indexKey: ['b']}, 4); + + const expectedIndexEntries = [ + {key: "a", primaryKey: 1}, + {key: "a", primaryKey: 2}, + {key: "a", primaryKey: 3}, + {key: "b", primaryKey: 1}, + {key: "b", primaryKey: 2}, + {key: "b", primaryKey: 3}, + {key: "b", primaryKey: 4}, + ]; + + const request = index.openCursor(); + request.onerror = t.unreached_func('IDBIndex.openCursor should not fail'); + request.onsuccess = t.step_func(() => { + const cursor = request.result; + const expectedEntry = expectedIndexEntries.shift(); + if (expectedEntry) { + assert_equals(cursor.key, expectedEntry.key, + 'The index entry keys should reflect the object store contents'); + assert_equals(cursor.primaryKey, expectedEntry.primaryKey, + 'The index entry primary keys should reflect the object store ' + + 'contents'); + cursor.continue(); + } else { + assert_equals(cursor, null, + 'The index should not have entries that do not reflect the ' + + 'object store contents'); + } + }); + }, + (t, db) => { + const testCases = [ + // Continuing index key + { call: cursor => { cursor.continue(); }, + result: { key: "a", primaryKey: 2 } }, + { call: cursor => { cursor.continue('a'); }, + exception: 'DataError' }, + { call: cursor => { cursor.continue('b'); }, + result: { key: "b", primaryKey: 1 } }, + { call: cursor => { cursor.continue('c'); }, result: null }, + + // Called w/ index key and primary key: + { call: cursor => { cursor.continuePrimaryKey('a', 3); }, + result: { key: 'a', primaryKey: 3 } }, + { call: cursor => { cursor.continuePrimaryKey('a', 4); }, + result: { key: 'b', primaryKey: 1 } }, + { call: cursor => { cursor.continuePrimaryKey('b', 1); }, + result: {key: 'b', primaryKey: 1} }, + { call: cursor => { cursor.continuePrimaryKey('b', 4); }, + result: {key: 'b', primaryKey: 4} }, + { call: cursor => { cursor.continuePrimaryKey('b', 5); }, + result: null }, + { call: cursor => { cursor.continuePrimaryKey('c', 1); }, + result: null }, + + // Called w/ primary key but w/o index key + { call: cursor => { cursor.continuePrimaryKey(null, 1); }, + exception: 'DataError' }, + { call: cursor => { cursor.continuePrimaryKey(null, 2); }, + exception: 'DataError' }, + { call: cursor => { cursor.continuePrimaryKey(null, 3); }, + exception: 'DataError' }, + { call: cursor => { cursor.continuePrimaryKey(null, 4); }, + exception: 'DataError' }, + { call: cursor => { cursor.continuePrimaryKey(null, 5); }, + exception: 'DataError' }, + + // Called w/ index key but w/o primary key + { call: cursor => { cursor.continuePrimaryKey('a', null); }, + exception: 'DataError' }, + ]; + + const verifyContinueCalls = () => { + if (!testCases.length) { + t.done(); + return; + } + + const testCase = testCases.shift(); + + const txn = db.transaction('store'); + txn.oncomplete = t.step_func(verifyContinueCalls); + + const request = txn.objectStore('store').index('index').openCursor(); + let calledContinue = false; + request.onerror = + t.unreached_func('IDBIndex.openCursor should not fail'); + request.onsuccess = t.step_func(() => { + const cursor = request.result; + if (calledContinue) { + if (testCase.result) { + assert_equals(cursor.key, testCase.result.key, + `${testCase.call.toString()} - result key`); + assert_equals(cursor.primaryKey, testCase.result.primaryKey, + `${testCase.call.toString()} - result primary key`); + } else { + assert_equals(cursor, null); + } + } else { + calledContinue = true; + if('exception' in testCase) { + assert_throws( + testCase.exception, () => { testCase.call(cursor); }, + testCase.call.toString()); + } else { + testCase.call(cursor); + } + } + }); + }; + verifyContinueCalls(); + }); +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/MANIFEST.json b/third_party/WebKit/LayoutTests/external/wpt/MANIFEST.json index f841bc2..7809034 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/MANIFEST.json +++ b/third_party/WebKit/LayoutTests/external/wpt/MANIFEST.json
@@ -2949,6 +2949,42 @@ {} ] ], + "html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-001.html": [ + [ + "/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-001.html", + [ + [ + "/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-001-ref.html", + "==" + ] + ], + {} + ] + ], + "html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-002.html": [ + [ + "/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-002.html", + [ + [ + "/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-001-ref.html", + "==" + ] + ], + {} + ] + ], + "html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-003.html": [ + [ + "/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-003.html", + [ + [ + "/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-001-ref.html", + "==" + ] + ], + {} + ] + ], "html/semantics/text-level-semantics/the-bdi-element/bdi-auto-dir-default.html": [ [ "/html/semantics/text-level-semantics/the-bdi-element/bdi-auto-dir-default.html", @@ -3745,11 +3781,6 @@ {} ] ], - "./MANIFEST.json": [ - [ - {} - ] - ], "./README.md": [ [ {} @@ -3780,6 +3811,11 @@ {} ] ], + "./test_keys_wdspec.html": [ + [ + {} + ] + ], "./testharness_runner.html": [ [ {} @@ -5420,6 +5456,11 @@ {} ] ], + "html/browsers/browsing-the-web/history-traversal/browsing_context_name-0.html": [ + [ + {} + ] + ], "html/browsers/browsing-the-web/history-traversal/browsing_context_name-1.html": [ [ {} @@ -11690,26 +11731,11 @@ {} ] ], - "html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img_border_percent-expected.xhtml": [ - [ - {} - ] - ], "html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border-ref.xhtml": [ [ {} ] ], - "html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_perc-expected.xhtml": [ - [ - {} - ] - ], - "html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_pixel-expected.xhtml": [ - [ - {} - ] - ], "html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-fallback-ref.html": [ [ {} @@ -12060,16 +12086,6 @@ {} ] ], - "html/semantics/embedded-content/the-audio-element/audio_001-expected.htm": [ - [ - {} - ] - ], - "html/semantics/embedded-content/the-audio-element/audio_002-expected.htm": [ - [ - {} - ] - ], "html/semantics/embedded-content/the-audio-element/audio_content-ref.htm": [ [ {} @@ -12280,16 +12296,6 @@ {} ] ], - "html/semantics/embedded-content/the-video-element/video_content_image-expected.htm": [ - [ - {} - ] - ], - "html/semantics/embedded-content/the-video-element/video_content_text-expected.htm": [ - [ - {} - ] - ], "html/semantics/embedded-content/the-video-element/video_dynamic_poster-ref.htm": [ [ {} @@ -12350,6 +12356,11 @@ {} ] ], + "html/semantics/forms/resetting-a-form/reset-form-event-realm-support.html": [ + [ + {} + ] + ], "html/semantics/forms/textfieldselection/original-id.json": [ [ {} @@ -12705,11 +12716,6 @@ {} ] ], - "html/semantics/scripting-1/the-script-element/external-script-windows1250.js": [ - [ - {} - ] - ], "html/semantics/scripting-1/the-script-element/fetch-src/alpha/test.js": [ [ {} @@ -12745,22 +12751,22 @@ {} ] ], + "html/semantics/scripting-1/the-script-element/resources/cocoa-module.js": [ + [ + {} + ] + ], "html/semantics/scripting-1/the-script-element/resources/cross-origin.py": [ [ {} ] ], - "html/semantics/scripting-1/the-script-element/script-charset-01-expected.txt": [ + "html/semantics/scripting-1/the-script-element/resources/exports-cocoa.js": [ [ {} ] ], - "html/semantics/scripting-1/the-script-element/script-charset-02-expected.txt": [ - [ - {} - ] - ], - "html/semantics/scripting-1/the-script-element/script-charset-03-expected.txt": [ + "html/semantics/scripting-1/the-script-element/resources/set-script-executed.js": [ [ {} ] @@ -15105,6 +15111,16 @@ {} ] ], + "service-workers/service-worker/resources/update-max-aged-worker-imported-script.py": [ + [ + {} + ] + ], + "service-workers/service-worker/resources/update-max-aged-worker.py": [ + [ + {} + ] + ], "service-workers/service-worker/resources/update-nocookie-worker.py": [ [ {} @@ -15725,6 +15741,11 @@ {} ] ], + "svg-aam/README.md": [ + [ + {} + ] + ], "svg/README.md": [ [ {} @@ -17151,6 +17172,12 @@ {} ] ], + "IndexedDB/idbcursor-continuePrimaryKey.htm": [ + [ + "/IndexedDB/idbcursor-continuePrimaryKey.htm", + {} + ] + ], "IndexedDB/idbcursor-delete-exception-order.htm": [ [ "/IndexedDB/idbcursor-delete-exception-order.htm", @@ -19509,12 +19536,6 @@ {} ] ], - "dom/events/ProgressEvent.html": [ - [ - "/dom/events/ProgressEvent.html", - {} - ] - ], "dom/historical.html": [ [ "/dom/historical.html", @@ -24577,6 +24598,18 @@ {} ] ], + "html/rendering/non-replaced-elements/tables/table-vspace-hspace-s.html": [ + [ + "/html/rendering/non-replaced-elements/tables/table-vspace-hspace-s.html", + {} + ] + ], + "html/rendering/non-replaced-elements/tables/table-vspace-hspace.html": [ + [ + "/html/rendering/non-replaced-elements/tables/table-vspace-hspace.html", + {} + ] + ], "html/rendering/replaced-elements/svg-embedded-sizing/svg-in-img-auto.html": [ [ "/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-img-auto.html", @@ -25667,6 +25700,12 @@ {} ] ], + "html/semantics/forms/resetting-a-form/reset-form-event-realm.html": [ + [ + "/html/semantics/forms/resetting-a-form/reset-form-event-realm.html", + {} + ] + ], "html/semantics/forms/resetting-a-form/reset-form.html": [ [ "/html/semantics/forms/resetting-a-form/reset-form.html", @@ -26437,21 +26476,39 @@ {} ] ], - "html/semantics/scripting-1/the-script-element/script-charset-01.html": [ + "html/semantics/scripting-1/the-script-element/nomodule-reflect.html": [ [ - "/html/semantics/scripting-1/the-script-element/script-charset-01.html", + "/html/semantics/scripting-1/the-script-element/nomodule-reflect.html", {} ] ], - "html/semantics/scripting-1/the-script-element/script-charset-02.html": [ + "html/semantics/scripting-1/the-script-element/nomodule-set-on-async-classic-script.html": [ [ - "/html/semantics/scripting-1/the-script-element/script-charset-02.html", + "/html/semantics/scripting-1/the-script-element/nomodule-set-on-async-classic-script.html", {} ] ], - "html/semantics/scripting-1/the-script-element/script-charset-03.html": [ + "html/semantics/scripting-1/the-script-element/nomodule-set-on-external-module-script.html": [ [ - "/html/semantics/scripting-1/the-script-element/script-charset-03.html", + "/html/semantics/scripting-1/the-script-element/nomodule-set-on-external-module-script.html", + {} + ] + ], + "html/semantics/scripting-1/the-script-element/nomodule-set-on-inline-classic-scripts.html": [ + [ + "/html/semantics/scripting-1/the-script-element/nomodule-set-on-inline-classic-scripts.html", + {} + ] + ], + "html/semantics/scripting-1/the-script-element/nomodule-set-on-inline-module-script.html": [ + [ + "/html/semantics/scripting-1/the-script-element/nomodule-set-on-inline-module-script.html", + {} + ] + ], + "html/semantics/scripting-1/the-script-element/nomodule-set-on-synchronously-loaded-classic-scripts.html": [ + [ + "/html/semantics/scripting-1/the-script-element/nomodule-set-on-synchronously-loaded-classic-scripts.html", {} ] ], @@ -28431,6 +28488,12 @@ {} ] ], + "html/webappapis/scripting/events/eventhandler-cancellation.html": [ + [ + "/html/webappapis/scripting/events/eventhandler-cancellation.html", + {} + ] + ], "html/webappapis/scripting/events/inline-event-handler-ordering.html": [ [ "/html/webappapis/scripting/events/inline-event-handler-ordering.html", @@ -29997,6 +30060,12 @@ {} ] ], + "service-workers/service-worker/registration-useCache.https.html": [ + [ + "/service-workers/service-worker/registration-useCache.https.html", + {} + ] + ], "service-workers/service-worker/registration.https.html": [ [ "/service-workers/service-worker/registration.https.html", @@ -33932,16 +34001,12 @@ "89af73c41d456ee93bd40921e96414c1908fc48c", "support" ], - "./MANIFEST.json": [ - "3e36194cb38e3f18efda9d53f7a0a880cf69b95d", - "support" - ], "./README.md": [ - "e9590560efb0d37ab870037edaafc1c47dc7a785", + "47d52ff4a87b49dec2fb5ceb98211fb1b9af34fb", "support" ], "./check_stability.py": [ - "9396b01f28c0e6a19a68f515eb19b4f340c0e98f", + "81b2d6b1f7aa7d8c237fb715e7b91c235276befd", "support" ], "./ci_built_diff.sh": [ @@ -33953,13 +34018,17 @@ "support" ], "./ci_stability.sh": [ - "1c7177b11b9adc0e9798f40f0f0c5e7463312ae4", + "4980fd066b8beb14b0bd55fd62375ee628c30e26", "support" ], "./diff-manifest.py": [ "94689a9853ab8d0ddcd85b2a8db4b6f2c9045b4a", "support" ], + "./test_keys_wdspec.html": [ + "13e6f15dcfe080bff5f3b3cbaf9b9f679915aca3", + "support" + ], "./testharness_runner.html": [ "3acc55e132ad104495a2ccd0390a6369364f6900", "support" @@ -34212,6 +34281,10 @@ "7c2ddb95ce4b7c588ddb2907367a365902eba349", "testharness" ], + "IndexedDB/idbcursor-continuePrimaryKey.htm": [ + "e1c89f1ce01d8ec027337aef844dad4c2990b6c2", + "testharness" + ], "IndexedDB/idbcursor-delete-exception-order.htm": [ "6bb279530dbdedba84a2d45d58e5d0a81a4d95e5", "testharness" @@ -36016,10 +36089,6 @@ "8d195a4490df833fdd71388d9e8cc6e38d50cbd8", "testharness" ], - "dom/events/ProgressEvent.html": [ - "30fc510ed8f122c4b03492bfcabf3ed5886e18d2", - "testharness" - ], "dom/historical-expected.txt": [ "9d6e420616003f2a24043b4a1a3e21149f52f9a5", "support" @@ -36841,7 +36910,7 @@ "testharness" ], "dom/nodes/Node-isSameNode.html": [ - "d6e50aaee5d996fd4ba651724ae24ea1df817f57", + "4d2530ef5f322041d04b8d6ca91d873d24b768ef", "testharness" ], "dom/nodes/Node-lookupNamespaceURI-expected.txt": [ @@ -38656,6 +38725,10 @@ "2a7ed0827fc61af7b3bdd238577887aff1902ea7", "testharness" ], + "html/browsers/browsing-the-web/history-traversal/browsing_context_name-0.html": [ + "059f6738127f25477f8c17dc3e79f2dc7ea64465", + "support" + ], "html/browsers/browsing-the-web/history-traversal/browsing_context_name-1.html": [ "2eda3fa32e3918ee4d75989fc2e6f03582ce6e75", "support" @@ -38673,7 +38746,7 @@ "support" ], "html/browsers/browsing-the-web/history-traversal/browsing_context_name.html": [ - "81bbf80abda0f3445c4d87e0e1c11e3219d2edce", + "87d7d141b05200ad3db0660d9d8d8bdf7876ee4b", "testharness" ], "html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin-expected.txt": [ @@ -40097,7 +40170,7 @@ "support" ], "html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions.html": [ - "1b20d98e7bb5138ba4db9d74f3458f6fe9d090d2", + "9f9f6d11d0444daf297a75ce1301e7300aef94f0", "testharness" ], "html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt": [ @@ -45920,6 +45993,14 @@ "ec05c435cfd09291184360db7e8b0c5af9c7ba31", "reftest" ], + "html/rendering/non-replaced-elements/tables/table-vspace-hspace-s.html": [ + "a93cbe26a0c5b9a7aeda1faf9db618f79aae8715", + "testharness" + ], + "html/rendering/non-replaced-elements/tables/table-vspace-hspace.html": [ + "76be2c71dea58327c4d4b1ba424993ff73c5f847", + "testharness" + ], "html/rendering/non-replaced-elements/tables/table-width-150percent-ref.html": [ "a25b7aad09676bed5d05714aeae6b5a6b4dbb4b5", "support" @@ -46000,10 +46081,6 @@ "ac9dfeaa1741dd19b4ef8f4d80bf611384d6bef3", "support" ], - "html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img_border_percent-expected.xhtml": [ - "ac9dfeaa1741dd19b4ef8f4d80bf611384d6bef3", - "support" - ], "html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img_border_percent.xhtml": [ "c1cff7b05cc400195328292521ecf76840d60540", "reftest" @@ -46012,18 +46089,10 @@ "48efda6cb8f06cc70c71c436cecf6f3e4fea6aec", "support" ], - "html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_perc-expected.xhtml": [ - "48efda6cb8f06cc70c71c436cecf6f3e4fea6aec", - "support" - ], "html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_perc.xhtml": [ "4e888bdc4247bac6d5f9506e6271f4bbe7612cdd", "reftest" ], - "html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_pixel-expected.xhtml": [ - "48efda6cb8f06cc70c71c436cecf6f3e4fea6aec", - "support" - ], "html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_pixel.xhtml": [ "c1a52d71881ec5326761f415cc319a467587be17", "reftest" @@ -46820,18 +46889,10 @@ "d6128e676d8584222248b03ae2e868136377d799", "support" ], - "html/semantics/embedded-content/the-audio-element/audio_001-expected.htm": [ - "a74faddb16266717024b3a4efa21be7f4d00a85e", - "support" - ], "html/semantics/embedded-content/the-audio-element/audio_001.htm": [ "608d30e852106678bacc806e9164e20661988e7b", "reftest" ], - "html/semantics/embedded-content/the-audio-element/audio_002-expected.htm": [ - "a74faddb16266717024b3a4efa21be7f4d00a85e", - "support" - ], "html/semantics/embedded-content/the-audio-element/audio_002.htm": [ "39c8512ae68bde322b290151f57376b96bf220be", "reftest" @@ -47160,18 +47221,10 @@ "f5a95965f0948f5f023cf1d0ecb7af66cdc1c8cd", "support" ], - "html/semantics/embedded-content/the-video-element/video_content_image-expected.htm": [ - "f5a95965f0948f5f023cf1d0ecb7af66cdc1c8cd", - "support" - ], "html/semantics/embedded-content/the-video-element/video_content_image.htm": [ "f8b4611c5e5b66af9054fc4dbb6297aec2bb37f0", "reftest" ], - "html/semantics/embedded-content/the-video-element/video_content_text-expected.htm": [ - "f5a95965f0948f5f023cf1d0ecb7af66cdc1c8cd", - "support" - ], "html/semantics/embedded-content/the-video-element/video_content_text.htm": [ "599f3a1eb975db5648309470be18b7f30f147d62", "reftest" @@ -47352,6 +47405,14 @@ "2b9329c270fb73a2ab60f5e9549afdfa91a13522", "testharness" ], + "html/semantics/forms/resetting-a-form/reset-form-event-realm-support.html": [ + "2530f8b46c8ec015b165deec1c99e0a495325073", + "support" + ], + "html/semantics/forms/resetting-a-form/reset-form-event-realm.html": [ + "4c3d5d366e123fcf8f2ddcfc2211f0e45902fbe5", + "testharness" + ], "html/semantics/forms/resetting-a-form/reset-form.html": [ "73e4daacde901f0dc1babb9136f4bcebd98b0250", "testharness" @@ -47369,7 +47430,7 @@ "testharness" ], "html/semantics/forms/textfieldselection/selection-not-application-textarea.html": [ - "33eb11907327723f41325499c1a4ea38d075f469", + "629f3682421060ea18e9046a637402212be1b1fd", "testharness" ], "html/semantics/forms/textfieldselection/selection-not-application.html": [ @@ -47657,7 +47718,7 @@ "support" ], "html/semantics/forms/the-input-element/time.html": [ - "71ec9a48d420683524432c5fb1086b67cd858d9a", + "59e06cf5e9a4ccc837c0bc1e7b37c2a1db1a154b", "testharness" ], "html/semantics/forms/the-input-element/type-change-state-expected.txt": [ @@ -48248,10 +48309,6 @@ "2d1c2cf696010feb64b17f00a072f3bbe6b1d713", "support" ], - "html/semantics/scripting-1/the-script-element/external-script-windows1250.js": [ - "3ae0d51ae4444e95a21cbe8d9d10822615903859", - "support" - ], "html/semantics/scripting-1/the-script-element/fetch-src/alpha/base.html": [ "13d313f817d5597dd0cecbc23f0162f95f9634cc", "testharness" @@ -48304,34 +48361,46 @@ "12842b6e600ac2fc737718d8a9ba3385ed8b678b", "support" ], + "html/semantics/scripting-1/the-script-element/nomodule-reflect.html": [ + "ac2b3c16e9e9263cd4c14de205b63709c14ec2e3", + "testharness" + ], + "html/semantics/scripting-1/the-script-element/nomodule-set-on-async-classic-script.html": [ + "5b4a532b21caa6235bed10a28878c65523a816aa", + "testharness" + ], + "html/semantics/scripting-1/the-script-element/nomodule-set-on-external-module-script.html": [ + "f43755d9dffe2983a377f2c00b855f106776b617", + "testharness" + ], + "html/semantics/scripting-1/the-script-element/nomodule-set-on-inline-classic-scripts.html": [ + "2b6654342c5a2e2d85df2bc8ec805b5fa7ed1550", + "testharness" + ], + "html/semantics/scripting-1/the-script-element/nomodule-set-on-inline-module-script.html": [ + "071d6550f88d5f04de77fd28a314dbc7121b758f", + "testharness" + ], + "html/semantics/scripting-1/the-script-element/nomodule-set-on-synchronously-loaded-classic-scripts.html": [ + "a5600b1fcb40e3dbdf223fbeee40c0a3f096eed1", + "testharness" + ], + "html/semantics/scripting-1/the-script-element/resources/cocoa-module.js": [ + "43291b3e6eff8267c88100990aae5d4b2a09f3bd", + "support" + ], "html/semantics/scripting-1/the-script-element/resources/cross-origin.py": [ "33c88a19aa061be518067c54019190ec979d4c82", "support" ], - "html/semantics/scripting-1/the-script-element/script-charset-01-expected.txt": [ - "a8ae591ec0e456203b9f7dda9edce12b44c038b5", + "html/semantics/scripting-1/the-script-element/resources/exports-cocoa.js": [ + "5797045ac8591d2662a6714367ae5fb257881793", "support" ], - "html/semantics/scripting-1/the-script-element/script-charset-01.html": [ - "4d8f27447b5c76174a2e353f160066fbe156a005", - "testharness" - ], - "html/semantics/scripting-1/the-script-element/script-charset-02-expected.txt": [ - "4a85d08d344151889a33fea7bc6a170f244db03d", + "html/semantics/scripting-1/the-script-element/resources/set-script-executed.js": [ + "87f80eee703965c88f2bf7015bfa76233d459d06", "support" ], - "html/semantics/scripting-1/the-script-element/script-charset-02.html": [ - "fd855537451d81818fda97de8a6eff2f8ebd7a5e", - "testharness" - ], - "html/semantics/scripting-1/the-script-element/script-charset-03-expected.txt": [ - "a77ed7620d50ecf98ba93f936ceb320717715347", - "support" - ], - "html/semantics/scripting-1/the-script-element/script-charset-03.html": [ - "c1daf890ff2c71f63d1c668de9002d493dbcb417", - "testharness" - ], "html/semantics/scripting-1/the-script-element/script-crossorigin-network.html": [ "ca03ec45f3b8d117d0488b67f082868bac847af6", "testharness" @@ -48468,6 +48537,18 @@ "2ab63995dc287024cc49483dc2d8f4270000d668", "support" ], + "html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-001.html": [ + "62d5180ca4749806a81b41929d989681fa17a75c", + "reftest" + ], + "html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-002.html": [ + "38e9c81ee4c5683573ae45c37226efe5465c9245", + "reftest" + ], + "html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-003.html": [ + "f049497d3d3c4e264b9a5c13bd3b0752622a97c4", + "reftest" + ], "html/semantics/scripting-1/the-template-element/additions-to-the-steps-to-clone-a-node/template-clone-children.html": [ "5a73307301969f09528ce46c832d69a9f5ba2b75", "testharness" @@ -48757,7 +48838,7 @@ "testharness" ], "html/semantics/tabular-data/the-table-element/caption-methods.html": [ - "b075186509ce87285445cb3fffeb57176aa2a1ac", + "86605a4059ee7f25c555de2ad7f721beb566b2df", "testharness" ], "html/semantics/tabular-data/the-table-element/contains.json": [ @@ -49705,7 +49786,7 @@ "testharness" ], "html/webappapis/idle-callbacks/callback-timeout.html": [ - "65cd8599001086b880e8ad412074f874008a3523", + "ba76964575cdf9b433f26c8a5d7a8183ab5c16e9", "testharness" ], "html/webappapis/idle-callbacks/cancel-invoked.html": [ @@ -49780,6 +49861,10 @@ "8d4d0bfdf447591695ac134cd243277ea2326c84", "testharness" ], + "html/webappapis/scripting/events/eventhandler-cancellation.html": [ + "491fd73a4ec8812cb8dc1ee01e34a7ff2a07ffb3", + "testharness" + ], "html/webappapis/scripting/events/inline-event-handler-ordering-expected.txt": [ "cd0912b31fd49dd7dfc4fdab6b4da07b3b845c78", "support" @@ -51601,7 +51686,7 @@ "support" ], "service-workers/service-worker/extendable-event-async-waituntil.https.html": [ - "aebf55dd963ad3cc1b3bb724183f331e03a30d0a", + "fe5c4595f528af34d83a64bae1fe94a14483cde5", "testharness" ], "service-workers/service-worker/extendable-event-waituntil.https.html": [ @@ -51649,11 +51734,11 @@ "support" ], "service-workers/service-worker/fetch-event.https.html": [ - "9197ebb50014905e02645c5dc71d467be0e7604c", + "09024c86ce36bb31e96077acaa3609d16d424785", "testharness" ], "service-workers/service-worker/fetch-frame-resource.https.html": [ - "2646f17a101d0f4a4e57e6029240dd0e999bb1aa", + "e5996d90c4c383eda2947cc2bc39e734448b3bde", "testharness" ], "service-workers/service-worker/fetch-header-visibility.https.html": [ @@ -51848,6 +51933,10 @@ "7c49ce1c6170733033add6253a3f4a7e0483452e", "testharness" ], + "service-workers/service-worker/registration-useCache.https.html": [ + "73d662eafa93ca3dee4a4e5d34623cf069c2b8f8", + "testharness" + ], "service-workers/service-worker/registration.https.html": [ "9e21fc312a4aae93fcaf6013d20bd38c2cefc9cf", "testharness" @@ -51973,7 +52062,7 @@ "support" ], "service-workers/service-worker/resources/extendable-event-async-waituntil.js": [ - "d9087e4ef37fb2e7361bc332fe941126480a0b43", + "0383a4bcd4a4d0e4abd129262dc5b5fe329a3f26", "support" ], "service-workers/service-worker/resources/extendable-event-waituntil.js": [ @@ -52368,6 +52457,14 @@ "feae7f538da58d45e38f6f26da5ce6af0c91857f", "support" ], + "service-workers/service-worker/resources/update-max-aged-worker-imported-script.py": [ + "23fa131d0d35e0e5394100b4bfaa5ebf1a349b4b", + "support" + ], + "service-workers/service-worker/resources/update-max-aged-worker.py": [ + "384ab2835ccb57316d59a911af57ba8638b26ad0", + "support" + ], "service-workers/service-worker/resources/update-nocookie-worker.py": [ "0790be63a2023cccf03f84b2e5c8f5daa7958dd0", "support" @@ -53325,7 +53422,7 @@ "testharness" ], "streams/piping/general.js": [ - "dc53c5a5d9757095ffafd01eec4248af1a79b785", + "cb4f7956b3973e318f6227122ab0df3c017414d5", "support" ], "streams/piping/general.serviceworker-expected.txt": [ @@ -53477,7 +53574,7 @@ "testharness" ], "streams/readable-byte-streams/general.js": [ - "dd559f461e21ba39f5d66a6a8f84d501f12cdb07", + "6c213279d772e7087f35f8a19157f092bd77f90c", "support" ], "streams/readable-byte-streams/general.serviceworker-expected.txt": [ @@ -53533,7 +53630,7 @@ "testharness" ], "streams/readable-streams/bad-underlying-sources.js": [ - "514eba2a237991d057014da7defc613714d5273e", + "f980e8d1a99149a2292835eafb5484f8ee8da966", "support" ], "streams/readable-streams/bad-underlying-sources.serviceworker-expected.txt": [ @@ -53801,7 +53898,7 @@ "testharness" ], "streams/writable-streams/aborting.js": [ - "8b386bb36284d1cd342f29f6b90816584b8a3a60", + "744d55d9887783d92cdf81685358dab5a2016f84", "support" ], "streams/writable-streams/aborting.serviceworker-expected.txt": [ @@ -53921,7 +54018,7 @@ "testharness" ], "streams/writable-streams/close.js": [ - "36c84563a396556bc3c8515cd7666ef6cc243822", + "ac7f1df6753c0d171d61a274a8ae7c6f5107857c", "support" ], "streams/writable-streams/close.serviceworker-expected.txt": [ @@ -54041,7 +54138,7 @@ "testharness" ], "streams/writable-streams/write.js": [ - "6fd8ce8a637f54bfbd6ebbf5f318e613dee6cb13", + "f956e42aa67abce9b3e11179c800a6f9c625d111", "support" ], "streams/writable-streams/write.serviceworker-expected.txt": [ @@ -54056,6 +54153,10 @@ "f56e65526d831e3bbc3ed1f6d7faee0096781580", "testharness" ], + "svg-aam/README.md": [ + "e500c4f877bd2d7b482600d7c6b60823c4d49179", + "support" + ], "svg/README.md": [ "ce9e3471676d5a50b91f6b274d648b481e509223", "support" @@ -54549,7 +54650,7 @@ "testharness" ], "user-timing/resources/webperftestharness.js": [ - "483d2bb1e7edbba09b4db77f5e28ee8f8da50682", + "d0c87eea4d573ae58ddb9fc3140ae36b726ca278", "support" ], "user-timing/resources/webperftestharnessextension.js": [ @@ -54557,11 +54658,11 @@ "support" ], "user-timing/test_user_timing_clear_marks.html": [ - "f818ae04b62c3e1824f6497973e5bcaa2d370383", + "bc908c06f34655e7d71d46ab2c5587855eb5ea30", "testharness" ], "user-timing/test_user_timing_clear_measures.html": [ - "2bf43f0a82d3d868bad282446ba0ef8c3b6ef442", + "8e547c2537f411cb9f67347f2dc5d0ac2e68b442", "testharness" ], "user-timing/test_user_timing_entry_type.html": [ @@ -54573,7 +54674,7 @@ "testharness" ], "user-timing/test_user_timing_mark.html": [ - "8b234ec5956d7eab7cc5bf18d7c668f1a7cc622b", + "756da1c68bf824a788796b8bbb6a397cf1a7d484", "testharness" ], "user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes.html": [ @@ -54589,7 +54690,7 @@ "testharness" ], "user-timing/test_user_timing_mark_exceptions.html": [ - "6d21c976fc796cc5f9294f3b0ee1796ed3f1b8c1", + "e0d0d6cac8730b795009bddfc2aa021a7998ef83", "testharness" ], "user-timing/test_user_timing_mark_with_name_of_navigation_timing_optional_attribute.html": [ @@ -54597,15 +54698,15 @@ "testharness" ], "user-timing/test_user_timing_measure.html": [ - "5159e12bd79fa0330b71387cc385c77c95d11f0f", + "8967a9720d1774bff08a127265a2df3cedde8144", "testharness" ], "user-timing/test_user_timing_measure_exceptions.html": [ - "c1d7953a89202af8b246f0ef4ad7487ffe223a16", + "cb47c8eb0053184b7cffec7e33dd6fad606faa5f", "testharness" ], "user-timing/test_user_timing_measure_navigation_timing.html": [ - "d985098b8e5163756342f609dffa3ccf26d273b1", + "2d9655381b5537c6969115eda5045e3e9c0c57fd", "testharness" ], "web-animations/README.md": [ @@ -54625,7 +54726,7 @@ "testharness" ], "web-animations/animation-model/animation-types/property-list.js": [ - "d25c1e99f64a7dc2a883b7d1334bb2d37e657a0e", + "09135b91237467c4fbeeda3fd7b4d459a82ff4fb", "support" ], "web-animations/animation-model/animation-types/property-types.js": [
diff --git a/third_party/WebKit/LayoutTests/external/wpt/README.md b/third_party/WebKit/LayoutTests/external/wpt/README.md index 1461d07..5c1251f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/README.md +++ b/third_party/WebKit/LayoutTests/external/wpt/README.md
@@ -39,6 +39,9 @@ 0.0.0.0 nonexistent-origin.web-platform.test ``` +If you are behind a proxy, you also need to make sure the domains above are +excluded from your proxy lookups. + Because web-platform-tests uses git submodules, you must ensure that these are up to date. In the root of your checkout, run:
diff --git a/third_party/WebKit/LayoutTests/external/wpt/check_stability.py b/third_party/WebKit/LayoutTests/external/wpt/check_stability.py index 248c447f..2d1b8729 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/check_stability.py +++ b/third_party/WebKit/LayoutTests/external/wpt/check_stability.py
@@ -36,6 +36,7 @@ def do_delayed_imports(): + """Import and set up modules only needed if execution gets to this point.""" global BaseHandler global LogLevelFilter global StreamHandler @@ -52,6 +53,7 @@ def setup_logging(): + """Set up basic debug logger.""" handler = logging.StreamHandler(sys.stdout) formatter = logging.Formatter(logging.BASIC_FORMAT, None) handler.setFormatter(formatter) @@ -62,38 +64,57 @@ def setup_action_filter(): + """Create global LogActionFilter class as part of deferred module load.""" global LogActionFilter class LogActionFilter(BaseHandler): - """Handler that filters out messages with action of log and a level - lower than some specified level. + + """Handler that filters out messages not of a given set of actions. + + Subclasses BaseHandler. :param inner: Handler to use for messages that pass this filter - :param level: Minimum log level to process + :param actions: List of actions for which to fire the handler """ + def __init__(self, inner, actions): + """Extend BaseHandler and set inner and actions props on self.""" BaseHandler.__init__(self, inner) self.inner = inner self.actions = actions def __call__(self, item): + """Invoke handler if action is in list passed as constructor param.""" if item["action"] in self.actions: return self.inner(item) class TravisFold(object): + + """Context for TravisCI folding mechanism. Subclasses object. + + See: https://blog.travis-ci.com/2013-05-22-improving-build-visibility-log-folds/ + """ + def __init__(self, name): + """Register TravisCI folding section name.""" self.name = name def __enter__(self): + """Emit fold start syntax.""" print("travis_fold:start:%s" % self.name, file=sys.stderr) def __exit__(self, type, value, traceback): + """Emit fold end syntax.""" print("travis_fold:end:%s" % self.name, file=sys.stderr) class GitHub(object): + + """Interface for the GitHub API.""" + def __init__(self, org, repo, token, product): + """Set properties required for communicating with GH API on self.""" self.token = token self.headers = {"Accept": "application/vnd.github.v3+json"} self.auth = (self.token, "x-oauth-basic") @@ -103,6 +124,7 @@ self.product = product def _headers(self, headers): + """Extend existing HTTP headers and return new value.""" if headers is None: headers = {} rv = self.headers.copy() @@ -110,6 +132,7 @@ return rv def post(self, url, data, headers=None): + """Serialize and POST data to given URL.""" logger.debug("POST %s" % url) if data is not None: data = json.dumps(data) @@ -123,6 +146,7 @@ return resp def patch(self, url, data, headers=None): + """Serialize and PATCH data to given URL.""" logger.debug("PATCH %s" % url) if data is not None: data = json.dumps(data) @@ -136,6 +160,7 @@ return resp def get(self, url, headers=None): + """Execute GET request for given URL.""" logger.debug("GET %s" % url) resp = requests.get( url, @@ -146,6 +171,7 @@ return resp def post_comment(self, issue_number, body): + """Create or update comment in appropriate GitHub pull request comments.""" user = self.get(urljoin(self.base_url, "/user")).json() issue_comments_url = urljoin(self.base_url, "issues/%s/comments" % issue_number) comments = self.get(issue_comments_url).json() @@ -162,13 +188,21 @@ class GitHubCommentHandler(logging.Handler): + + """GitHub pull request comment handler. + + Subclasses logging.Handler to add ability to post comments to GitHub. + """ + def __init__(self, github, pull_number): + """Extend logging.Handler and set required properties on self.""" logging.Handler.__init__(self) self.github = github self.pull_number = pull_number self.log_data = [] def emit(self, record): + """Format record and add to log""" try: msg = self.format(record) self.log_data.append(msg) @@ -176,24 +210,36 @@ self.handleError(record) def send(self): + """Post log to GitHub and flush log.""" self.github.post_comment(self.pull_number, "\n".join(self.log_data)) self.log_data = [] class Browser(object): + + """Base browser class that sets a reference to a GitHub token.""" + product = None binary = None def __init__(self, github_token): + """Set GitHub token property on self.""" self.github_token = github_token class Firefox(Browser): + + """Firefox-specific interface. + + Includes installation, webdriver installation, and wptrunner setup methods. + """ + product = "firefox" binary = "%s/firefox/firefox" platform_ini = "%s/firefox/platform.ini" def install(self): + """Install Firefox.""" call("pip", "install", "-r", os.path.join(wptrunner_root, "requirements_firefox.txt")) resp = get("https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/firefox-53.0a1.en-US.linux-x86_64.tar.bz2") untar(resp.raw) @@ -206,6 +252,7 @@ call("pip", "install", "-r", os.path.join(wptrunner_root, "requirements_firefox.txt")) def _latest_geckodriver_version(self): + """Get and return latest version number for geckodriver.""" # This is used rather than an API call to avoid rate limits tags = call("git", "ls-remote", "--tags", "--refs", "https://github.com/mozilla/geckodriver.git") @@ -221,6 +268,7 @@ return "v%s.%s.%s" % tuple(str(item) for item in latest_release) def install_webdriver(self): + """Install latest Geckodriver.""" version = self._latest_geckodriver_version() logger.debug("Latest geckodriver release %s" % version) url = "https://github.com/mozilla/geckodriver/releases/download/%s/geckodriver-%s-linux64.tar.gz" % (version, version) @@ -237,6 +285,7 @@ platform_info.get("Build", "SourceStamp")) def wptrunner_args(self, root): + """Return Firefox-specific wpt-runner arguments.""" return { "product": "firefox", "binary": self.binary % root, @@ -247,16 +296,24 @@ class Chrome(Browser): + """Chrome-specific interface. + + Includes installation, webdriver installation, and wptrunner setup methods. + """ + product = "chrome" binary = "/usr/bin/google-chrome" def install(self): + """Install Chrome.""" + # Installing the Google Chrome browser requires administrative # privileges, so that installation is handled by the invoking script. call("pip", "install", "-r", os.path.join(wptrunner_root, "requirements_chrome.txt")) def install_webdriver(self): + """Install latest Webdriver.""" latest = get("http://chromedriver.storage.googleapis.com/LATEST_RELEASE").text.strip() url = "http://chromedriver.storage.googleapis.com/%s/chromedriver_linux64.zip" % latest unzip(get(url).raw) @@ -266,24 +323,20 @@ def version(self, root): """Retrieve the release version of the installed browser.""" output = call(self.binary, "--version") - return re.search(r"[0-9a-z\.]+$", output.strip()).group(0) + return re.search(r"[0-9\.]+( [a-z]+)?$", output.strip()).group(0) def wptrunner_args(self, root): + """Return Chrome-specific wpt-runner arguments.""" return { "product": "chrome", "binary": self.binary, - # Chrome's "sandbox" security feature must be disabled in order to - # run the browser in OpenVZ environments such as the one provided - # by TravisCI. - # - # Reference: https://github.com/travis-ci/travis-ci/issues/938 - "binary_arg": "--no-sandbox", "webdriver_binary": "%s/chromedriver" % root, "test_types": ["testharness", "reftest"] } def get(url): + """Issue GET request to a given URL and return the response.""" logger.debug("GET %s" % url) resp = requests.get(url, stream=True) resp.raise_for_status() @@ -291,6 +344,10 @@ def call(*args): + """Log terminal command, invoke it as a subprocess. + + Returns a bytestring of the subprocess output if no error. + """ logger.debug("%s" % " ".join(args)) try: return subprocess.check_output(args) @@ -302,6 +359,7 @@ def get_git_cmd(repo_path): + """Create a function for invoking git commands as a subprocess.""" def git(cmd, *args): full_cmd = ["git", cmd] + list(args) try: @@ -314,6 +372,7 @@ def seekable(fileobj): + """Attempt to use file.seek on given file, with fallbacks.""" try: fileobj.seek(fileobj.tell()) except Exception: @@ -323,6 +382,7 @@ def untar(fileobj): + """Extract tar archive.""" logger.debug("untar") fileobj = seekable(fileobj) with tarfile.open(fileobj=fileobj) as tar_data: @@ -330,6 +390,7 @@ def unzip(fileobj): + """Extract zip archive.""" logger.debug("unzip") fileobj = seekable(fileobj) with zipfile.ZipFile(fileobj) as zip_data: @@ -340,6 +401,10 @@ def setup_github_logging(args): + """Set up and return GitHub comment handler. + + :param args: the parsed arguments passed to the script + """ gh_handler = None if args.comment_pr: github = GitHub(args.user, "web-platform-tests", args.gh_token, args.product) @@ -358,6 +423,7 @@ class pwd(object): + """Create context for temporarily changing present working directory.""" def __init__(self, dir): self.dir = dir self.old_dir = None @@ -372,22 +438,26 @@ def fetch_wpt_master(user): + """Fetch the master branch via git.""" git = get_git_cmd(wpt_root) git("fetch", "https://github.com/%s/web-platform-tests.git" % user, "master:master") def get_sha1(): + """ Get and return sha1 of current git branch HEAD commit.""" git = get_git_cmd(wpt_root) return git("rev-parse", "HEAD").strip() def build_manifest(): + """Build manifest of all files in web-platform-tests""" with pwd(wpt_root): # TODO: Call the manifest code directly call("python", "manifest") def install_wptrunner(): + """Clone and install wptrunner.""" call("git", "clone", "--depth=1", "https://github.com/w3c/wptrunner.git", wptrunner_root) git = get_git_cmd(wptrunner_root) git("submodule", "update", "--init", "--recursive") @@ -395,11 +465,11 @@ def get_files_changed(): + """Get and return files changed since current branch diverged from master.""" root = os.path.abspath(os.curdir) git = get_git_cmd(wpt_root) branch_point = git("merge-base", "HEAD", "master").strip() logger.debug("Branch point from master: %s" % branch_point) - logger.debug(git("log", "--oneline", "%s.." % branch_point)) files = git("diff", "--name-only", "-z", "%s.." % branch_point) if not files: return [] @@ -409,6 +479,7 @@ def get_affected_testfiles(files_changed): + """Determine and return list of test files that reference changed files.""" affected_testfiles = set() nontests_changed = set(files_changed) manifest_file = os.path.join(wpt_root, "MANIFEST.json") @@ -464,6 +535,7 @@ def wptrunner_args(root, files_changed, iterations, browser): + """Derive and return arguments for wpt-runner.""" parser = wptcommandline.create_parser([browser.product]) args = vars(parser.parse_args([])) args.update(browser.wptrunner_args(root)) @@ -481,9 +553,15 @@ def setup_log_handler(): + """Set up LogHandler class as part of deferred module load.""" global LogHandler class LogHandler(reader.LogHandler): + + """Handle updating test and subtest status in log. + + Subclasses reader.LogHandler. + """ def __init__(self): self.results = defaultdict(lambda: defaultdict(lambda: defaultdict(int))) @@ -495,10 +573,12 @@ def is_inconsistent(results_dict, iterations): + """Return whether or not a single test is inconsistent.""" return len(results_dict) > 1 or sum(results_dict.values()) != iterations def err_string(results_dict, iterations): + """Create and return string with errors from test run.""" rv = [] total_results = sum(results_dict.values()) for key, value in sorted(results_dict.items()): @@ -513,6 +593,7 @@ def process_results(log, iterations): + """Process test log and return overall results and list of inconsistent tests.""" inconsistent = [] handler = LogHandler() reader.handle_log(reader.read(log), handler) @@ -540,6 +621,7 @@ def markdown_adjust(s): + """Escape problematic markdown sequences.""" s = s.replace('\t', u'\\t') s = s.replace('\n', u'\\n') s = s.replace('\r', u'\\r') @@ -548,6 +630,7 @@ def table(headings, data, log): + """Create and log data to specified logger in tabular format.""" cols = range(len(headings)) assert all(len(item) == len(cols) for item in data) max_widths = reduce(lambda prev, cur: [(len(cur[i]) + 2) @@ -564,6 +647,7 @@ def write_inconsistent(inconsistent, iterations): + """Output inconsistent tests to logger.error.""" logger.error("## Unstable results ##\n") strings = [("`%s`" % markdown_adjust(test), ("`%s`" % markdown_adjust(subtest)) if subtest else "", err_string(results, iterations)) for test, subtest, results in inconsistent] @@ -571,6 +655,7 @@ def write_results(results, iterations, comment_pr): + """Output all test results to logger.info.""" logger.info("## All results ##\n") for test, test_results in results.iteritems(): baseurl = "http://w3c-test.org/submissions" @@ -599,6 +684,7 @@ def get_parser(): + """Create and return script-specific argument parser.""" parser = argparse.ArgumentParser() parser.add_argument("--root", action="store", @@ -630,6 +716,7 @@ def main(): + """Perform check_stability functionality and return exit code.""" global wpt_root global wptrunner_root
diff --git a/third_party/WebKit/LayoutTests/external/wpt/ci_stability.sh b/third_party/WebKit/LayoutTests/external/wpt/ci_stability.sh index 725c0f0..eca9deb 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/ci_stability.sh +++ b/third_party/WebKit/LayoutTests/external/wpt/ci_stability.sh
@@ -25,6 +25,15 @@ deb_archive=google-chrome-${channel}_current_amd64.deb wget https://dl.google.com/linux/direct/$deb_archive + # If the environment provides an installation of Google Chrome, the + # existing binary may take precedence over the one introduced in this + # script. Remove any previously-existing "alternatives" prior to + # installation in order to ensure that the new binary is installed as + # intended. + if sudo update-alternatives --list google-chrome; then + sudo update-alternatives --remove-all google-chrome + fi + # Installation will fail in cases where the package has unmet dependencies. # When this occurs, attempt to use the system package manager to fetch the # required packages and retry.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/dom/events/ProgressEvent.html b/third_party/WebKit/LayoutTests/external/wpt/dom/events/ProgressEvent.html deleted file mode 100644 index dee0900..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/dom/events/ProgressEvent.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!doctype html> -<title>ProgressEvent constructor</title> -<script src=/resources/testharness.js></script> -<script src=/resources/testharnessreport.js></script> -<div id=log></div> -<script> -test(function() { - var ev = new ProgressEvent("test") - assert_equals(ev.type, "test") - assert_equals(ev.target, null) - assert_equals(ev.currentTarget, null) - assert_equals(ev.eventPhase, Event.NONE) - assert_equals(ev.bubbles, false) - assert_equals(ev.cancelable, false) - assert_equals(ev.defaultPrevented, false) - assert_equals(ev.isTrusted, false) - assert_true(ev.timeStamp > 0) - assert_true("initEvent" in ev) -}, "Default event values.") -</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/Node-isSameNode.html b/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/Node-isSameNode.html index 884fdd5..10c29f0 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/Node-isSameNode.html +++ b/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/Node-isSameNode.html
@@ -26,7 +26,7 @@ assert_false(element1.isSameNode(element2), "same properties"); assert_false(element1.isSameNode(null), "with null other node"); -}, "elements should be compared on reference"); +}, "elements should be compared on reference (namespaced element)"); test(function() { @@ -40,7 +40,7 @@ assert_false(element1.isSameNode(element2), "same properties"); assert_false(element1.isSameNode(null), "with null other node"); -}, "elements should be compared on reference"); +}, "elements should be compared on reference (namespaced attribute)"); test(function() {
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/browsers/browsing-the-web/history-traversal/browsing_context_name-0.html b/third_party/WebKit/LayoutTests/external/wpt/html/browsers/browsing-the-web/history-traversal/browsing_context_name-0.html new file mode 100644 index 0000000..5cbab71 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/browsers/browsing-the-web/history-traversal/browsing_context_name-0.html
@@ -0,0 +1,35 @@ +<iframe id="test"></iframe> +<script> +var opener = window.opener; +var t = opener.t; +var f = document.getElementById("test"); +var l = opener.document.getElementById("step_log"); + +log = function(t) {l.textContent += ("\n" + t)} +var navigated = false; +var steps = [ + () => f.src = "browsing_context_name-1.html", + () => { + navigated = true; + opener.assert_equals(f.contentWindow.name, "test", "Initial load"); + f.src = "browsing_context_name-2.html" + }, + () => { + opener.assert_equals(f.contentWindow.name, "test1"); + opener.assert_equals(history.length, 2); + history.back() + }, + () => { + opener.assert_equals(f.contentWindow.name, "test1", "After navigation"); + t.done(); + } +].map((x, i) => t.step_func(() => {log("Step " + (i+1)); x()})); + +next = () => steps.shift()(); + +onload = () => { + log("page load"); + f.onload = () => {log("iframe onload"); next()}; + setTimeout(next, 0); +}; +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/browsers/browsing-the-web/history-traversal/browsing_context_name-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/browsers/browsing-the-web/history-traversal/browsing_context_name-expected.txt new file mode 100644 index 0000000..807303c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/browsers/browsing-the-web/history-traversal/browsing_context_name-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Retaining window.name on history traversal assert_equals: expected 2 but got 1 +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/browsers/browsing-the-web/history-traversal/browsing_context_name.html b/third_party/WebKit/LayoutTests/external/wpt/html/browsers/browsing-the-web/history-traversal/browsing_context_name.html index 4dd9027..60a8acb 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/browsers/browsing-the-web/history-traversal/browsing_context_name.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/browsers/browsing-the-web/history-traversal/browsing_context_name.html
@@ -2,41 +2,12 @@ <title>Retaining window.name on history traversal</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<div id="log"></div> <pre id="step_log"></pre> -<iframe id="test"></iframe> + <script> - -var t = async_test(undefined, {timeout:10000}); -var f = document.getElementById("test"); -var l = document.getElementById("step_log"); -var navigated = false; - -log = function(t) {l.textContent += ("\n" + t)} - -var steps = [ - function() {f.src = "browsing_context_name-1.html"}, - function() { - navigated = true; - assert_equals(f.contentWindow.name, "test", "Initial load"); - setTimeout(next, 0); - }, - function() {f.src = "browsing_context_name-2.html"; setTimeout(next, 500)}, - function() { - assert_equals(f.contentWindow.name, "test1"); - setTimeout(next, 0); - }, - function() {history.back(); setTimeout(next, 500)}, - function() { - assert_equals(f.contentWindow.name, "test1", "After navigation"); - t.done(); - } -].map(function(x) {return t.step_func(function() {log("Step " + step); x()})}); - -var step = 0; -next = t.step_func(function() {steps[step++]()}); - -f.onload=next; - -onload = function() { setTimeout(next, 0); }; +var t = async_test(); +t.step(() => { + win = window.open("browsing_context_name-0.html"); + t.add_cleanup(() => win.close()); +}); </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions.html b/third_party/WebKit/LayoutTests/external/wpt/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions.html index 19e23b5..58c362a 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions.html
@@ -71,8 +71,12 @@ * Also tests for [[GetOwnProperty]] and [[HasOwnProperty]] behavior. */ +var whitelistedWindowIndices = ['0', '1']; var whitelistedWindowProps = ['location', 'postMessage', 'window', 'frames', 'self', 'top', 'parent', 'opener', 'closed', 'close', 'blur', 'focus', 'length']; +whitelistedWindowProps = whitelistedWindowProps.concat(whitelistedWindowIndices); +whitelistedWindowProps.sort(); + addTest(function() { for (var prop in window) { if (whitelistedWindowProps.indexOf(prop) != -1) { @@ -244,7 +248,7 @@ */ addTest(function() { - assert_array_equals(whitelistedWindowProps.sort(), Object.getOwnPropertyNames(C).sort(), + assert_array_equals(Object.getOwnPropertyNames(C).sort(), whitelistedWindowProps.sort(), "Object.getOwnPropertyNames() gives the right answer for cross-origin Window"); assert_array_equals(Object.getOwnPropertyNames(C.location).sort(), ['href', 'replace'], "Object.getOwnPropertyNames() gives the right answer for cross-origin Location");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/rendering/non-replaced-elements/tables/table-vspace-hspace-s.html b/third_party/WebKit/LayoutTests/external/wpt/html/rendering/non-replaced-elements/tables/table-vspace-hspace-s.html new file mode 100644 index 0000000..dae70b39 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/rendering/non-replaced-elements/tables/table-vspace-hspace-s.html
@@ -0,0 +1,15 @@ +<!doctype html> +<meta charset=utf-8> +<title>table vspace hspace (standards mode)</title> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<div>x</div> +<table vspace=25 hspace=25><tr><td>x</table> +<div>x</div> +<script> +var style = getComputedStyle(document.querySelector('table')); +['marginTop', 'marginRight', 'marginBottom', 'marginLeft'].forEach(function(m) { + assert_equals(style[m], '0px', m); +}); +done(); +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/rendering/non-replaced-elements/tables/table-vspace-hspace.html b/third_party/WebKit/LayoutTests/external/wpt/html/rendering/non-replaced-elements/tables/table-vspace-hspace.html new file mode 100644 index 0000000..9a95195 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/rendering/non-replaced-elements/tables/table-vspace-hspace.html
@@ -0,0 +1,15 @@ +<!-- quirks --> +<meta charset=utf-8> +<title>table vspace hspace (quirks mode)</title> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<div>x</div> <!-- prevent margin collapsing quirks --> +<table vspace=25 hspace=25><tr><td>x</table> +<div>x</div> <!-- prevent margin collapsing quirks --> +<script> +var style = getComputedStyle(document.querySelector('table')); +['marginTop', 'marginRight', 'marginBottom', 'marginLeft'].forEach(function(m) { + assert_equals(style[m], '0px', m); +}); +done(); +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img_border_percent-expected.xhtml b/third_party/WebKit/LayoutTests/external/wpt/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img_border_percent-expected.xhtml deleted file mode 100644 index 0050c54..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img_border_percent-expected.xhtml +++ /dev/null
@@ -1,9 +0,0 @@ -<html xmlns='http://www.w3.org/1999/xhtml'> -<head> -<title>IMG - Border in CSS</title> -</head> -<body> -<p><img src="../../../../../images/blue.png"/></p> -<p><img src="../../../../../images/blue.png" style="border-width:50px; border-style:solid;"/></p> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_perc-expected.xhtml b/third_party/WebKit/LayoutTests/external/wpt/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_perc-expected.xhtml deleted file mode 100644 index 6eaaa0b..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_perc-expected.xhtml +++ /dev/null
@@ -1,8 +0,0 @@ -<html xmlns='http://www.w3.org/1999/xhtml'> -<head> -<title>OBJECT - border in CSS</title> -</head> -<body> -<p><object data="../../../../images/blue.png" type="image/png" style="border-width:50px; border-style:solid;"></object></p> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_pixel-expected.xhtml b/third_party/WebKit/LayoutTests/external/wpt/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_pixel-expected.xhtml deleted file mode 100644 index 6eaaa0b..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_pixel-expected.xhtml +++ /dev/null
@@ -1,8 +0,0 @@ -<html xmlns='http://www.w3.org/1999/xhtml'> -<head> -<title>OBJECT - border in CSS</title> -</head> -<body> -<p><object data="../../../../images/blue.png" type="image/png" style="border-width:50px; border-style:solid;"></object></p> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/dynamic-append-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/dynamic-append-expected.txt index 6cf5b12..1c8b601 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/dynamic-append-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/dynamic-append-expected.txt
@@ -1,4 +1,4 @@ -CONSOLE ERROR: line 2448: Uncaught Error: assert_equals: expected "foo" but got "{\"error\": {\"message\": \"\", \"code\": 404}}" +CONSOLE ERROR: line 2451: Uncaught Error: assert_equals: expected "foo" but got "{\"error\": {\"message\": \"\", \"code\": 404}}" This is a testharness.js-based test. FAIL Meta refresh applies even when dynamically appended Uncaught Error: assert_equals: expected "foo" but got "{\"error\": {\"message\": \"\", \"code\": 404}}" Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-audio-element/audio_001-expected.htm b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-audio-element/audio_001-expected.htm deleted file mode 100644 index ef596449..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-audio-element/audio_001-expected.htm +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE HTML> -<html> -<head> - <title>HTML5 Media Elements: Content inside the 'audio' element is not shown to the user.</title> - <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> -</head> -<body> -<p>Test passes if there is no red.</p> -<div id='testcontent'> -</div> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-audio-element/audio_002-expected.htm b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-audio-element/audio_002-expected.htm deleted file mode 100644 index ef596449..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-audio-element/audio_002-expected.htm +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE HTML> -<html> -<head> - <title>HTML5 Media Elements: Content inside the 'audio' element is not shown to the user.</title> - <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> -</head> -<body> -<p>Test passes if there is no red.</p> -<div id='testcontent'> -</div> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-video-element/video_content_image-expected.htm b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-video-element/video_content_image-expected.htm deleted file mode 100644 index c02abb1..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-video-element/video_content_image-expected.htm +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE HTML> -<html> - <head> - <title>HTML5 Media Elements: Content inside the 'video' element is not shown to the user.</title> - <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> - </head> - <body> - <div id='testcontent'> - </div> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-video-element/video_content_text-expected.htm b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-video-element/video_content_text-expected.htm deleted file mode 100644 index c02abb1..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-video-element/video_content_text-expected.htm +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE HTML> -<html> - <head> - <title>HTML5 Media Elements: Content inside the 'video' element is not shown to the user.</title> - <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> - </head> - <body> - <div id='testcontent'> - </div> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/resetting-a-form/reset-form-event-realm-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/resetting-a-form/reset-form-event-realm-expected.txt new file mode 100644 index 0000000..60f194c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/resetting-a-form/reset-form-event-realm-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL reset()'s event must be fired in the Realm of the target assert_equals: the event must be created in the realm of the target expected function "function Function() { [native code] }" but got function "function Function() { [native code] }" +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/resetting-a-form/reset-form-event-realm-support.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/resetting-a-form/reset-form-event-realm-support.html new file mode 100644 index 0000000..f55c651 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/resetting-a-form/reset-form-event-realm-support.html
@@ -0,0 +1,3 @@ +<!DOCTYPE html> + +<form></form>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/resetting-a-form/reset-form-event-realm.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/resetting-a-form/reset-form-event-realm.html new file mode 100644 index 0000000..ad2cda3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/resetting-a-form/reset-form-event-realm.html
@@ -0,0 +1,38 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>reset() event firing realm</title> +<link rel="help" href="https://html.spec.whatwg.org/#resetting-a-form"> +<link rel="help" href="https://dom.spec.whatwg.org/#concept-event-fire"> +<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<iframe src="reset-form-event-realm-support.html"></iframe> +<iframe></iframe> + +<script> +"use strict"; + +async_test(t => { + window.onload = t.step_func_done(() => { + const frame0Form = frames[0].document.forms[0]; + const frame1Body = frames[1].document.body; + + frame1Body.appendChild(frame0Form); + + let resetCalled = false; + frame0Form.onreset = t.step_func(ev => { + resetCalled = true; + + const functionConstructorInEvRealm = ev.constructor.constructor; + const functionConstructorInFormRealm = frame0Form.constructor.constructor; + + assert_equals(functionConstructorInEvRealm, functionConstructorInFormRealm, + "the event must be created in the realm of the target"); + }); + + frame0Form.reset(); + assert_true(resetCalled, "The reset event handler must have been called"); + }); +}, "reset()'s event must be fired in the Realm of the target") +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/textfieldselection/selection-not-application-textarea.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/textfieldselection/selection-not-application-textarea.html index c17ad323..3116cd9 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/textfieldselection/selection-not-application-textarea.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/textfieldselection/selection-not-application-textarea.html
@@ -9,12 +9,21 @@ <script> test(function() { var el = document.createElement("textarea"); - assert_equals(el.selectionStart, 0); - assert_equals(el.selectionEnd, 0); + assert_equals(el.selectionStart, 0, "initial selectionStart"); + assert_equals(el.selectionEnd, 0, "initial selectionEnd"); + assert_equals(el.selectionDirection, "none", "initial selectionDirection"); + el.selectionStart = 1; el.selectionEnd = 1; el.selectionDirection = "forward"; + assert_equals(el.selectionStart, 1, "updated selectionStart"); + assert_equals(el.selectionEnd, 1, "updated selectionEnd"); + assert_equals(el.selectionDirection, "forward", "updated selectionDirection"); + el.setRangeText("foobar"); el.setSelectionRange(0, 1); + assert_equals(el.selectionStart, 0, "final selectionStart"); + assert_equals(el.selectionEnd, 1, "final selectionEnd"); + assert_equals(el.selectionDirection, "forward", "final selectionDirection"); }, "text field selection for the input textarea"); </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/time.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/time.html index eabb6cbd..ad4e38c 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/time.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/time.html
@@ -51,53 +51,116 @@ _StepTest.value = "12:00"; _StepTest.step = ""; _StepTest.stepUp(); - assert_equals(_StepTest.value,"12:01"); + assert_in_array( + _StepTest.value, + [ + "12:01", + "12:01:00", + "12:01:00.0", + "12:01:00.00", + "12:01:00.000"], + "a valid time string representing 1 minute after noon"); } , "stepUp step value empty on default step value "); test(function(){ _StepTest.value = "12:00"; _StepTest.step = ""; _StepTest.stepDown(); - assert_equals(_StepTest.value,"11:59"); + assert_in_array( + _StepTest.value, + [ + "11:59", + "11:59:00", + "11:59:00.0", + "11:59:00.00", + "11:59:00.000"], + "a valid time string representing 1 minute before noon"); }, "stepDown step value empty default step value"); test(function(){ _StepTest.value = "12:00"; _StepTest.step = "-600"; _StepTest.stepUp(); - assert_equals(_StepTest.value, "12:01"); + assert_in_array( + _StepTest.value, + [ + "12:01", + "12:01:00", + "12:01:00.0", + "12:01:00.00", + "12:01:00.000"], + "a valid time string representing 1 minute after noon"); },"stepUp on step value minus"); test(function(){ _StepTest.value = "12:00"; _StepTest.step = "-600"; _StepTest.stepDown(); - assert_equals(_StepTest.value, "11:59"); + assert_in_array( + _StepTest.value, + [ + "11:59", + "11:59:00", + "11:59:00.0", + "11:59:00.00", + "11:59:00.000"], + "a valid time string representing 1 minute before noon"); },"stepDown on step value minus"); test(function(){ _StepTest.value = "12:00"; _StepTest.step = "0"; _StepTest.stepUp(); - assert_equals(_StepTest.value, "12:01"); + assert_in_array( + _StepTest.value, + [ + "12:01", + "12:01:00", + "12:01:00.0", + "12:01:00.00", + "12:01:00.000"], + "a valid time string representing 1 minute after noon"); } , "stepUp on step value zero "); test(function(){ _StepTest.value = "12:00"; _StepTest.step = "0"; _StepTest.stepDown(); - assert_equals(_StepTest.value, "11:59"); + assert_in_array( + _StepTest.value, + [ + "11:59", + "11:59:00", + "11:59:00.0", + "11:59:00.00", + "11:59:00.000"], + "a valid time string representing 1 minute before noon"); } , "stepDown on step value zero "); test(function(){ _StepTest.value = "00:00"; _StepTest.step = "86399"; _StepTest.stepUp(); - assert_equals(_StepTest.value, "23:59:59"); + assert_in_array( + _StepTest.value, + [ + "23:59:59", + "23:59:59.0", + "23:59:59.00", + "23:59:59.000"], + "a valid time string representing 1 second before midnight"); } , "stepUp on step value 24 hour"); test(function(){ _StepTest.value = "23:59:59"; _StepTest.step = "86399"; _StepTest.stepDown(); - assert_equals(_StepTest.value, "00:00:00"); + assert_in_array( + _StepTest.value, + [ + "00:00", + "00:00:00", + "00:00:00.0", + "00:00:00.00", + "00:00:00.000"], + "a valid time string representing midnight"); } , "stepDown on step value 24 hour "); test(function(){
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-reflect-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-reflect-expected.txt new file mode 100644 index 0000000..c009d0a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-reflect-expected.txt
@@ -0,0 +1,13 @@ +This is a testharness.js-based test. +FAIL noModule IDL attribute on a parser created classic script element without nomodule content attribute assert_false: expected false got undefined +FAIL noModule IDL attribute on a parser created classic script element with nomodule content attribute assert_true: expected true got undefined +FAIL noModule IDL attribute on a parser created module script element without nomodule content attribute assert_false: expected false got undefined +FAIL noModule IDL attribute on a parser created module script element with nomodule content attribute assert_true: expected true got undefined +FAIL noModule IDL attribute on a dynamically created script element without nomodule content attribute assert_false: expected false got undefined +FAIL noModule IDL attribute on a dynamically created script element after nomodule content attribute is set to "nomodule" assert_true: expected true got undefined +FAIL noModule IDL attribute on a dynamically created script element after nomodule content attribute is set to "" assert_true: expected true got undefined +FAIL noModule IDL attribute on a dynamically created script element after nomodule content attribute had been removed assert_true: expected true got undefined +FAIL noModule IDL attribute must add nomodule content attribute on setting to true assert_true: expected true got false +FAIL noModule IDL attribute must remove nomodule content attribute on setting to false assert_false: expected false got true +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-reflect.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-reflect.html new file mode 100644 index 0000000..d6a850f5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-reflect.html
@@ -0,0 +1,75 @@ +<!DOCTYPE html> +<html> +<head> +<title>noModule IDL attribute must reflect nomodule content attribute</title> +<link rel="author" title="Yusuke Suzuki" href="mailto:utatane.tea@gmail.com"> +<link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +</head> +<body> +<script id="classicWithoutNomodule"></script> +<script id="classicWithNomodule" nomodule></script> +<script id="moduleWithoutNomodule" type=module></script> +<script id="moduleWithNomodule" type=module nomodule></script> +<script> + +test(() => { + assert_false(document.getElementById('classicWithoutNomodule').noModule); +}, 'noModule IDL attribute on a parser created classic script element without nomodule content attribute'); + +test(() => { + assert_true(document.getElementById('classicWithNomodule').noModule); +}, 'noModule IDL attribute on a parser created classic script element with nomodule content attribute'); + +test(() => { + assert_false(document.getElementById('moduleWithoutNomodule').noModule); +}, 'noModule IDL attribute on a parser created module script element without nomodule content attribute'); + +test(() => { + assert_true(document.getElementById('moduleWithNomodule').noModule); +}, 'noModule IDL attribute on a parser created module script element with nomodule content attribute'); + + +test(() => { + const script = document.createElement('script'); + assert_false(script.noModule); +}, 'noModule IDL attribute on a dynamically created script element without nomodule content attribute'); + +test(() => { + const script = document.createElement('script'); + script.setAttribute('nomodule', 'nomodule'); + assert_true(script.noModule); +}, 'noModule IDL attribute on a dynamically created script element after nomodule content attribute is set to "nomodule"'); + +test(() => { + const script = document.createElement('script'); + script.setAttribute('nomodule', ''); + assert_true(script.noModule); +}, 'noModule IDL attribute on a dynamically created script element after nomodule content attribute is set to ""'); + +test(() => { + const script = document.createElement('script'); + script.setAttribute('nomodule', 'nomodule'); + assert_true(script.noModule); + script.removeAttribute('nomodule'); + assert_false(script.noModule); +}, 'noModule IDL attribute on a dynamically created script element after nomodule content attribute had been removed'); + +test(() => { + const script = document.createElement('script'); + assert_false(script.hasAttribute('nomodule')); + script.noModule = true; + assert_true(script.hasAttribute('nomodule')); +}, 'noModule IDL attribute must add nomodule content attribute on setting to true'); + +test(() => { + const script = document.createElement('script'); + script.setAttribute('nomodule', 'nomodule'); + script.noModule = false; + assert_false(script.hasAttribute('nomodule')); +}, 'noModule IDL attribute must remove nomodule content attribute on setting to false'); + +</script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-async-classic-script-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-async-classic-script-expected.txt new file mode 100644 index 0000000..3390614 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-async-classic-script-expected.txt
@@ -0,0 +1,5 @@ +This is a testharness.js-based test. +PASS An asynchronously loaded classic script with noModule set to false must run +FAIL An asynchronously loaded classic script with noModule set to true must not run assert_false: expected false got true +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-async-classic-script.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-async-classic-script.html new file mode 100644 index 0000000..26eefed6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-async-classic-script.html
@@ -0,0 +1,66 @@ +<!DOCTYPE html> +<html> +<head> +<title>External classic scripts with nomodule content attribute must not run</title> +<link rel="author" title="Yusuke Suzuki" href="mailto:utatane.tea@gmail.com"> +<link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<!-- Load this script synchronously to ensure test cases below can load it in 200ms --> +<script src="resources/set-script-executed.js"></script> +</head> +<body> +<script> + +waitForLoadEvent = new Promise((resolve) => { + window.onload = resolve; +}); + +waitForAsyncScript = () => { + return new Promise((resolve) => { + waitForLoadEvent.then(() => setTimeout(resolve, 200)); + }); +} + +let readyForSecondTest; +promise_test(() => { + window.executed = false; + let loaded = false; + let errored = false; + + let script = document.createElement('script'); + script.src = './resources/set-script-executed.js'; + script.onload = () => loaded = true; + script.onerror = () => errored = true; + script.noModule = false; + document.body.appendChild(script); + + return waitForAsyncScript().then(() => { + assert_true(executed); + assert_true(loaded); + assert_false(errored); + }); +}, 'An asynchronously loaded classic script with noModule set to false must run'); + +promise_test(() => { + window.executed = false; + let loaded = false; + let errored = false; + + let script = document.createElement('script'); + script.src = './resources/set-script-executed.js'; + script.onload = () => loaded = true; + script.onerror = () => errored = true; + script.noModule = true; + document.body.appendChild(script); + + return waitForAsyncScript().then(() => { + assert_false(executed); + assert_false(loaded); + assert_false(errored); + }); +}, 'An asynchronously loaded classic script with noModule set to true must not run'); + +</script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-external-module-script-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-external-module-script-expected.txt new file mode 100644 index 0000000..82b38ac --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-external-module-script-expected.txt
@@ -0,0 +1,6 @@ +CONSOLE ERROR: line 1: Uncaught SyntaxError: Unexpected token import +This is a testharness.js-based test. +Harness Error. harness_status.status = 1 , harness_status.message = Uncaught SyntaxError: Unexpected token import +FAIL An external module script with nomodule content attribute must run assert_equals: expected "object" but got "undefined" +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-external-module-script.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-external-module-script.html new file mode 100644 index 0000000..138b33c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-external-module-script.html
@@ -0,0 +1,28 @@ +<!DOCTYPE html> +<html> +<head> +<title>An external module script with nomodule must run</title> +<link rel="author" title="Yusuke Suzuki" href="mailto:utatane.tea@gmail.com"> +<link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +</head> +<body> +<script nomodule type="module" src="./resources/exports-cocoa.js"></script> +<script> + +waitForLoadEvent = new Promise((resolve) => { + window.onload = resolve; +}); + +promise_test(() => { + return waitForLoadEvent.then(() => { + assert_equals(typeof cocoa, 'undefined'); + assert_equals(typeof exportedCocoa, 'object'); + assert_equals(exportedCocoa.taste(), 'awesome'); + }); +}, 'An external module script with nomodule content attribute must run'); + +</script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-inline-classic-scripts-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-inline-classic-scripts-expected.txt new file mode 100644 index 0000000..b0b9aa143 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-inline-classic-scripts-expected.txt
@@ -0,0 +1,7 @@ +This is a testharness.js-based test. +PASS An inline classic script without nomodule content attribute must run +FAIL An inline classic script with nomodule content attribute must not run assert_false: expected false got true +PASS An inline classic script element dynamically inserted after noModule was set to false must run. +FAIL An inline classic script element dynamically inserted after noModule was set to true must not run. assert_false: expected false got true +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-inline-classic-scripts.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-inline-classic-scripts.html new file mode 100644 index 0000000..588d5997 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-inline-classic-scripts.html
@@ -0,0 +1,56 @@ +<!DOCTYPE html> +<html> +<head> +<title>Inline classic scripts with nomodule content attribute must not run</title> +<link rel="author" title="Yusuke Suzuki" href="mailto:utatane.tea@gmail.com"> +<link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +</head> +<body> +<script> +window.executed = true; +</script> +<script> + +test(() => { + assert_true(executed); +}, 'An inline classic script without nomodule content attribute must run'); + + +window.executed = false; +</script> +<script nomodule> +window.executed = true; +</script> +<script> + +test(() => { + assert_false(executed); +}, 'An inline classic script with nomodule content attribute must not run'); + +</script> +<script> + +test(() => { + window.executed = false; + const element = document.createElement("script"); + element.noModule = false; + element.textContent = `window.executed = true`; + document.body.appendChild(element); + assert_true(window.executed); +}, 'An inline classic script element dynamically inserted after noModule was set to false must run.'); + +test(() => { + window.executed = false; + const element = document.createElement("script"); + element.noModule = true; + element.textContent = `window.executed = true`; + document.body.appendChild(element); + assert_false(window.executed); +}, 'An inline classic script element dynamically inserted after noModule was set to true must not run.'); + +window.executed = false; +</script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-inline-module-script-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-inline-module-script-expected.txt new file mode 100644 index 0000000..9f8616c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-inline-module-script-expected.txt
@@ -0,0 +1,6 @@ +CONSOLE ERROR: line 12: Uncaught SyntaxError: Unexpected token import +This is a testharness.js-based test. +Harness Error. harness_status.status = 1 , harness_status.message = Uncaught SyntaxError: Unexpected token import +FAIL An inline module script with nomodule content attribute must run assert_equals: expected "object" but got "undefined" +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-inline-module-script.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-inline-module-script.html new file mode 100644 index 0000000..b11c25932 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-inline-module-script.html
@@ -0,0 +1,32 @@ +<!DOCTYPE html> +<html> +<head> +<title>An inline module script with nomodule must run</title> +<link rel="author" title="Yusuke Suzuki" href="mailto:utatane.tea@gmail.com"> +<link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +</head> +<body> +<script nomodule type="module"> +import Cocoa from "./resources/cocoa-module.js"; +var cocoa = new Cocoa(); +window.exportedCocoa = cocoa; +</script> +<script> + +waitForLoadEvent = new Promise((resolve) => { + window.onload = resolve; +}); + +promise_test(() => { + return waitForLoadEvent.then(() => { + assert_equals(typeof cocoa, 'undefined'); + assert_equals(typeof exportedCocoa, 'object'); + assert_equals(exportedCocoa.taste(), 'awesome'); + }); +}, 'An inline module script with nomodule content attribute must run'); + +</script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-synchronously-loaded-classic-scripts-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-synchronously-loaded-classic-scripts-expected.txt new file mode 100644 index 0000000..dcb5fc4b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-synchronously-loaded-classic-scripts-expected.txt
@@ -0,0 +1,5 @@ +This is a testharness.js-based test. +PASS A synchronously loaded external classic script without nomodule content attribute must run +FAIL A synchronously loaded external classic script with nomodule content attribute must not run assert_false: expected false got true +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-synchronously-loaded-classic-scripts.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-synchronously-loaded-classic-scripts.html new file mode 100644 index 0000000..83c3c5a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/nomodule-set-on-synchronously-loaded-classic-scripts.html
@@ -0,0 +1,46 @@ +<!DOCTYPE html> +<html> +<head> +<title>External classic scripts with nomodule content attribute must not run</title> +<link rel="author" title="Yusuke Suzuki" href="mailto:utatane.tea@gmail.com"> +<link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +</head> +<body> +<script> + +window.executed = false; +window.loaded = false; +window.errored = false; +</script> +<script src="./resources/set-script-executed.js" onload="loaded = true" onerror="errored = false"></script> +<script> + +test(() => { + assert_true(executed); + assert_true(loaded); + assert_false(errored); +}, 'A synchronously loaded external classic script without nomodule content attribute must run'); + +window.executed = false; +window.loaded = false; +window.errored = false; +</script> +<script nomodule src="./resources/set-script-executed.js" onload="loaded = true" onerror="errored = false"></script> +<script> + +test(() => { + assert_false(executed); + assert_false(loaded); + assert_false(errored); +}, 'A synchronously loaded external classic script with nomodule content attribute must not run'); + + +waitForLoadEvent = new Promise((resolve) => { + window.onload = resolve; +}); + +</script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/resources/cocoa-module.js b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/resources/cocoa-module.js new file mode 100644 index 0000000..24360a7b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/resources/cocoa-module.js
@@ -0,0 +1,5 @@ +export default class Cocoa { + taste() { + return "awesome"; + } +};
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/resources/exports-cocoa.js b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/resources/exports-cocoa.js new file mode 100644 index 0000000..02967bc --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/resources/exports-cocoa.js
@@ -0,0 +1,3 @@ +import Cocoa from "./cocoa-module.js"; +var cocoa = new Cocoa(); +window.exportedCocoa = cocoa;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/resources/set-script-executed.js b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/resources/set-script-executed.js new file mode 100644 index 0000000..a609509 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/resources/set-script-executed.js
@@ -0,0 +1 @@ +window.executed = true;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-001.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-001.html new file mode 100644 index 0000000..fc310f4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-001.html
@@ -0,0 +1,12 @@ +<!DOCTYPE html> + <title>Template Test: check that template content is invisible by default</title> + <link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru"> + <link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#css-additions"> + <meta name="assert" content="Test checks that the template contents are hidden implicitly"> + <link rel="match" href="css-user-agent-style-sheet-test-001-ref.html"> +<body> + <p>Test passes if there's no anything below this line.</p> + <template> + <span style="color:red">Test fails if you can see this text</span> + </template> +</body>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-002.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-002.html new file mode 100644 index 0000000..92f3d81 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-002.html
@@ -0,0 +1,12 @@ +<!DOCTYPE html> + <title>Template Test: check that template content is invisible by default</title> + <link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru"> + <link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#css-additions"> + <meta name="assert" content="The template element itself must be hidden by default"> + <link rel="match" href="css-user-agent-style-sheet-test-001-ref.html"> +<body> + <p>Test passes if there's no anything below this line.</p> + <template style="border: 1px solid; width: 100px; height: 100px"> + <span style="color:red">Test fails if you can see this text or border around it</span> + </template> +</body>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-003.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-003.html new file mode 100644 index 0000000..4c477fd --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-003.html
@@ -0,0 +1,19 @@ +<!DOCTYPE html> + <title>HTML Templates: template content is invisible by default</title> + <link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru"> + <link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#css-additions"> + <meta name="assert" content="The template element itself must be hidden by default"> + <link rel="match" href="css-user-agent-style-sheet-test-001-ref.html"> + <style> + template { + border: 1px solid; + width: 100px; + height: 100px; + } + </style> +<body> + <p>Test passes if there's no anything below this line.</p> + <template> + <span style="color:red">Test fails if you can see this text or border around it</span> + </template> +</body>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/tabular-data/the-table-element/caption-methods-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/tabular-data/the-table-element/caption-methods-expected.txt new file mode 100644 index 0000000..72af55d --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/tabular-data/the-table-element/caption-methods-expected.txt
@@ -0,0 +1,15 @@ +This is a testharness.js-based test. +PASS createCaption method creates new caption if existing caption is not in html namespace +PASS createCaption method returns the first caption element child of the table +PASS createCaption method creates a new caption and inserts it as the first node of the table element +PASS createCaption will not create new caption if one exists +PASS createCaption will not copy table's prefix +PASS deleteCaption method removes the first caption element child of the table element +PASS deleteCaption method not remove caption that is not in html namespace +PASS Setting caption rethrows exception +PASS Assigning a caption to table.caption +FAIL Assigning null to table.caption Failed to set the 'caption' property on 'HTMLTableElement': The new child element is null. +PASS Assigning a non-caption to table.caption +PASS Assigning a foreign caption to table.caption +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/tabular-data/the-table-element/caption-methods.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/tabular-data/the-table-element/caption-methods.html index 35ee9f4..0f576ce 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/tabular-data/the-table-element/caption-methods.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/tabular-data/the-table-element/caption-methods.html
@@ -1,6 +1,7 @@ <!DOCTYPE HTML> <html> <head> + <meta charset="utf-8"> <title>Creating and deleting captions</title> <link rel="author" title="Erika Navara" href="mailto:edoyle@microsoft.com"> <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-table-element" /> @@ -38,6 +39,22 @@ </table> <table id="table5" style="display:none"> </table> + <table id="table6" style="display:none"> + <caption id="caption6">caption 6</caption> + <tr> + <td>cell</td> + <td>cell</td> + </tr> + </table> + <table id="table7" style="display:none"> + <caption id="caption7">caption 7</caption> + <tbody id="tbody7"> + <tr> + <td>cell</td> + <td>cell</td> + </tr> + </tbody> + </table> <script> test(function () { var table0 = document.getElementById('table0'); @@ -48,34 +65,40 @@ assert_not_equals(testCaption, table0FirstNode); assert_equals(testCaption, table0.firstChild); }, "createCaption method creates new caption if existing caption is not in html namespace") + test(function () { var table1 = document.getElementById('table1'); var testCaption = table1.createCaption(); var table1FirstCaption = table1.caption; assert_equals(testCaption, table1FirstCaption); }, "createCaption method returns the first caption element child of the table") + test(function () { var table2 = document.getElementById('table2'); var test2Caption = table2.createCaption(); var table2FirstNode = table2.firstChild; - assert_true(test2Caption instanceof HTMLTableCaptionElement); + assert_true(test2Caption instanceof HTMLTableCaptionElement); assert_equals(table2FirstNode, test2Caption); }, "createCaption method creates a new caption and inserts it as the first node of the table element") + test(function () { var table = document.createElement('table'); assert_equals(table.createCaption(), table.createCaption()); }, "createCaption will not create new caption if one exists") + test(function () { var table = document.createElementNS("http://www.w3.org/1999/xhtml", "foo:table") var caption = table.createCaption(); assert_equals(caption.prefix, null); }, "createCaption will not copy table's prefix") + test(function () { var table3 = document.getElementById('table3'); assert_equals(table3.caption.textContent, "caption 3"); table3.deleteCaption(); assert_equals(table3.caption, null); }, "deleteCaption method removes the first caption element child of the table element") + test(function () { var table4 = document.getElementById('table4'); var caption = document.createElementNS("foo", "caption"); @@ -83,6 +106,7 @@ table4.deleteCaption(); assert_equals(caption.parentNode, table4); }, "deleteCaption method not remove caption that is not in html namespace") + test(function() { var table5 = document.getElementById('table5'); var caption = document.createElement('caption'); @@ -95,6 +119,45 @@ assert_not_equals(table5.caption, caption); }, "Setting caption rethrows exception"); + + test(function() { + var table6 = document.getElementById("table6"); + var caption = document.getElementById("caption6"); + assert_equals(table6.caption, caption); + + var newCaption = document.createElement("caption"); + table6.caption = newCaption; + assert_equals(newCaption.parentNode, table6); + assert_equals(table6.firstChild, newCaption); + assert_equals(table6.caption, newCaption); + }, "Assigning a caption to table.caption") + + test(function() { + var table7 = document.getElementById("table7"); + var caption = document.getElementById("caption7"); + assert_equals(table7.caption, caption); + + table7.caption = null; + assert_equals(caption.parentNode, null); + assert_equals(table7.firstElementChild, document.getElementById("tbody7")); + assert_equals(table7.caption, null); + }, "Assigning null to table.caption") + + test(function() { + var table8 = document.createElement("table"); + var caption = document.createElement("captİon"); + assert_throws(new TypeError(), function() { + table8.caption = caption; + }); + }, "Assigning a non-caption to table.caption") + + test(function() { + var table9 = document.createElement("table"); + var caption = document.createElementNS("http://www.example.com", "caption"); + assert_throws(new TypeError(), function() { + table9.caption = caption; + }); + }, "Assigning a foreign caption to table.caption") </script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/webappapis/idle-callbacks/callback-timeout.html b/third_party/WebKit/LayoutTests/external/wpt/html/webappapis/idle-callbacks/callback-timeout.html index 823d5f5..cc2660a 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/webappapis/idle-callbacks/callback-timeout.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/webappapis/idle-callbacks/callback-timeout.html
@@ -25,4 +25,19 @@ } window.requestIdleCallback(t.step_func(f)); }, "requestIdleCallback callback should time out"); + + async_test(function (t) { + assert_false(document.hidden, "document.hidden must exist and be false to run this test properly"); + function g(deadline) { + assert_false(deadline.didTimeout) + t.done(); + } + + function f(deadline) { + assert_false(deadline.didTimeout); + window.requestIdleCallback(t.step_func(g), {timeout:100000}); + } + window.requestIdleCallback(t.step_func(f)); + }, "requestIdleCallback callback should not time out"); + </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/webappapis/scripting/events/eventhandler-cancellation.html b/third_party/WebKit/LayoutTests/external/wpt/html/webappapis/scripting/events/eventhandler-cancellation.html new file mode 100644 index 0000000..6be581fa --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/webappapis/scripting/events/eventhandler-cancellation.html
@@ -0,0 +1,76 @@ +<!doctype html> +<meta charset=utf-8> +<title></title> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<!-- A window to work with that won't trigger the harness exception detection + when we fire "error" events at it --> +<iframe style="display: none"></iframe> +<script> + test(function() { + var blob = new Blob([""]); + // Most targets disabled for now until + // https://github.com/whatwg/html/issues/2296 is sorted out. + var targets = [ frames[0] /*, document, document.documentElement, + new Worker(URL.createObjectURL(blob) */ ]; + // Event constructors also mostly disabled until + // https://github.com/whatwg/html/issues/2296 is sorted out. + var eventCtors = [ /* Event, */ ErrorEvent /*, MouseEvent */ ]; + var values = [true, false, "", "abc", {}, 0, 1, -1, null, undefined, + 2.5, NaN, Infinity, Symbol.toStringTag ]; + // Event types also mostly disabled pending + // https://github.com/whatwg/html/issues/2296 + var eventTypes = [ "error"/*, "click", "load"*/ ]; + + // Variables that keep track of which subtest we're running. + var curTarget; + var curValue; + var curCtor; + var curType; + + function defaultPreventedTester(event) { + var expectedValue; + if (curTarget === frames[0] && + curCtor === ErrorEvent && + curValue === true && + curType == "error") { + expectedValue = true; + } else { + // This will need adjusting once we allow more targets and event + // constructors above! + expectedValue = false; + } + var valueRepr; + if (typeof curValue == "string") { + valueRepr = '"' + curValue + '"'; + } else { + valueRepr = String(curValue); + } + test(function() { + assert_equals(event.defaultPrevented, expectedValue); + }, "Returning " + valueRepr + + " from " + String(curTarget) + "'s on" + curType + + " event handler while " + curCtor.name + + " is firing should" + + (expectedValue ? "" : " not") + + " cancel the event"); + } + + for (curCtor of eventCtors) { + for (curTarget of targets) { + for (curType of eventTypes) { + for (curValue of values) { + // We have to make sure that defaultPreventedTester is added after + // our event handler. + curTarget["on" + curType] = function() { return curValue; } + curTarget.addEventListener(curType, defaultPreventedTester); + var e = new curCtor(curType, { cancelable: true }); + curTarget.dispatchEvent(e); + curTarget["on" + curType] = null; + curTarget.removeEventListener(curType, defaultPreventedTester); + } + } + } + } + }, "event handler cancellation behavior"); +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/resources/idlharness.js b/third_party/WebKit/LayoutTests/external/wpt/resources/idlharness.js index da77fe7..a52228e 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/resources/idlharness.js +++ b/third_party/WebKit/LayoutTests/external/wpt/resources/idlharness.js
@@ -1384,7 +1384,7 @@ if (isPairIterator) { test(function() { - assert_equals(self[interfaceName].prototype["entries"], self[interfaceName].prototype[Symbol.iterator], "entries method is not the same as @@iterator"); + assert_equals(self[interfaceName].prototype[Symbol.iterator], self[interfaceName].prototype["entries"], "entries method is not the same as @@iterator"); }, "Testing pair iterable interface " + interfaceName); } else { test(function() {
diff --git a/third_party/WebKit/LayoutTests/external/wpt/resources/testharness.js b/third_party/WebKit/LayoutTests/external/wpt/resources/testharness.js index a6e7913..20318b0b 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/resources/testharness.js +++ b/third_party/WebKit/LayoutTests/external/wpt/resources/testharness.js
@@ -527,12 +527,14 @@ tests.promise_tests = Promise.resolve(); } tests.promise_tests = tests.promise_tests.then(function() { + var donePromise = new Promise(function(resolve) { + test.add_cleanup(resolve); + }); var promise = test.step(func, test, test); test.step(function() { assert_not_equals(promise, undefined); }); - return Promise.resolve(promise) - .then( + Promise.resolve(promise).then( function() { test.done(); }) @@ -544,6 +546,7 @@ assert(false, "promise_test", null, "Unhandled rejection with value: ${value}", {value:value}); })); + return donePromise; }); }
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/extendable-event-async-waituntil.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/extendable-event-async-waituntil.https-expected.txt index 0ea8446..a9b79e8 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/extendable-event-async-waituntil.https-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/extendable-event-async-waituntil.https-expected.txt
@@ -5,6 +5,7 @@ PASS Test calling waitUntil with an existing extension promise handler succeeds FAIL Test calling waitUntil at the end of the microtask turn throws assert_unreached: unexpected rejection: assert_equals: expected "InvalidStateError" but got "OK" Reached unreachable code PASS Test calling waitUntil after the current extension expired in a different task fails +FAIL Test calling waitUntil on a script constructed ExtendableEvent throws exception assert_unreached: unexpected rejection: assert_equals: expected "InvalidStateError" but got "OK" Reached unreachable code FAIL Test calling waitUntil asynchronously with pending respondWith promise. assert_unreached: unexpected rejection: assert_equals: expected "OK" but got "InvalidStateError" Reached unreachable code Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/extendable-event-async-waituntil.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/extendable-event-async-waituntil.https.html index 783a712e..a5b64309 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/extendable-event-async-waituntil.https.html +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/extendable-event-async-waituntil.https.html
@@ -73,6 +73,9 @@ async_test(msg_event_test.bind(this, 'current-extension-expired-different-task'), 'Test calling waitUntil after the current extension expired in a different task fails'); +async_test(msg_event_test.bind(this, 'script-extendable-event'), + 'Test calling waitUntil on a script constructed ExtendableEvent throws exception'); + async_test(function(t) { var testBody = function(worker) { return with_iframe('./resources/pending-respondwith-async-waituntil/dummy.html');
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-event.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-event.https-expected.txt index df334520..9790584 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-event.https-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-event.https-expected.txt
@@ -2,7 +2,7 @@ PASS Service Worker responds to fetch event with string PASS Service Worker responds to fetch event with blob body PASS Service Worker responds to fetch event with the referrer URL -FAIL Service Worker responds to fetch event with the referrer URL assert_unreached: unexpected rejection: assert_equals: Service Worker should respond to fetch with the referrer URL when a member of RequestInit is present expected "Referrer: https://web-platform.test:8444/service-workers/service-worker/resources/simple.html?referrerPolicy\nReferrerPolicy: no-referrer-when-downgrade" but got "Referrer: https://web-platform.test:8444/service-workers/service-worker/resources/undefined\nReferrerPolicy: no-referrer-when-downgrade" Reached unreachable code +FAIL Service Worker responds to fetch event with the referrer policy assert_unreached: unexpected rejection: assert_equals: Service Worker should respond to fetch with the referrer URL when a member of RequestInit is present expected "Referrer: https://web-platform.test:8444/service-workers/service-worker/resources/simple.html?referrerPolicy\nReferrerPolicy: no-referrer-when-downgrade" but got "Referrer: https://web-platform.test:8444/service-workers/service-worker/resources/undefined\nReferrerPolicy: no-referrer-when-downgrade" Reached unreachable code PASS Service Worker responds to fetch event with an existing client id PASS Service Worker does not respond to fetch event PASS Service Worker responds to fetch event with null response body
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-event.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-event.https.html index 6f8618b..26409e9 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-event.https.html +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-event.https.html
@@ -322,7 +322,7 @@ return service_worker_unregister_and_done(t, scope); }) .catch(unreached_rejection(t)); - }, 'Service Worker responds to fetch event with the referrer URL'); + }, 'Service Worker responds to fetch event with the referrer policy'); async_test(function(t) { var scope = 'resources/simple.html?clientId';
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-frame-resource.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-frame-resource.https.html index cc1dac4..fd74198 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-frame-resource.https.html +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-frame-resource.https.html
@@ -110,7 +110,8 @@ frame.src = scope + '?mode=cors&url=' + encodeURIComponent(host_info['HTTPS_REMOTE_ORIGIN'] + path + - '?ACAOrigin=' + host_info['HTTPS_ORIGIN']); + '?ACAOrigin=' + host_info['HTTPS_ORIGIN'] + + '&ACACredentials=true'); document.body.appendChild(frame); return getLoadedFrameAsObject(frame); }) @@ -183,7 +184,8 @@ var win = window.open( scope + '?mode=cors&url=' + encodeURIComponent(host_info['HTTPS_REMOTE_ORIGIN'] + path + - '?ACAOrigin=' + host_info['HTTPS_ORIGIN'])); + '?ACAOrigin=' + host_info['HTTPS_ORIGIN'] + + '&ACACredentials=true')); return getLoadedWindowAsObject(win); }) .then(function(result) {
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/registration-useCache.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/registration-useCache.https.html new file mode 100644 index 0000000..1976fa11 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/registration-useCache.https.html
@@ -0,0 +1,223 @@ +<!DOCTYPE html> +<title>Service Worker: Registration-useCache</title> +<script src="/resources/testharness.js"></script> +<script src="resources/testharness-helpers.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="resources/test-helpers.sub.js"></script> +<script> + +function registerFirstServiceWorker(test, script, scope, useCache) { + var swr, sw; + + var setting = {scope: scope}; + if (useCache !== undefined) { + setting['useCache'] = useCache; + } + + return Promise.resolve() + .then(() => navigator.serviceWorker.register(script, setting)) + .then(registration => swr = registration) + + .then(() => wait_for_update(test, swr)) + .then(worker => sw = worker) + + .then(() => getMessageFromServiceWorker(sw, 'normal')) + .then(() => wait_for_state(test, sw, 'activated')) + .then(() => assert_true((!!swr.active && + !swr.waiting && + !swr.installing), + ('The active SW should be the only SW. ' + + '(a: ' + !!swr.active + + ',w: ' + !swr.waiting + + ',i: ' + !swr.installing + ')'))) + .then(() => swr); +} + +function getMessageFromServiceWorker(sw, httpRequestType, oldValues) { + var mainResolveFunction, importedResolveFunction; + var promises = [ + new Promise(function(resolve) {mainResolveFunction = resolve}), + new Promise(function(resolve) {importedResolveFunction = resolve}) + ]; + + var messageChannel = new MessageChannel(); + messageChannel.port1.onmessage = e => { + if (httpRequestType) { + assert_equals(e.data.type, httpRequestType, + "HTTP request type check."); + } + + var compareOldValue = (httpRequestType === 'revalidate') && oldValues; + switch(e.data.from) { + case 'main': + if (compareOldValue) { + assert_not_equals(e.data.value, oldValues[0], + 'Values shouldn\'t be the same'); + } + mainResolveFunction(e.data.value); + break; + case 'imported': + if (compareOldValue) { + assert_not_equals(e.data.value, oldValues[1], + 'Values shouldn\'t be the same'); + } + importedResolveFunction(e.data.value); + break; + } + }; + + sw.postMessage({port: messageChannel.port2}, [messageChannel.port2]); + return Promise.all(promises); +} + +function testAction(test, registration, action, shouldCreateSW) { + var testFunction = shouldCreateSW ? testActionDoesCreateSW + : testActionDoesNotCreateSW; + + return Promise.resolve() + .then(() => testFunction(registration, action, test)) + .then(() => registration); +} + +function testActionDoesCreateSW(registration, action, test) { + var oldValues; + + return Promise.resolve() + .then(() => getMessageFromServiceWorker(registration.active)) + .then(values => oldValues = values) + + .then(() => action()) + .then(() => wait_for_update(test, registration)) + .then(worker => getMessageFromServiceWorker(worker, + 'revalidate', + oldValues)); +} + +function testActionDoesNotCreateSW(registration, action) { + return Promise.resolve() + .then(() => action()) + .then(() => assert_true((!!registration.active && + !registration.waiting && + !registration.installing), + ('The active SW should still be the only SW. ' + + '(a: ' + !!registration.active + + ',w: ' + !registration.waiting + + ',i: ' + !registration.installing + ')'))); +} + +promise_test(function(t) { + var script = 'resources/update-max-aged-worker.py' + + '?Test=Test_with_useCache_default'; + var scope = 'resources/blank.html'; + + return Promise.resolve() + .then(() => registerFirstServiceWorker(t, script, scope)) + .then(r => testAction(t, r, r.update.bind(r), true)) + + // Tear down + .then(() => service_worker_unregister_and_done(t, scope)); +}, 'Test with useCache: default'); + +promise_test(function(t) { + var script = 'resources/update-max-aged-worker.py' + + '?Test=Test_with_useCache_true'; + var scope = 'resources/blank.html'; + + return Promise.resolve() + .then(() => registerFirstServiceWorker(t, script, scope, true)) + .then(r => testAction(t, r, r.update.bind(r), false)) + + // Tear down + .then(() => service_worker_unregister_and_done(t, scope)); +}, 'Test with useCache: true'); + +promise_test(function(t) { + var script = 'resources/update-max-aged-worker.py' + + '?Test=Test_with_useCache_false'; + var scope = 'resources/blank.html'; + + return Promise.resolve() + .then(() => registerFirstServiceWorker(t, script, scope, false)) + .then(r => testAction(t, r, r.update.bind(r), true)) + + // Tear down + .then(() => service_worker_unregister_and_done(t, scope)); + }, 'Test with useCache: false'); + +promise_test(function(t) { + var script = 'resources/update-max-aged-worker.py' + + '?Test=Consecutive_registrations_with_useCache_settings_false_false'; + var scope = 'resources/blank.html'; + + return Promise.resolve() + .then(() => registerFirstServiceWorker(t, script, scope, false)) + .then(r => { + var action = navigator.serviceWorker.register.bind( + navigator.serviceWorker, script, {scope: scope, + useCache: false}); + return testAction(t, r, action, false); + }) + + // Tear down + .then(() => service_worker_unregister_and_done(t, scope)) +}, "Consecutive registrations with useCache settings(false, false)"); + +promise_test(function(t) { + var script = 'resources/update-max-aged-worker.py' + + '?Test=Consecutive_registrations_with_useCache_settings_false_true'; + var scope = 'resources/blank.html'; + + return Promise.resolve() + .then(() => registerFirstServiceWorker(t, script, scope, false)) + .then(r => testAction(t, r, r.update.bind(r), true)) + .then(r => { + var action = navigator.serviceWorker.register.bind( + navigator.serviceWorker, script, {scope: scope, + useCache: true}); + return testAction(t, r, action, false); + }) + .then(r => testAction(t, r, r.update.bind(r), false)) + + // Tear down + .then(() => service_worker_unregister_and_done(t, scope)) +}, "Consecutive registrations with useCache settings(false, true)"); + +promise_test(function(t) { + var script = 'resources/update-max-aged-worker.py' + + '?Test=Consecutive_registrations_with_useCache_settings_true_false'; + var scope = 'resources/blank.html'; + + return Promise.resolve() + .then(() => registerFirstServiceWorker(t, script, scope, true)) + .then(r => testAction(t, r, r.update.bind(r), false)) + .then(r => { + var action = navigator.serviceWorker.register.bind( + navigator.serviceWorker, script, {scope: scope, + useCache: false}); + return testAction(t, r, action, true); + }) + .then(r => testAction(t, r, r.update.bind(r), true)) + + // Tear down + .then(() => service_worker_unregister_and_done(t, scope)); +}, "Consecutive registrations with useCache settings(true, false)"); + +promise_test(function(t) { + var script = 'resources/update-max-aged-worker.py' + + '?Test=Consecutive_registrations_with_useCache_settings_true_true'; + var scope = 'resources/blank.html'; + + return Promise.resolve() + .then(() => registerFirstServiceWorker(t, script, scope, true)) + .then(r => { + var action = navigator.serviceWorker.register.bind( + navigator.serviceWorker, script, {scope: scope, + useCache: true}); + return testAction(t, r, action, false); + }) + + // Tear down + .then(() => service_worker_unregister_and_done(t, scope)) +}, "Consecutive registrations with useCache settings(true, true)"); + +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/extendable-event-async-waituntil.js b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/extendable-event-async-waituntil.js index 21b4e28..fc64e6c 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/extendable-event-async-waituntil.js +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/extendable-event-async-waituntil.js
@@ -42,6 +42,9 @@ event.waitUntil(Promise.resolve()); async_task_waituntil(event).then(reportResultExpecting('InvalidStateError')); break; + case 'script-extendable-event': + new_event_waituntil().then(reportResultExpecting('InvalidStateError')); + break; } event.source.postMessage('ACK'); }); @@ -73,6 +76,18 @@ }); } +function new_event_waituntil() { + return new Promise((res, rej) => { + try { + let e = new ExtendableEvent('foo'); + e.waitUntil(new Promise(() => {})); + res('OK'); + } catch (error) { + res(error.name); + } + }); +} + function async_microtask_waituntil(event) { return new Promise((res, rej) => { Promise.resolve().then(() => {
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/update-max-aged-worker-imported-script.py b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/update-max-aged-worker-imported-script.py new file mode 100644 index 0000000..e166143 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/update-max-aged-worker-imported-script.py
@@ -0,0 +1,22 @@ +import time + +def main(request, response): + headers = [('Cache-Control', 'max-age=86400'), + ('Content-Type', 'application/javascript'), + ('Last-Modified', time.strftime("%a, %d %b %Y %H:%M:%S GMT", + time.gmtime()))] + + + revalidate = request.headers.has_key('if-modified-since'); + + body = ''' + self.addEventListener('message', function(e) { + e.data.port.postMessage({ + from: "imported", + type: "%s", + value: %s + }); + }); + ''' % ('revalidate' if revalidate else 'normal', time.time()) + + return headers, body
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/update-max-aged-worker.py b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/update-max-aged-worker.py new file mode 100644 index 0000000..6eb7c34 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/update-max-aged-worker.py
@@ -0,0 +1,26 @@ +import time + +def main(request, response): + headers = [('Content-Type', 'application/javascript'), + ('Cache-Control', 'max-age=86400'), + ('Last-Modified', time.strftime("%a, %d %b %Y %H:%M:%S GMT", time.gmtime()))] + + test = ''; + if 'Test' in request.GET: + test = request.GET['Test']; + + revalidate = request.headers.has_key('if-modified-since'); + + body = ''' + importScripts('update-max-aged-worker-imported-script.py?Test=%s'); + + self.addEventListener('message', function(e) { + e.data.port.postMessage({ + from: "main", + type: "%s", + value: %s + }); + }); + ''' % (test, 'revalidate' if revalidate else 'normal', time.time()) + + return headers, body
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/piping/general.js b/third_party/WebKit/LayoutTests/external/wpt/streams/piping/general.js index d91ede1..42367a8e 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/streams/piping/general.js +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/piping/general.js
@@ -161,9 +161,9 @@ pull() { return Promise.reject(undefined); } - }, { preventAbort }); + }); - return rs.pipeTo(new WritableStream()).then( + return rs.pipeTo(new WritableStream(), { preventAbort }).then( () => assert_unreached('pipeTo promise should be rejected'), value => assert_equals(value, undefined, 'rejection value should be undefined')); @@ -177,7 +177,7 @@ pull(controller) { controller.enqueue(0); } - }, { preventCancel }); + }); const ws = new WritableStream({ write() { @@ -185,7 +185,7 @@ } }); - return rs.pipeTo(ws).then( + return rs.pipeTo(ws, { preventCancel }).then( () => assert_unreached('pipeTo promise should be rejected'), value => assert_equals(value, undefined, 'rejection value should be undefined'));
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/readable-byte-streams/general.js b/third_party/WebKit/LayoutTests/external/wpt/streams/readable-byte-streams/general.js index cefc446..589b951 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/streams/readable-byte-streams/general.js +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/readable-byte-streams/general.js
@@ -280,6 +280,7 @@ const reader = stream.getReader(); const readPromise = reader.read(); + const ignoredReadPromise = reader.read(); assert_equals(pullCount, 0, 'No pull() as start() just finished and is not yet reflected to the state of the stream');
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/readable-streams/bad-underlying-sources.js b/third_party/WebKit/LayoutTests/external/wpt/streams/readable-streams/bad-underlying-sources.js index b95b54bc..0d5b817c 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/streams/readable-streams/bad-underlying-sources.js +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/readable-streams/bad-underlying-sources.js
@@ -380,4 +380,28 @@ }, 'Underlying source: calling error and returning a rejected promise from pull should cause the stream to error ' + 'with the first error'); +const error1 = { name: 'error1' }; + +promise_test(t => { + + let pullShouldThrow = false; + const rs = new ReadableStream({ + pull(controller) { + if (pullShouldThrow) { + throw error1; + } + controller.enqueue(0); + } + }, new CountQueuingStrategy({highWaterMark: 1})); + const reader = rs.getReader(); + return Promise.resolve().then(() => { + pullShouldThrow = true; + return Promise.all([ + reader.read(), + promise_rejects(t, error1, reader.closed, '.closed promise should reject') + ]); + }); + +}, 'read should not error if it dequeues and pull() throws'); + done();
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting-expected.txt new file mode 100644 index 0000000..a879df2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting-expected.txt
@@ -0,0 +1,36 @@ +This is a testharness.js-based test. +PASS Aborting a WritableStream before it starts should cause the writer's unsettled ready promise to reject +PASS Aborting a WritableStream should cause the writer's fulfilled ready promise to reset to a rejected one +PASS abort() on a released writer rejects +PASS Aborting a WritableStream immediately prevents future writes +PASS Aborting a WritableStream prevents further writes after any that are in progress +PASS Fulfillment value of ws.abort() call must be undefined even if the underlying sink returns a non-undefined value +PASS WritableStream if sink's abort throws, the promise returned by writer.abort() rejects +PASS WritableStream if sink's abort throws, the promise returned by ws.abort() rejects +PASS WritableStream if sink's abort throws, for an abort performed during a write, the promise returned by ws.abort() rejects +PASS Aborting a WritableStream passes through the given reason +PASS Aborting a WritableStream puts it in an errored state, with a TypeError as the stored error +PASS Aborting a WritableStream causes any outstanding write() promises to be rejected with a TypeError +PASS Closing but then immediately aborting a WritableStream causes the stream to error +PASS Closing a WritableStream and aborting it while it closes causes the stream to error +PASS Aborting a WritableStream after it is closed is a no-op +PASS WritableStream should NOT call underlying sink's close if no abort is supplied (historical) +PASS returning a thenable from abort() should work +PASS .closed should not resolve before fulfilled write() +PASS .closed should not resolve before rejected write(); write() error should overwrite abort() error +PASS writes should be satisfied in order when aborting +PASS writes should be satisfied in order after rejected write when aborting +PASS close() should use error from underlying write() on abort +PASS underlying abort() should not be called until underlying write() completes +PASS underlying abort() should not be called if underlying close() has started +PASS if underlying close() has started and then rejects, the abort() and close() promises should reject with the underlying close rejection reason +PASS underlying abort() should be called while closing if underlying close() has not started yet +PASS writer close() promise should resolve before abort() promise +PASS writer.ready should reject on controller error without waiting for underlying write +FAIL writer.abort() while there is a pending write, and then finish the write with rejection assert_array_equals: writePromise, abortPromise and writer.closed must reject property 1, expected "abortPromise" but got "closed" +FAIL writer.abort(), controller.error() while there is a pending write, and then finish the write promise_test: Unhandled rejection with value: object "TypeError: Cannot error a errored writable stream" +PASS controller.error(), writer.abort() while there is a pending write, and then finish the write +PASS releaseLock() while aborting should reject the original closed promise +PASS releaseLock() during delayed async abort() should create a new rejected closed promise +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.dedicatedworker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.dedicatedworker-expected.txt new file mode 100644 index 0000000..a879df2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.dedicatedworker-expected.txt
@@ -0,0 +1,36 @@ +This is a testharness.js-based test. +PASS Aborting a WritableStream before it starts should cause the writer's unsettled ready promise to reject +PASS Aborting a WritableStream should cause the writer's fulfilled ready promise to reset to a rejected one +PASS abort() on a released writer rejects +PASS Aborting a WritableStream immediately prevents future writes +PASS Aborting a WritableStream prevents further writes after any that are in progress +PASS Fulfillment value of ws.abort() call must be undefined even if the underlying sink returns a non-undefined value +PASS WritableStream if sink's abort throws, the promise returned by writer.abort() rejects +PASS WritableStream if sink's abort throws, the promise returned by ws.abort() rejects +PASS WritableStream if sink's abort throws, for an abort performed during a write, the promise returned by ws.abort() rejects +PASS Aborting a WritableStream passes through the given reason +PASS Aborting a WritableStream puts it in an errored state, with a TypeError as the stored error +PASS Aborting a WritableStream causes any outstanding write() promises to be rejected with a TypeError +PASS Closing but then immediately aborting a WritableStream causes the stream to error +PASS Closing a WritableStream and aborting it while it closes causes the stream to error +PASS Aborting a WritableStream after it is closed is a no-op +PASS WritableStream should NOT call underlying sink's close if no abort is supplied (historical) +PASS returning a thenable from abort() should work +PASS .closed should not resolve before fulfilled write() +PASS .closed should not resolve before rejected write(); write() error should overwrite abort() error +PASS writes should be satisfied in order when aborting +PASS writes should be satisfied in order after rejected write when aborting +PASS close() should use error from underlying write() on abort +PASS underlying abort() should not be called until underlying write() completes +PASS underlying abort() should not be called if underlying close() has started +PASS if underlying close() has started and then rejects, the abort() and close() promises should reject with the underlying close rejection reason +PASS underlying abort() should be called while closing if underlying close() has not started yet +PASS writer close() promise should resolve before abort() promise +PASS writer.ready should reject on controller error without waiting for underlying write +FAIL writer.abort() while there is a pending write, and then finish the write with rejection assert_array_equals: writePromise, abortPromise and writer.closed must reject property 1, expected "abortPromise" but got "closed" +FAIL writer.abort(), controller.error() while there is a pending write, and then finish the write promise_test: Unhandled rejection with value: object "TypeError: Cannot error a errored writable stream" +PASS controller.error(), writer.abort() while there is a pending write, and then finish the write +PASS releaseLock() while aborting should reject the original closed promise +PASS releaseLock() during delayed async abort() should create a new rejected closed promise +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.js b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.js index ee4eaea..6f4e06c 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.js +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.js
@@ -32,7 +32,7 @@ promise_rejects(t, new TypeError(), readyPromise, 'the ready promise should reject with a TypeError'), promise_rejects(t, new TypeError(), writePromise, 'the write() promise should reject with a TypeError') ]); -}, 'Aborting a WritableStream should cause the writer\'s unsettled ready promise to reject'); +}, 'Aborting a WritableStream before it starts should cause the writer\'s unsettled ready promise to reject'); promise_test(t => { const ws = new WritableStream(); @@ -184,12 +184,23 @@ writer.abort(error1); + const events = []; + writer.ready.catch(() => { + events.push('ready'); + }); + writer.closed.catch(() => { + events.push('closed'); + }); + return Promise.all([ promise_rejects(t, new TypeError(), writer.write(), 'writing should reject with a TypeError'), promise_rejects(t, new TypeError(), writer.close(), 'closing should reject with a TypeError'), promise_rejects(t, new TypeError(), writer.abort(), 'aborting should reject with a TypeError'), + promise_rejects(t, new TypeError(), writer.ready, 'ready should reject with a TypeError'), promise_rejects(t, new TypeError(), writer.closed, 'closed should reject with a TypeError') - ]); + ]).then(() => { + assert_array_equals(['ready', 'closed'], events, 'ready should reject before closed'); + }); }, 'Aborting a WritableStream puts it in an errored state, with a TypeError as the stored error'); promise_test(t => { @@ -231,10 +242,11 @@ const closePromise = writer.close(); return delay(0).then(() => { - writer.abort(error1); + const abortPromise = writer.abort(error1); resolveClose(); return Promise.all([ promise_rejects(t, new TypeError(), writer.closed, 'closed should reject with a TypeError'), + abortPromise, closePromise ]); }); @@ -529,6 +541,276 @@ }, 'writer.ready should reject on controller error without waiting for underlying write'); promise_test(t => { + let rejectWrite; + const ws = new WritableStream({ + write() { + return new Promise((resolve, reject) => { + rejectWrite = reject; + }); + } + }); + + let writePromise; + let abortPromise; + + const events = []; + + const writer = ws.getWriter(); + + writer.closed.catch(() => { + events.push('closed'); + }); + + // Wait for ws to start + return flushAsyncEvents().then(() => { + writePromise = writer.write('a'); + writePromise.catch(() => { + events.push('writePromise'); + }); + + abortPromise = writer.abort(error1); + abortPromise.catch(() => { + events.push('abortPromise'); + }); + + const writePromise2 = writer.write('a'); + + return Promise.all([ + promise_rejects(t, new TypeError(), writePromise2, 'writePromise2 must reject with an error indicating abort'), + promise_rejects(t, new TypeError(), writer.ready, 'writer.ready must reject with an error indicating abort'), + flushAsyncEvents() + ]); + }).then(() => { + assert_array_equals(events, [], 'writePromise, abortPromise and writer.closed must not be rejected yet'); + + rejectWrite(error2); + + return Promise.all([ + promise_rejects(t, error2, writePromise, + 'writePromise must reject with the error returned from the sink\'s write method'), + promise_rejects(t, error2, abortPromise, + 'abortPromise must reject with the error returned from the sink\'s write method'), + promise_rejects(t, error2, writer.closed, + 'writer.closed must reject with the error returned from the sink\'s write method'), + flushAsyncEvents() + ]); + }).then(() => { + assert_array_equals(events, ['writePromise', 'abortPromise', 'closed'], + 'writePromise, abortPromise and writer.closed must reject'); + + const writePromise3 = writer.write('a'); + + return Promise.all([ + promise_rejects(t, new TypeError(), writePromise3, + 'writePromise3 must reject with an error indicating the stream has already been errored'), + promise_rejects(t, new TypeError(), writer.ready, + 'writer.ready must be still rejected with the error indicating abort') + ]); + }).then(() => { + writer.releaseLock(); + + return Promise.all([ + promise_rejects(t, new TypeError(), writer.ready, + 'writer.ready must be rejected with an error indicating release'), + promise_rejects(t, new TypeError(), writer.closed, + 'writer.closed must be rejected with an error indicating release') + ]); + }); +}, 'writer.abort() while there is a pending write, and then finish the write with rejection'); + +promise_test(t => { + let resolveWrite; + let controller; + const ws = new WritableStream({ + write(chunk, c) { + controller = c; + return new Promise(resolve => { + resolveWrite = resolve; + }); + } + }); + + let writePromise; + let abortPromise; + + const events = []; + + const writer = ws.getWriter(); + + writer.closed.catch(() => { + events.push('closed'); + }); + + // Wait for ws to start + return flushAsyncEvents().then(() => { + writePromise = writer.write('a'); + writePromise.then(() => { + events.push('writePromise'); + }); + + abortPromise = writer.abort(error1); + abortPromise.catch(() => { + events.push('abortPromise'); + }); + + const writePromise2 = writer.write('a'); + + return Promise.all([ + promise_rejects(t, new TypeError(), writePromise2, 'writePromise2 must reject with an error indicating abort'), + promise_rejects(t, new TypeError(), writer.ready, 'writer.ready must reject with an error indicating abort'), + flushAsyncEvents() + ]); + }).then(() => { + assert_array_equals(events, [], 'writePromise, abortPromise and writer.closed must not be fulfilled/rejected yet'); + + controller.error(error2); + + const writePromise3 = writer.write('a'); + + return Promise.all([ + promise_rejects(t, new TypeError(), writePromise3, + 'writePromise3 must reject with an error indicating the stream has already been errored'), + promise_rejects(t, new TypeError(), writer.ready, + 'writer.ready must be still rejected with the error indicating abort'), + flushAsyncEvents() + ]); + }).then(() => { + assert_array_equals( + events, [], + 'writePromise, abortPromise and writer.closed must not be fulfilled/rejected yet even after ' + + 'controller.error() call'); + + resolveWrite(); + + return Promise.all([ + writePromise, + promise_rejects(t, error2, abortPromise, + 'abortPromise must reject with the error passed to the controller\'s error method'), + promise_rejects(t, error2, writer.closed, + 'writer.closed must reject with the error passed to the controller\'s error method'), + flushAsyncEvents() + ]); + }).then(() => { + assert_array_equals(events, ['writePromise', 'abortPromise', 'closed'], + 'writePromise, abortPromise and writer.closed must reject'); + + const writePromise4 = writer.write('a'); + + return Promise.all([ + writePromise, + promise_rejects(t, new TypeError(), writePromise4, + 'writePromise4 must reject with an error indicating that the stream has already been errored'), + promise_rejects(t, new TypeError(), writer.ready, + 'writer.ready must be still rejected with the error indicating abort') + ]); + }).then(() => { + writer.releaseLock(); + + return Promise.all([ + promise_rejects(t, new TypeError(), writer.ready, + 'writer.ready must be rejected with an error indicating release'), + promise_rejects(t, new TypeError(), writer.closed, + 'writer.closed must be rejected with an error indicating release') + ]); + }); +}, 'writer.abort(), controller.error() while there is a pending write, and then finish the write'); + +promise_test(t => { + let resolveWrite; + let controller; + const ws = new WritableStream({ + write(chunk, c) { + controller = c; + return new Promise(resolve => { + resolveWrite = resolve; + }); + } + }); + + let writePromise; + let abortPromise; + + const events = []; + + const writer = ws.getWriter(); + + writer.closed.catch(() => { + events.push('closed'); + }); + + // Wait for ws to start + return flushAsyncEvents().then(() => { + writePromise = writer.write('a'); + writePromise.then(() => { + events.push('writePromise'); + }); + + controller.error(error2); + + const writePromise2 = writer.write('a'); + + return Promise.all([ + promise_rejects(t, new TypeError(), writePromise2, + 'writePromise2 must reject with an error indicating the stream has already been errored'), + promise_rejects(t, error2, writer.ready, + 'writer.ready must reject with the error passed to the controller\'s error method'), + flushAsyncEvents() + ]); + }).then(() => { + assert_array_equals(events, [], 'writePromise and writer.closed must not be fulfilled/rejected yet'); + + abortPromise = writer.abort(error1); + abortPromise.catch(() => { + events.push('abortPromise'); + }); + + const writePromise3 = writer.write('a'); + + return Promise.all([ + promise_rejects(t, error2, abortPromise, + 'abortPromise must reject with the error passed to the controller\'s error method'), + promise_rejects(t, new TypeError(), writePromise3, + 'writePromise3 must reject with an error indicating the stream has already been errored'), + flushAsyncEvents() + ]); + }).then(() => { + assert_array_equals( + events, ['abortPromise'], + 'writePromise and writer.closed must not be fulfilled/rejected yet even after writer.abort()'); + + resolveWrite(); + + return Promise.all([ + promise_rejects(t, error2, writer.closed, + 'writer.closed must reject with the error passed to the controller\'s error method'), + flushAsyncEvents() + ]); + }).then(() => { + assert_array_equals(events, ['abortPromise', 'writePromise', 'closed'], + 'writePromise, abortPromise and writer.closed must fulfill/reject'); + + const writePromise4 = writer.write('a'); + + return Promise.all([ + writePromise, + promise_rejects(t, new TypeError(), writePromise4, + 'writePromise4 must reject with an error indicating that the stream has already been errored'), + promise_rejects(t, error2, writer.ready, + 'writer.ready must be still rejected with the error passed to the controller\'s error method') + ]); + }).then(() => { + writer.releaseLock(); + + return Promise.all([ + promise_rejects(t, new TypeError(), writer.ready, + 'writer.ready must be rejected with an error indicating release'), + promise_rejects(t, new TypeError(), writer.closed, + 'writer.closed must be rejected with an error indicating release') + ]); + }); +}, 'controller.error(), writer.abort() while there is a pending write, and then finish the write'); + +promise_test(t => { let resolveWrite; const ws = new WritableStream({ write() {
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.serviceworker.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.serviceworker.https-expected.txt new file mode 100644 index 0000000..a37d430 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.serviceworker.https-expected.txt
@@ -0,0 +1,37 @@ +This is a testharness.js-based test. +PASS Service worker test setup +PASS Aborting a WritableStream before it starts should cause the writer's unsettled ready promise to reject +PASS Aborting a WritableStream should cause the writer's fulfilled ready promise to reset to a rejected one +PASS abort() on a released writer rejects +PASS Aborting a WritableStream immediately prevents future writes +PASS Aborting a WritableStream prevents further writes after any that are in progress +PASS Fulfillment value of ws.abort() call must be undefined even if the underlying sink returns a non-undefined value +PASS WritableStream if sink's abort throws, the promise returned by writer.abort() rejects +PASS WritableStream if sink's abort throws, the promise returned by ws.abort() rejects +PASS WritableStream if sink's abort throws, for an abort performed during a write, the promise returned by ws.abort() rejects +PASS Aborting a WritableStream passes through the given reason +PASS Aborting a WritableStream puts it in an errored state, with a TypeError as the stored error +PASS Aborting a WritableStream causes any outstanding write() promises to be rejected with a TypeError +PASS Closing but then immediately aborting a WritableStream causes the stream to error +PASS Closing a WritableStream and aborting it while it closes causes the stream to error +PASS Aborting a WritableStream after it is closed is a no-op +PASS WritableStream should NOT call underlying sink's close if no abort is supplied (historical) +PASS returning a thenable from abort() should work +PASS .closed should not resolve before fulfilled write() +PASS .closed should not resolve before rejected write(); write() error should overwrite abort() error +PASS writes should be satisfied in order when aborting +PASS writes should be satisfied in order after rejected write when aborting +PASS close() should use error from underlying write() on abort +PASS underlying abort() should not be called until underlying write() completes +PASS underlying abort() should not be called if underlying close() has started +PASS if underlying close() has started and then rejects, the abort() and close() promises should reject with the underlying close rejection reason +PASS underlying abort() should be called while closing if underlying close() has not started yet +PASS writer close() promise should resolve before abort() promise +PASS writer.ready should reject on controller error without waiting for underlying write +FAIL writer.abort() while there is a pending write, and then finish the write with rejection assert_array_equals: writePromise, abortPromise and writer.closed must reject property 1, expected "abortPromise" but got "closed" +FAIL writer.abort(), controller.error() while there is a pending write, and then finish the write promise_test: Unhandled rejection with value: object "TypeError: Cannot error a errored writable stream" +PASS controller.error(), writer.abort() while there is a pending write, and then finish the write +PASS releaseLock() while aborting should reject the original closed promise +PASS releaseLock() during delayed async abort() should create a new rejected closed promise +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.sharedworker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.sharedworker-expected.txt new file mode 100644 index 0000000..a879df2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.sharedworker-expected.txt
@@ -0,0 +1,36 @@ +This is a testharness.js-based test. +PASS Aborting a WritableStream before it starts should cause the writer's unsettled ready promise to reject +PASS Aborting a WritableStream should cause the writer's fulfilled ready promise to reset to a rejected one +PASS abort() on a released writer rejects +PASS Aborting a WritableStream immediately prevents future writes +PASS Aborting a WritableStream prevents further writes after any that are in progress +PASS Fulfillment value of ws.abort() call must be undefined even if the underlying sink returns a non-undefined value +PASS WritableStream if sink's abort throws, the promise returned by writer.abort() rejects +PASS WritableStream if sink's abort throws, the promise returned by ws.abort() rejects +PASS WritableStream if sink's abort throws, for an abort performed during a write, the promise returned by ws.abort() rejects +PASS Aborting a WritableStream passes through the given reason +PASS Aborting a WritableStream puts it in an errored state, with a TypeError as the stored error +PASS Aborting a WritableStream causes any outstanding write() promises to be rejected with a TypeError +PASS Closing but then immediately aborting a WritableStream causes the stream to error +PASS Closing a WritableStream and aborting it while it closes causes the stream to error +PASS Aborting a WritableStream after it is closed is a no-op +PASS WritableStream should NOT call underlying sink's close if no abort is supplied (historical) +PASS returning a thenable from abort() should work +PASS .closed should not resolve before fulfilled write() +PASS .closed should not resolve before rejected write(); write() error should overwrite abort() error +PASS writes should be satisfied in order when aborting +PASS writes should be satisfied in order after rejected write when aborting +PASS close() should use error from underlying write() on abort +PASS underlying abort() should not be called until underlying write() completes +PASS underlying abort() should not be called if underlying close() has started +PASS if underlying close() has started and then rejects, the abort() and close() promises should reject with the underlying close rejection reason +PASS underlying abort() should be called while closing if underlying close() has not started yet +PASS writer close() promise should resolve before abort() promise +PASS writer.ready should reject on controller error without waiting for underlying write +FAIL writer.abort() while there is a pending write, and then finish the write with rejection assert_array_equals: writePromise, abortPromise and writer.closed must reject property 1, expected "abortPromise" but got "closed" +FAIL writer.abort(), controller.error() while there is a pending write, and then finish the write promise_test: Unhandled rejection with value: object "TypeError: Cannot error a errored writable stream" +PASS controller.error(), writer.abort() while there is a pending write, and then finish the write +PASS releaseLock() while aborting should reject the original closed promise +PASS releaseLock() during delayed async abort() should create a new rejected closed promise +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/close.js b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/close.js index 5c83a5e..5844f367 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/close.js +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/close.js
@@ -6,6 +6,12 @@ self.importScripts('../resources/recording-streams.js'); } +const error1 = new Error('error1'); +error1.name = 'error1'; + +const error2 = new Error('error2'); +error2.name = 'error2'; + promise_test(() => { const ws = new WritableStream({ close() { @@ -54,6 +60,38 @@ return writer.close().then(() => promise_rejects(t, passedError, writer.closed, 'closed should stay rejected')); }, 'when sink calls error synchronously while closing, the stream should become errored'); +promise_test(t => { + const ws = new WritableStream({ + write(chunk, controller) { + controller.error(error1); + return new Promise(() => {}); + } + }); + + const writer = ws.getWriter(); + writer.write('a'); + + return delay(0).then(() => { + writer.releaseLock(); + }); +}, 'releaseLock on a stream with a pending write in which the stream has been errored'); + +promise_test(t => { + const ws = new WritableStream({ + close(controller) { + controller.error(error1); + return new Promise(() => {}); + } + }); + + const writer = ws.getWriter(); + writer.close(); + + return delay(0).then(() => { + writer.releaseLock(); + }); +}, 'releaseLock on a stream with a pending close in which the stream has been errored'); + promise_test(() => { const ws = recordingWritableStream(); @@ -213,4 +251,97 @@ }); }, 'the promise returned by async abort during close should resolve'); +// Though the order in which the promises are fulfilled or rejected is arbitrary, we're checking it for +// interoperability. We can change the order as long as we file bugs on all implementers to update to the latest tests +// to keep them interoperable. + +promise_test(() => { + const ws = new WritableStream({}); + + const writer = ws.getWriter(); + + const closePromise = writer.close(); + + const events = []; + return Promise.all([ + closePromise.then(() => { + events.push('closePromise'); + }), + writer.closed.then(() => { + events.push('closed'); + }) + ]).then(() => { + assert_array_equals(events, ['closePromise', 'closed'], + 'promises must fulfill/reject in the expected order'); + }); +}, 'promises must fulfill/reject in the expected order on closure'); + +promise_test(t => { + const ws = new WritableStream({}); + + // Wait until the WritableStream starts so that the close() call gets processed. Otherwise, abort() will be + // processed without waiting for completion of the close(). + return delay(0).then(() => { + const writer = ws.getWriter(); + + const closePromise = writer.close(); + const abortPromise = writer.abort(error1); + + const events = []; + return Promise.all([ + closePromise.then(() => { + events.push('closePromise'); + }), + abortPromise.then(() => { + events.push('abortPromise'); + }), + promise_rejects(t, new TypeError(), writer.closed, 'writer.closed must reject with an error indicating abort') + .then(() => { + events.push('closed'); + }) + ]).then(() => { + assert_array_equals(events, ['closePromise', 'abortPromise', 'closed'], + 'promises must fulfill/reject in the expected order'); + }); + }); +}, 'promises must fulfill/reject in the expected order on aborted closure'); + +promise_test(t => { + const ws = new WritableStream({ + close() { + return Promise.reject(error1); + } + }); + + // Wait until the WritableStream starts so that the close() call gets processed. + return delay(0).then(() => { + const writer = ws.getWriter(); + + const closePromise = writer.close(); + const abortPromise = writer.abort(error2); + + const events = []; + return Promise.all([ + promise_rejects(t, error1, closePromise, + 'closePromise must reject with the error returned from the sink\'s close method') + .then(() => { + events.push('closePromise'); + }), + promise_rejects(t, error1, abortPromise, + 'abortPromise must reject with the error returned from the sink\'s close method') + .then(() => { + events.push('abortPromise'); + }), + promise_rejects(t, error1, writer.closed, + 'writer.closed must reject with the error returned from the sink\'s close method') + .then(() => { + events.push('closed'); + }) + ]).then(() => { + assert_array_equals(events, ['closePromise', 'abortPromise', 'closed'], + 'promises must fulfill/reject in the expected order'); + }); + }); +}, 'promises must fulfill/reject in the expected order on aborted and errored closure'); + done();
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/write-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/write-expected.txt new file mode 100644 index 0000000..5233797 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/write-expected.txt
@@ -0,0 +1,13 @@ +This is a testharness.js-based test. +PASS WritableStream should complete asynchronous writes before close resolves +PASS WritableStream should complete synchronous writes before close resolves +PASS fulfillment value of ws.write() call should be undefined even if the underlying sink returns a non-undefined value +PASS WritableStream should transition to waiting until write is acknowledged +PASS when write returns a rejected promise, queued writes and close should be cleared +PASS when sink's write throws an error, the stream should become errored and the promise should reject +FAIL writer.write(), ready and closed reject with the error passed to controller.error() made before sink.write rejection assert_throws: writer.closed must reject with the error passed to the controller function "function () { throw e }" threw object "error2: error2" ("error2") expected object "error1: error1" ("error1") +PASS a large queue of writes should be processed completely +PASS WritableStreamDefaultWriter should work when manually constructed +PASS returning a thenable from write() should work +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/write.dedicatedworker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/write.dedicatedworker-expected.txt new file mode 100644 index 0000000..5233797 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/write.dedicatedworker-expected.txt
@@ -0,0 +1,13 @@ +This is a testharness.js-based test. +PASS WritableStream should complete asynchronous writes before close resolves +PASS WritableStream should complete synchronous writes before close resolves +PASS fulfillment value of ws.write() call should be undefined even if the underlying sink returns a non-undefined value +PASS WritableStream should transition to waiting until write is acknowledged +PASS when write returns a rejected promise, queued writes and close should be cleared +PASS when sink's write throws an error, the stream should become errored and the promise should reject +FAIL writer.write(), ready and closed reject with the error passed to controller.error() made before sink.write rejection assert_throws: writer.closed must reject with the error passed to the controller function "function () { throw e }" threw object "error2: error2" ("error2") expected object "error1: error1" ("error1") +PASS a large queue of writes should be processed completely +PASS WritableStreamDefaultWriter should work when manually constructed +PASS returning a thenable from write() should work +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/write.js b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/write.js index a754b51f..8b86f0d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/write.js +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/write.js
@@ -6,6 +6,12 @@ self.importScripts('../resources/recording-streams.js'); } +const error1 = new Error('error1'); +error1.name = 'error1'; + +const error2 = new Error('error2'); +error2.name = 'error2'; + function writeArrayToStream(array, writableStreamWriter) { array.forEach(chunk => writableStreamWriter.write(chunk)); return writableStreamWriter.close(); @@ -130,20 +136,21 @@ assert_equals(writer.desiredSize, -1, 'desiredSize should still be -1'); - const passedError = new Error('horrible things'); - return Promise.all([ - promise_rejects(t, passedError, closedPromise, 'closedPromise should reject with passedError') + promise_rejects(t, error1, closedPromise, + 'closedPromise should reject with the error returned from the sink\'s write method') .then(() => assert_equals(sinkWritePromiseRejectors.length, 0, 'sinkWritePromise should reject before closedPromise')), - promise_rejects(t, passedError, writePromise, 'writePromise should reject with passedError') + promise_rejects(t, error1, writePromise, + 'writePromise should reject with the error returned from the sink\'s write method') .then(() => assert_equals(sinkWritePromiseRejectors.length, 0, 'sinkWritePromise should reject before writePromise')), - promise_rejects(t, passedError, writePromise2, 'writePromise2 should reject with passedError') + promise_rejects(t, error1, writePromise2, + 'writePromise2 should reject with the error returned from the sink\'s write method') .then(() => assert_equals(sinkWritePromiseRejectors.length, 0, 'sinkWritePromise should reject before writePromise2')), flushAsyncEvents().then(() => { - sinkWritePromiseRejectors[0](passedError); + sinkWritePromiseRejectors[0](error1); sinkWritePromiseRejectors = []; }) ]); @@ -151,19 +158,42 @@ }, 'when write returns a rejected promise, queued writes and close should be cleared'); promise_test(t => { - const thrownError = new Error('throw me'); const ws = new WritableStream({ write() { - throw thrownError; + throw error1; } }); const writer = ws.getWriter(); - return promise_rejects(t, thrownError, writer.write('a'), 'write() should reject with thrownError') + return promise_rejects(t, error1, writer.write('a'), + 'write() should reject with the error returned from the sink\'s write method') .then(() => promise_rejects(t, new TypeError(), writer.close(), 'close() should be rejected')); }, 'when sink\'s write throws an error, the stream should become errored and the promise should reject'); +promise_test(t => { + const ws = new WritableStream({ + write(chunk, controller) { + controller.error(error1); + throw error2; + } + }); + + const writer = ws.getWriter(); + + return promise_rejects(t, error2, writer.write('a'), + 'write() should reject with the error returned from the sink\'s write method ') + .then(() => { + return Promise.all([ + promise_rejects(t, error1, writer.ready, + 'writer.ready must reject with the error passed to the controller'), + promise_rejects(t, error1, writer.closed, + 'writer.closed must reject with the error passed to the controller') + ]); + }); +}, 'writer.write(), ready and closed reject with the error passed to controller.error() made before sink.write' + + ' rejection'); + promise_test(() => { const numberOfWrites = 1000;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/write.serviceworker.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/write.serviceworker.https-expected.txt new file mode 100644 index 0000000..8213ab0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/write.serviceworker.https-expected.txt
@@ -0,0 +1,14 @@ +This is a testharness.js-based test. +PASS Service worker test setup +PASS WritableStream should complete asynchronous writes before close resolves +PASS WritableStream should complete synchronous writes before close resolves +PASS fulfillment value of ws.write() call should be undefined even if the underlying sink returns a non-undefined value +PASS WritableStream should transition to waiting until write is acknowledged +PASS when write returns a rejected promise, queued writes and close should be cleared +PASS when sink's write throws an error, the stream should become errored and the promise should reject +FAIL writer.write(), ready and closed reject with the error passed to controller.error() made before sink.write rejection assert_throws: writer.closed must reject with the error passed to the controller function "function () { throw e }" threw object "error2: error2" ("error2") expected object "error1: error1" ("error1") +PASS a large queue of writes should be processed completely +PASS WritableStreamDefaultWriter should work when manually constructed +PASS returning a thenable from write() should work +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/write.sharedworker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/write.sharedworker-expected.txt new file mode 100644 index 0000000..5233797 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/write.sharedworker-expected.txt
@@ -0,0 +1,13 @@ +This is a testharness.js-based test. +PASS WritableStream should complete asynchronous writes before close resolves +PASS WritableStream should complete synchronous writes before close resolves +PASS fulfillment value of ws.write() call should be undefined even if the underlying sink returns a non-undefined value +PASS WritableStream should transition to waiting until write is acknowledged +PASS when write returns a rejected promise, queued writes and close should be cleared +PASS when sink's write throws an error, the stream should become errored and the promise should reject +FAIL writer.write(), ready and closed reject with the error passed to controller.error() made before sink.write rejection assert_throws: writer.closed must reject with the error passed to the controller function "function () { throw e }" threw object "error2: error2" ("error2") expected object "error1: error1" ("error1") +PASS a large queue of writes should be processed completely +PASS WritableStreamDefaultWriter should work when manually constructed +PASS returning a thenable from write() should work +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/svg-aam/README.md b/third_party/WebKit/LayoutTests/external/wpt/svg-aam/README.md new file mode 100644 index 0000000..e9163e35 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/svg-aam/README.md
@@ -0,0 +1,64 @@ +svg-aam: Tests for the SVG Accessibility API Mappings +===================================================== + +The [SVG AAM Recommendation](https://www.w3.org/TR/svg-aam-1.0) +define extensions to SVG for support of extended semantics. These +semantics make it easier for Assistive Technologies to intepret and +present content to users with varying physical and cognitive abilities. + +The purpose of these tests is to help ensure that user agents support the +requirements of the Recommendation. + +The general approach for this testing is to enable both manual and automated +testing, with a preference for automation. + + +Running Tests +------------- + +In order to run these tests in an automated fashion, you will need to have a +special Assistive Technology Test Adapter (ATTA) for the platform under test. We will +provide a list of these for popular platforms here as they are made available. + +The ATTA will monitor the window under test via the platforms Accessibility +Layer, forwarding information about the Accessibility Tree to the running test +so that it can evaluate support for the various features under test. + +The workflow for running these tests is something like: + +1. Start up the ATTA for the platform under test. +2. Start up the test driver window and select the svg-aam tests to be run + (e.g., the SVG AAM 1.0 tests) - click "Start" +3. A window pops up that shows a test - the description of which tells the + tester what is being tested. In an automated test, the test with proceed + without user intervention. In a manual test, some user input may be required + in order to stimulate the test. +4. The test runs. Success or failure is determined and reported to the test + driver window, which then cycles to the next test in the sequence. +5. Repeat steps 2-4 until done. +6. Download the JSON format report of test results, which can then be visually + inspected, reported on using various tools, or passed on to W3C for + evaluation and collection in the Implementation Report via github. + +**Remember that while these tests are written to help exercise implementations, +their other (important) purpose is to increase confidence that there are +interoperable implementations.** So, implementers are the audience, but these +tests are not meant to be a comprehensive collection of tests for a client that +might implement the Recommendation. + + +Capturing and Reporting Results +------------------------------- + +As tests are run against implementations, if the results of testing are +submitted to [test-results](https://github.com/w3c/test-results/) then they will +be automatically included in documents generated by +[wptreport](https://www.github.com/w3c/wptreport). The same tool can be used +locally to view reports about recorded results. + + +Writing Tests +------------- + +If you are interested in writing tests for this environment, see the +associated [CONTRIBUTING](CONTRIBUTING.md) document.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/test_keys_wdspec.html b/third_party/WebKit/LayoutTests/external/wpt/test_keys_wdspec.html new file mode 100644 index 0000000..0c1ae36 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/test_keys_wdspec.html
@@ -0,0 +1,69 @@ +<!doctype html> +<meta charset=utf-8> +<head> + <title>Test Keys</title> + <script> + var allEvents = {events: []}; + function displayMessage(message) { + document.getElementById("events").innerHTML = "<p>" + message + "</p>"; + } + + function appendMessage(message) { + document.getElementById("events").innerHTML += "<p>" + message + "</p>"; + } + + /** + * Escape |key| if it's in a surrogate-half character range. + * + * Example: given "\ud83d" return "U+d83d". + * + * Otherwise JSON.stringify will convert it to U+FFFD (REPLACEMENT CHARACTER) + * when returning a value from executeScript, for example. + */ + function escapeSurrogateHalf(key) { + if (typeof key !== "undefined" && key.length === 1) { + var charCode = key.charCodeAt(0); + var highSurrogate = charCode >= 0xD800 && charCode <= 0xDBFF; + var surrogate = highSurrogate || (charCode >= 0xDC00 && charCode <= 0xDFFF); + if (surrogate) { + key = "U+" + charCode.toString(16); + } + } + return key; + } + + function recordEvent(event) { + var key = escapeSurrogateHalf(event.key); + allEvents.events.push({ + "code": event.code, + "key": key, + "which": event.which, + "location": event.location, + "ctrl": event.ctrlKey, + "meta": event.metaKey, + "shift": event.shiftKey, + "repeat": event.repeat, + "type": event.type + }); + appendMessage(`${event.type}(code:${event.code}, key:${key}, which:${event.which})`); + } + + function resetEvents() { + allEvents.events.length = 0; + displayMessage(""); + } + </script> +</head> +<body> + <div> + <h2>KeyReporter</h2> + <input type="text" id="keys" size="80" + onkeyup="recordEvent(event)" + onkeypress="recordEvent(event)" + onkeydown="recordEvent(event)"> + </div> + <div id="resultContainer" style="width:300;height:60"> + <h2>Events</h2> + <div id="events"></div> + </div> +</body>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/user-timing/resources/webperftestharness.js b/third_party/WebKit/LayoutTests/external/wpt/user-timing/resources/webperftestharness.js index f1597bbe..e65b47d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/user-timing/resources/webperftestharness.js +++ b/third_party/WebKit/LayoutTests/external/wpt/user-timing/resources/webperftestharness.js
@@ -38,6 +38,21 @@ var namespace_check = false; +function has_required_interfaces() +{ + if (window.performance.mark == undefined || + window.performance.clearMarks == undefined || + window.performance.measure == undefined || + window.performance.clearMeasures == undefined || + window.performance.getEntriesByName == undefined || + window.performance.getEntriesByType == undefined || + window.performance.getEntries == undefined) { + return false; + } + + return true; +} + // // All test() functions in the WebPerf test suite should use wp_test() instead. //
diff --git a/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_clear_marks.html b/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_clear_marks.html index 3056ddb..03c20619 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_clear_marks.html +++ b/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_clear_marks.html
@@ -25,13 +25,7 @@ function onload_test() { // test for existance of User Timing and Performance Timeline interface - if (window.performance.mark == undefined || - window.performance.clearMarks == undefined || - window.performance.measure == undefined || - window.performance.clearMeasures == undefined || - window.performance.getEntriesByName == undefined || - window.performance.getEntriesByType == undefined || - window.performance.getEntries == undefined) + if (!has_required_interfaces()) { test_true(false, "The User Timing and Performance Timeline interfaces, which are required for this test, " +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_clear_measures.html b/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_clear_measures.html index 68af877..19057e3d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_clear_measures.html +++ b/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_clear_measures.html
@@ -25,13 +25,7 @@ function onload_test() { // test for existance of User Timing and Performance Timeline interface - if (window.performance.mark == undefined || - window.performance.clearMarks == undefined || - window.performance.measure == undefined || - window.performance.clearMeasures == undefined || - window.performance.getEntriesByName == undefined || - window.performance.getEntriesByType == undefined || - window.performance.getEntries == undefined) + if (!has_required_interfaces()) { test_true(false, "The User Timing and Performance Timeline interfaces, which are required for this test, " +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_mark.html b/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_mark.html index 57e8012b..53d3c9d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_mark.html +++ b/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_mark.html
@@ -36,13 +36,7 @@ function onload_test() { // test for existance of User Timing and Performance Timeline interface - if (window.performance.mark == undefined || - window.performance.clearMarks == undefined || - window.performance.measure == undefined || - window.performance.clearMeasures == undefined || - window.performance.getEntriesByName == undefined || - window.performance.getEntriesByType == undefined || - window.performance.getEntries == undefined) + if (!has_required_interfaces()) { test_true(false, "The User Timing and Performance Timeline interfaces, which are required for this test, " +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_mark_exceptions.html b/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_mark_exceptions.html index 1fe214f..d3fada9 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_mark_exceptions.html +++ b/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_mark_exceptions.html
@@ -10,30 +10,6 @@ <script src="resources/webperftestharness.js"></script> <script type="text/javascript"> - // navigation timing attributes - var timingAttributes = [ - 'connectEnd', - 'connectStart', - 'domComplete', - 'domContentLoadedEventEnd', - 'domContentLoadedEventStart', - 'domInteractive', - 'domLoading', - 'domainLookupEnd', - 'domainLookupStart', - 'fetchStart', - 'loadEventEnd', - 'loadEventStart', - 'navigationStart', - 'redirectEnd', - 'redirectStart', - 'requestStart', - 'responseEnd', - 'responseStart', - 'unloadEventEnd', - 'unloadEventStart' - ]; - // test data var markExceptionThrown = false; @@ -44,13 +20,7 @@ function onload_test() { // test for existance of User Timing and Performance Timeline interface - if (window.performance.mark == undefined || - window.performance.clearMarks == undefined || - window.performance.measure == undefined || - window.performance.clearMeasures == undefined || - window.performance.getEntriesByName == undefined || - window.performance.getEntriesByType == undefined || - window.performance.getEntries == undefined) + if (!has_required_interfaces()) { test_true(false, "The User Timing and Performance Timeline interfaces, which are required for this test, " +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_measure.html b/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_measure.html index 6dee57c..f2b9b00 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_measure.html +++ b/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_measure.html
@@ -75,13 +75,7 @@ function onload_test() { // test for existance of User Timing and Performance Timeline interface - if (window.performance.mark == undefined || - window.performance.clearMarks == undefined || - window.performance.measure == undefined || - window.performance.clearMeasures == undefined || - window.performance.getEntriesByName == undefined || - window.performance.getEntriesByType == undefined || - window.performance.getEntries == undefined) + if (!has_required_interfaces()) { test_true(false, "The User Timing and Performance Timeline interfaces, which are required for this test, " +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_measure_exceptions.html b/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_measure_exceptions.html index 18a8ba1..3f73accf 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_measure_exceptions.html +++ b/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_measure_exceptions.html
@@ -10,30 +10,6 @@ <script src="resources/webperftestharness.js"></script> <script type="text/javascript"> - // navigation timing attributes - var timingAttributes = [ - 'connectEnd', - 'connectStart', - 'domComplete', - 'domContentLoadedEventEnd', - 'domContentLoadedEventStart', - 'domInteractive', - 'domLoading', - 'domainLookupEnd', - 'domainLookupStart', - 'fetchStart', - 'loadEventEnd', - 'loadEventStart', - 'navigationStart', - 'redirectEnd', - 'redirectStart', - 'requestStart', - 'responseEnd', - 'responseStart', - 'unloadEventEnd', - 'unloadEventStart' - ]; - // test data var zeroedNavTimingAtt = undefined; @@ -44,13 +20,7 @@ function onload_test() { // test for existance of User Timing and Performance Timeline interface - if (window.performance.mark == undefined || - window.performance.clearMarks == undefined || - window.performance.measure == undefined || - window.performance.clearMeasures == undefined || - window.performance.getEntriesByName == undefined || - window.performance.getEntriesByType == undefined || - window.performance.getEntries == undefined) + if (!has_required_interfaces()) { test_true(false, "The User Timing and Performance Timeline interfaces, which are required for this test, " +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_measure_navigation_timing.html b/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_measure_navigation_timing.html index d29f4e5..1ef93b9 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_measure_navigation_timing.html +++ b/third_party/WebKit/LayoutTests/external/wpt/user-timing/test_user_timing_measure_navigation_timing.html
@@ -11,30 +11,6 @@ <script src="resources/webperftestharness.js"></script> <script type="text/javascript"> - // navigation timing attributes - var timingAttributes = [ - 'connectEnd', - 'connectStart', - 'domComplete', - 'domContentLoadedEventEnd', - 'domContentLoadedEventStart', - 'domInteractive', - 'domLoading', - 'domainLookupEnd', - 'domainLookupStart', - 'fetchStart', - 'loadEventEnd', - 'loadEventStart', - 'navigationStart', - 'redirectEnd', - 'redirectStart', - 'requestStart', - 'responseEnd', - 'responseStart', - 'unloadEventEnd', - 'unloadEventStart' - ]; - // test data var startMarkName = "mark_start"; var startMarkValue; @@ -96,13 +72,7 @@ function onload_test() { // test for existance of User Timing and Performance Timeline interface - if (window.performance.mark == undefined || - window.performance.clearMarks == undefined || - window.performance.measure == undefined || - window.performance.clearMeasures == undefined || - window.performance.getEntriesByName == undefined || - window.performance.getEntriesByType == undefined || - window.performance.getEntries == undefined) + if (!has_required_interfaces()) { test_true(false, "The User Timing and Performance Timeline interfaces, which are required for this test, " + @@ -206,7 +176,7 @@ // test duration, allow for an acceptable threshold in the difference between the actual duration and the // expected value for the duration test_true(Math.abs(measureEntry.duration - expectedDuration) <= testThreshold, measureEntryCommand + - ".duration is aproximately correct (up to " + testThreshold + "ms difference allowed)"); + ".duration is approximately correct (up to " + testThreshold + "ms difference allowed)"); } </script> </head>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/animation-types/property-list.js b/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/animation-types/property-list.js index a2f47285..72a42e8 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/animation-types/property-list.js +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/animation-types/property-list.js
@@ -321,7 +321,7 @@ 'clear': { // https://drafts.csswg.org/css-page-floats/#propdef-clear types: [ - { type: 'discrete', options: [ [ 'inline-start', 'inline-end' ] ] } + { type: 'discrete', options: [ [ 'left', 'right' ] ] } ] }, 'clip': {
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/console-show-all-messages-expected.txt b/third_party/WebKit/LayoutTests/http/tests/inspector/console-show-all-messages-expected.txt index 39f616b..6c0e35f 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/console-show-all-messages-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/console-show-all-messages-expected.txt
@@ -1,6 +1,6 @@ CONSOLE MESSAGE: line 6: message from page! CONSOLE MESSAGE: line 2: message from iframe! -Tests that console shows messages only from specific context when show all checkbox is unchecked. +Tests that console shows messages only from specific context when show target checkbox is checked.
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/console-show-all-messages.html b/third_party/WebKit/LayoutTests/http/tests/inspector/console-show-all-messages.html index 5765551..73ea7ca 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/console-show-all-messages.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/console-show-all-messages.html
@@ -7,7 +7,7 @@ function test() { - var checkbox = Console.ConsoleView.instance()._showAllMessagesCheckbox.inputElement; + var checkbox = Console.ConsoleView.instance()._filter._showTargetMessagesCheckbox.inputElement; //we can't use usual InspectorTest.dumpConsoleMessages(), because it dumps url of message and it flakes in case of iframe function dumpVisibleConsoleMessageText() @@ -22,8 +22,8 @@ function testInitialState(next) { - if (!checkbox.checked) - InspectorTest.addResult("\"Show all messages\" checkbox should be checked by default"); + if (checkbox.checked) + InspectorTest.addResult("\"Show target messages\" checkbox should be unchecked by default"); dumpVisibleConsoleMessageText(); next(); }, @@ -57,7 +57,7 @@ <body> <p> -Tests that console shows messages only from specific context when show all checkbox is unchecked.</a> +Tests that console shows messages only from specific context when show target checkbox is checked.</a> </p> <iframe name="myIFrame" src="resources/console-show-all-messages-iframe.html" onload="runTest()"></iframe>
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-filter-level-test.html b/third_party/WebKit/LayoutTests/inspector/console/console-filter-level-test.html index e8e07e81..1069b1c9b 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-filter-level-test.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-filter-level-test.html
@@ -75,18 +75,19 @@ { Common.settings.settingForTest('messageLevelFilters2').set(SDK.ConsoleMessage.MessageLevel.Verbose); Console.ConsoleView.instance()._filter._textFilterUI.setValue("abc"); + Console.ConsoleView.instance()._filter._textFilterChanged(); dumpVisibleMessages(); next(); }, function abcMessageRegex(next) { - Console.ConsoleView.instance()._filter._textFilterUI._regexCheckBox.checked = "checked"; - Console.ConsoleView.instance()._filter._textFilterUI.setValue("ab[a-z]"); + Console.ConsoleView.instance()._filter._textFilterUI.setValue("/ab[a-z]/"); + Console.ConsoleView.instance()._filter._textFilterChanged(); dumpVisibleMessages(); next(); }, - + function abcMessageRegexWarning(next) { Common.settings.settingForTest('messageLevelFilters2').set(SDK.ConsoleMessage.MessageLevel.Warning);
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-filter-test.html b/third_party/WebKit/LayoutTests/inspector/console/console-filter-test.html index f47c9a0f..ab8389a 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-filter-test.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-filter-test.html
@@ -101,6 +101,7 @@ function checkTextFilter(next) { Console.ConsoleView.instance()._filter._textFilterUI.setValue("outer"); + Console.ConsoleView.instance()._filter._textFilterChanged(); dumpVisibleMessages(); next(); },
diff --git a/third_party/WebKit/LayoutTests/platform/mac/external/wpt/html/semantics/forms/textfieldselection/selection-not-application-textarea-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/external/wpt/html/semantics/forms/textfieldselection/selection-not-application-textarea-expected.txt new file mode 100644 index 0000000..c2756963c --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/external/wpt/html/semantics/forms/textfieldselection/selection-not-application-textarea-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL text field selection for the input textarea assert_equals: updated selectionStart expected 1 but got 0 +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/platform/win/external/wpt/html/semantics/forms/textfieldselection/selection-not-application-textarea-expected.txt b/third_party/WebKit/LayoutTests/platform/win/external/wpt/html/semantics/forms/textfieldselection/selection-not-application-textarea-expected.txt new file mode 100644 index 0000000..064931d6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/external/wpt/html/semantics/forms/textfieldselection/selection-not-application-textarea-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL text field selection for the input textarea assert_equals: initial selectionDirection expected "none" but got "forward" +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/resources/idlharness.js b/third_party/WebKit/LayoutTests/resources/idlharness.js index da77fe7..a52228e 100644 --- a/third_party/WebKit/LayoutTests/resources/idlharness.js +++ b/third_party/WebKit/LayoutTests/resources/idlharness.js
@@ -1384,7 +1384,7 @@ if (isPairIterator) { test(function() { - assert_equals(self[interfaceName].prototype["entries"], self[interfaceName].prototype[Symbol.iterator], "entries method is not the same as @@iterator"); + assert_equals(self[interfaceName].prototype[Symbol.iterator], self[interfaceName].prototype["entries"], "entries method is not the same as @@iterator"); }, "Testing pair iterable interface " + interfaceName); } else { test(function() {
diff --git a/third_party/WebKit/LayoutTests/resources/testharness.js b/third_party/WebKit/LayoutTests/resources/testharness.js index a6e7913..20318b0b 100644 --- a/third_party/WebKit/LayoutTests/resources/testharness.js +++ b/third_party/WebKit/LayoutTests/resources/testharness.js
@@ -527,12 +527,14 @@ tests.promise_tests = Promise.resolve(); } tests.promise_tests = tests.promise_tests.then(function() { + var donePromise = new Promise(function(resolve) { + test.add_cleanup(resolve); + }); var promise = test.step(func, test, test); test.step(function() { assert_not_equals(promise, undefined); }); - return Promise.resolve(promise) - .then( + Promise.resolve(promise).then( function() { test.done(); }) @@ -544,6 +546,7 @@ assert(false, "promise_test", null, "Unhandled rejection with value: ${value}", {value:value}); })); + return donePromise; }); }
diff --git a/third_party/WebKit/Source/build/scripts/make_computed_style_base.py b/third_party/WebKit/Source/build/scripts/make_computed_style_base.py index 92e126c..4c8b27c 100755 --- a/third_party/WebKit/Source/build/scripts/make_computed_style_base.py +++ b/third_party/WebKit/Source/build/scripts/make_computed_style_base.py
@@ -10,7 +10,7 @@ import template_expander import make_style_builder -from name_utilities import camel_case +from name_utilities import camel_case, lower_first class Field(object): @@ -29,29 +29,39 @@ - 'inherited_flag', for single-bit flags that store whether a property is inherited by this style or set explicitly """ + + # List of required attributes for a field which need to be passed in by + # keyword arguments + REQUIRED_ATTRIBUTES = set([ + # Name of field + 'name', + # Name of property field is for + 'property_name', + # Internal field storage type (storage_type_path can be None) + 'storage_type', + 'storage_type_path', + # Bits needed for storage + 'size', + # Default value for field + 'default_value', + # Method names + 'getter_method_name', + 'setter_method_name', + 'initial_method_name', + 'resetter_method_name', + ]) + def __init__(self, field_family, **kwargs): # Values common to all fields - # Name of field - self.name = kwargs.pop('name') - # Name of property field is for - self.property_name = kwargs.pop('property_name') - # Internal field storage type (storage_type_path can be None) - self.storage_type = kwargs.pop('storage_type') - self.storage_type_path = kwargs.pop('storage_type_path') - # Bits needed for storage - self.size = kwargs.pop('size') - # Default value for field - self.default_value = kwargs.pop('default_value') - # Method names - self.getter_method_name = kwargs.pop('getter_method_name') - self.setter_method_name = kwargs.pop('setter_method_name') - self.initial_method_name = kwargs.pop('initial_method_name') - self.resetter_method_name = kwargs.pop('resetter_method_name') + # Set attributes from the keyword arguments + for attrib in Field.REQUIRED_ATTRIBUTES: + setattr(self, attrib, kwargs.pop(attrib)) # Field family: one of these must be true self.is_enum = field_family == 'enum' self.is_inherited_flag = field_family == 'inherited_flag' - assert not (self.is_enum and self.is_inherited_flag), 'Only one field family can be specified at a time' + assert (self.is_enum, self.is_inherited_flag).count(True) == 1, \ + 'Field family has to be exactly one of: enum, inherited_flag' if self.is_enum: # Enum-only fields @@ -67,6 +77,149 @@ assert len(kwargs) == 0, 'Unexpected arguments provided to Field: ' + str(kwargs) +def _create_enums(properties): + """ + Returns a dictionary of enums to be generated, enum name -> [list of enum values] + """ + enums = {} + for property_ in properties: + # Only generate enums for keyword properties that use the default field_storage_type. + if property_['keyword_only'] and property_['field_storage_type'] is None: + enum_name = property_['type_name'] + # From the Blink style guide: Enum members should use InterCaps with an initial capital letter. [names-enum-members] + enum_values = [('k' + camel_case(k)) for k in property_['keywords']] + enums[enum_name] = enum_values + + return enums + + +def _create_enum_field(property_): + """ + Create an enum field from a CSS property and return the Field object. + """ + property_name = property_['name_for_methods'] + property_name_lower = lower_first(property_name) + + # From the Blink style guide: Other data members should be prefixed by "m_". [names-data-members] + field_name = 'm_' + property_name_lower + bits_needed = math.log(len(property_['keywords']), 2) + + # Separate the type path from the type name, if specified. + if property_['field_storage_type']: + type_path = property_['field_storage_type'] + type_name = type_path.split('/')[-1] + else: + type_name = property_['type_name'] + type_path = None + + # For now, the getter name should match the field name. Later, getter names + # will start with an uppercase letter, so if they conflict with the type name, + # add 'get' to the front. + getter_method_name = property_name_lower + if type_name == property_name: + getter_method_name = 'get' + property_name + + assert property_['initial_keyword'] is not None, \ + ('MakeComputedStyleBase requires an initial keyword for keyword_only values, none specified ' + 'for property ' + property_['name']) + default_value = type_name + '::k' + camel_case(property_['initial_keyword']) + + # Add the property itself as a member variable. + return Field( + 'enum', + name=field_name, + property_name=property_['name'], + inherited=property_['inherited'], + independent=property_['independent'], + storage_type=type_name, + storage_type_path=type_path, + size=int(math.ceil(bits_needed)), + default_value=default_value, + getter_method_name=getter_method_name, + setter_method_name='set' + property_name, + initial_method_name='initial' + property_name, + resetter_method_name='reset' + property_name, + is_inherited_method_name=property_name_lower + 'IsInherited', + ) + + +def _create_inherited_flag_field(property_): + """ + Create the field used for an inheritance fast path from an independent CSS property, + and return the Field object. + """ + property_name = property_['name_for_methods'] + property_name_lower = lower_first(property_name) + + field_name_suffix_upper = property_name + 'IsInherited' + field_name_suffix_lower = property_name_lower + 'IsInherited' + + return Field( + 'inherited_flag', + name='m_' + field_name_suffix_lower, + property_name=property_['name'], + storage_type='bool', + storage_type_path=None, + size=1, + default_value='true', + getter_method_name=field_name_suffix_lower, + setter_method_name='set' + field_name_suffix_upper, + initial_method_name='initial' + field_name_suffix_upper, + resetter_method_name='reset' + field_name_suffix_upper, + ) + + +def _create_fields(properties): + """ + Create ComputedStyle fields from CSS properties and return a list of Field objects. + """ + fields = [] + for property_ in properties: + # Keywords only means we generate an enum field. + if property_['keyword_only']: + # If the property is independent, add the single-bit sized isInherited flag + # to the list of Fields as well. + if property_['independent']: + fields.append(_create_inherited_flag_field(property_)) + + fields.append(_create_enum_field(property_)) + + return fields + + +def _pack_fields(fields): + """ + Group a list of fields into buckets to minimise padding. + Returns a list of buckets, where each bucket is a list of Field objects. + """ + # Since fields cannot cross word boundaries, in order to minimize + # padding, group fields into buckets so that as many buckets as possible + # are exactly 32 bits. Although this greedy approach may not always + # produce the optimal solution, we add a static_assert to the code to + # ensure ComputedStyleBase results in the expected size. If that + # static_assert fails, this code is falling into the small number of + # cases that are suboptimal, and may need to be rethought. + # For more details on packing bitfields to reduce padding, see: + # http://www.catb.org/esr/structure-packing/#_bitfields + field_buckets = [] + # Consider fields in descending order of size to reduce fragmentation + # when they are selected. + for field in sorted(fields, key=lambda f: f.size, reverse=True): + added_to_bucket = False + # Go through each bucket and add this field if it will not increase + # the bucket's size to larger than 32 bits. Otherwise, make a new + # bucket containing only this field. + for bucket in field_buckets: + if sum(f.size for f in bucket) + field.size <= 32: + bucket.append(field) + added_to_bucket = True + break + if not added_to_bucket: + field_buckets.append([field]) + + return field_buckets + + class ComputedStyleBaseWriter(make_style_builder.StyleBuilderWriter): def __init__(self, json5_file_path): super(ComputedStyleBaseWriter, self).__init__(json5_file_path) @@ -76,107 +229,14 @@ 'ComputedStyleBaseConstants.h': self.generate_base_computed_style_constants, } - # A map of enum name -> list of enum values - self._computed_enums = {} - for property in self._properties.values(): - # Only generate enums for keyword properties that use the default field_storage_type. - if property['keyword_only'] and property['field_storage_type'] is None: - enum_name = property['type_name'] - # From the Blink style guide: Enum members should use InterCaps with an initial capital letter. [names-enum-members] - enum_values = [('k' + camel_case(k)) for k in property['keywords']] - self._computed_enums[enum_name] = enum_values + # Create all the enums used by properties + self._generated_enums = _create_enums(self._properties.values()) - # A list of all the fields to be generated. - all_fields = [] - for property in self._properties.values(): - if property['keyword_only']: - property_name = property['name_for_methods'] - property_name_lower = property_name[0].lower() + property_name[1:] + # Create all the fields + all_fields = _create_fields(self._properties.values()) - # From the Blink style guide: Other data members should be prefixed by "m_". [names-data-members] - field_name = 'm_' + property_name_lower - bits_needed = math.log(len(property['keywords']), 2) - - # Separate the type path from the type name, if specified. - type_name = property['type_name'] - type_path = None - if property['field_storage_type']: - type_path = property['field_storage_type'] - type_name = type_path.split('/')[-1] - - # For now, the getter name should match the field name. Later, getter names - # will start with an uppercase letter, so if they conflict with the type name, - # add 'get' to the front. - getter_method_name = property_name_lower - if type_name == property_name: - getter_method_name = 'get' + property_name - - assert property['initial_keyword'] is not None, \ - ('MakeComputedStyleBase requires an initial keyword for keyword_only values, none specified ' - 'for property ' + property['name']) - default_value = type_name + '::k' + camel_case(property['initial_keyword']) - - # If the property is independent, add the single-bit sized isInherited flag - # to the list of Fields as well. - if property['independent']: - field_name_suffix_upper = property_name + 'IsInherited' - field_name_suffix_lower = property_name_lower + 'IsInherited' - all_fields.append(Field( - 'inherited_flag', - name='m_' + field_name_suffix_lower, - property_name=property['name'], - storage_type='bool', - storage_type_path=None, - size=1, - default_value='true', - getter_method_name=field_name_suffix_lower, - setter_method_name='set' + field_name_suffix_upper, - initial_method_name='initial' + field_name_suffix_upper, - resetter_method_name='reset' + field_name_suffix_upper, - )) - - # Add the property itself as a member variable. - all_fields.append(Field( - 'enum', - name=field_name, - property_name=property['name'], - inherited=property['inherited'], - independent=property['independent'], - storage_type=type_name, - storage_type_path=type_path, - size=int(math.ceil(bits_needed)), - default_value=default_value, - getter_method_name=getter_method_name, - setter_method_name='set' + property_name, - initial_method_name='initial' + property_name, - resetter_method_name='reset' + property_name, - is_inherited_method_name=property_name_lower + 'IsInherited', - )) - - # Since fields cannot cross word boundaries, in order to minimize - # padding, group fields into buckets so that as many buckets as possible - # that are exactly 32 bits. Although this greedy approach may not always - # produce the optimal solution, we add a static_assert to the code to - # ensure ComputedStyleBase results in the expected size. If that - # static_assert fails, this code is falling into the small number of - # cases that are suboptimal, and may need to be rethought. - # For more details on packing bitfields to reduce padding, see: - # http://www.catb.org/esr/structure-packing/#_bitfields - field_buckets = [] - # Consider fields in descending order of size to reduce fragmentation - # when they are selected. - for field in sorted(all_fields, key=lambda f: f.size, reverse=True): - added_to_bucket = False - # Go through each bucket and add this field if it will not increase - # the bucket's size to larger than 32 bits. Otherwise, make a new - # bucket containing only this field. - for bucket in field_buckets: - if sum(f.size for f in bucket) + field.size <= 32: - bucket.append(field) - added_to_bucket = True - break - if not added_to_bucket: - field_buckets.append([field]) + # Group fields into buckets + field_buckets = _pack_fields(all_fields) # The expected size of ComputedStyleBase is equivalent to as many words # as the total number of buckets. @@ -196,7 +256,7 @@ real_total_field_bytes = optimal_total_field_bytes + extra_padding_bytes assert self._expected_total_field_bytes == real_total_field_bytes, \ ('The field packing algorithm produced %s bytes, optimal is %s bytes' % - (len(field_buckets), self._expected_total_field_bytes)) + (self._expected_total_field_bytes, real_total_field_bytes)) # Order the fields so fields in each bucket are adjacent. self._fields = [] @@ -204,11 +264,12 @@ for field in bucket: self._fields.append(field) + @template_expander.use_jinja('ComputedStyleBase.h.tmpl') def generate_base_computed_style_h(self): return { 'properties': self._properties, - 'enums': self._computed_enums, + 'enums': self._generated_enums, 'fields': self._fields, 'expected_total_field_bytes': self._expected_total_field_bytes, } @@ -217,7 +278,7 @@ def generate_base_computed_style_cpp(self): return { 'properties': self._properties, - 'enums': self._computed_enums, + 'enums': self._generated_enums, 'fields': self._fields, 'expected_total_field_bytes': self._expected_total_field_bytes, } @@ -226,7 +287,7 @@ def generate_base_computed_style_constants(self): return { 'properties': self._properties, - 'enums': self._computed_enums, + 'enums': self._generated_enums, 'fields': self._fields, 'expected_total_field_bytes': self._expected_total_field_bytes, }
diff --git a/third_party/WebKit/Source/core/css/CSSProperties.json5 b/third_party/WebKit/Source/core/css/CSSProperties.json5 index 562ef429..7e09e71e 100644 --- a/third_party/WebKit/Source/core/css/CSSProperties.json5 +++ b/third_party/WebKit/Source/core/css/CSSProperties.json5
@@ -1279,7 +1279,12 @@ { name: "overflow-anchor", runtime_flag: "ScrollAnchoring", - type_name: "EOverflowAnchor", + inherited: false, + initial_keyword: "auto", + keyword_only: true, + keywords: [ + "visible", "none", "auto", + ], }, { name: "overflow-wrap",
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc index e41fcf8..0c9669cc 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
@@ -6,7 +6,6 @@ #include "core/layout/ng/ng_absolute_utils.h" #include "core/layout/ng/ng_block_break_token.h" -#include "core/layout/ng/ng_box_fragment.h" #include "core/layout/ng/ng_column_mapper.h" #include "core/layout/ng/ng_constraint_space.h" #include "core/layout/ng/ng_constraint_space_builder.h" @@ -23,24 +22,39 @@ namespace blink { namespace { -// Adjusts content's offset to CSS "clear" property. -// TODO(glebl): Support margin collapsing edge cases, e.g. margin collapsing -// should not occur if "clear" is applied to non-floating blocks. -// TODO(layout-ng): the call to AdjustToClearance should be moved to -// CreateConstraintSpaceForChild once ConstraintSpaceBuilder is sharing the -// exclusion information between constraint spaces. -void AdjustToClearance(const NGConstraintSpace& space, - const ComputedStyle& style, - LayoutUnit* content_size) { - const NGExclusion* right_exclusion = space.Exclusions()->last_right_float; - const NGExclusion* left_exclusion = space.Exclusions()->last_left_float; +// Updates the fragment's BFC offset if it's not already set. +void UpdateFragmentBfcOffset(const NGLogicalOffset& offset, + const NGConstraintSpace& space, + NGFragmentBuilder* builder) { + NGLogicalOffset fragment_offset = + space.IsNewFormattingContext() ? NGLogicalOffset() : offset; + if (!builder->BfcOffset()) + builder->SetBfcOffset(fragment_offset); +} - // Calculates Left/Right block end offset from left/right float exclusions or - // use the default content offset position. - LayoutUnit left_block_end_offset = - left_exclusion ? left_exclusion->rect.BlockEndOffset() : *content_size; - LayoutUnit right_block_end_offset = - right_exclusion ? right_exclusion->rect.BlockEndOffset() : *content_size; +// Adjusts content_size to respect the CSS "clear" property. +// Picks up the maximum between left/right exclusions and content_size depending +// on the value of style.clear() property. +void AdjustToClearance(const std::shared_ptr<NGExclusions>& exclusions, + const ComputedStyle& style, + const NGLogicalOffset& from_offset, + LayoutUnit* content_size) { + DCHECK(content_size) << "content_size cannot be null here"; + const NGExclusion* right_exclusion = exclusions->last_right_float; + const NGExclusion* left_exclusion = exclusions->last_left_float; + + LayoutUnit left_block_end_offset = *content_size; + if (left_exclusion) { + left_block_end_offset = std::max( + left_exclusion->rect.BlockEndOffset() - from_offset.block_offset, + *content_size); + } + LayoutUnit right_block_end_offset = *content_size; + if (right_exclusion) { + right_block_end_offset = std::max( + right_exclusion->rect.BlockEndOffset() - from_offset.block_offset, + *content_size); + } switch (style.clear()) { case EClear::kNone: @@ -59,21 +73,12 @@ } } -LayoutUnit ComputeCollapsedMarginBlockStart( - const NGDeprecatedMarginStrut& prev_margin_strut, - const NGDeprecatedMarginStrut& curr_margin_strut) { - return std::max(prev_margin_strut.margin_block_end, - curr_margin_strut.margin_block_start) - - std::max(prev_margin_strut.negative_margin_block_end.abs(), - curr_margin_strut.negative_margin_block_start.abs()); -} - // Creates an exclusion from the fragment that will be placed in the provided // layout opportunity. NGExclusion CreateExclusion(const NGFragment& fragment, const NGLayoutOpportunity& opportunity, - LayoutUnit float_offset, - NGBoxStrut margins, + const LayoutUnit float_offset, + const NGBoxStrut& margins, NGExclusion::Type exclusion_type) { NGExclusion exclusion; exclusion.type = exclusion_type; @@ -81,16 +86,30 @@ rect.offset = opportunity.offset; rect.offset.inline_offset += float_offset; - rect.size.inline_size = fragment.InlineSize(); - rect.size.block_size = fragment.BlockSize(); - - // Adjust to child's margin. - rect.size.block_size += margins.BlockSum(); - rect.size.inline_size += margins.InlineSum(); - + rect.size.inline_size = fragment.InlineSize() + margins.InlineSum(); + rect.size.block_size = fragment.BlockSize() + margins.BlockSum(); return exclusion; } +// Adjusts the provided offset to the top edge alignment rule. +// Top edge alignment rule: the outer top of a floating box may not be higher +// than the outer top of any block or floated box generated by an element +// earlier in the source document. +NGLogicalOffset AdjustToTopEdgeAlignmentRule(const NGConstraintSpace& space, + const NGLogicalOffset& offset) { + NGLogicalOffset adjusted_offset = offset; + LayoutUnit& adjusted_block_offset = adjusted_offset.block_offset; + if (space.Exclusions()->last_left_float) + adjusted_block_offset = + std::max(adjusted_block_offset, + space.Exclusions()->last_left_float->rect.BlockStartOffset()); + if (space.Exclusions()->last_right_float) + adjusted_block_offset = + std::max(adjusted_block_offset, + space.Exclusions()->last_right_float->rect.BlockStartOffset()); + return adjusted_offset; +} + // Finds a layout opportunity for the fragment. // It iterates over all layout opportunities in the constraint space and returns // the first layout opportunity that is wider than the fragment or returns the @@ -99,13 +118,21 @@ // @param space Constraint space that is used to find layout opportunity for // the fragment. // @param fragment Fragment that needs to be placed. +// @param origin_point {@code space}'s offset relative to the space that +// establishes a new formatting context that we're currently +// in and where all our exclusions reside. // @param margins Margins of the fragment. // @return Layout opportunity for the fragment. const NGLayoutOpportunity FindLayoutOpportunityForFragment( NGConstraintSpace* space, const NGFragment& fragment, + const NGLogicalOffset& origin_point, const NGBoxStrut& margins) { - NGLayoutOpportunityIterator* opportunity_iter = space->LayoutOpportunities(); + NGLogicalOffset adjusted_origin_point = + AdjustToTopEdgeAlignmentRule(*space, origin_point); + + NGLayoutOpportunityIterator* opportunity_iter = + space->LayoutOpportunities(adjusted_origin_point); NGLayoutOpportunity opportunity; NGLayoutOpportunity opportunity_candidate = opportunity_iter->Next(); @@ -114,20 +141,19 @@ // Checking opportunity's block size is not necessary as a float cannot be // positioned on top of another float inside of the same constraint space. auto fragment_inline_size = fragment.InlineSize() + margins.InlineSum(); - if (opportunity.size.inline_size > fragment_inline_size) + if (opportunity.size.inline_size >= fragment_inline_size) break; - opportunity_candidate = opportunity_iter->Next(); } - return opportunity; } // Calculates the logical offset for opportunity. NGLogicalOffset CalculateLogicalOffsetForOpportunity( const NGLayoutOpportunity& opportunity, - LayoutUnit float_offset, - NGBoxStrut margins) { + const LayoutUnit float_offset, + const NGBoxStrut& margins, + const NGLogicalOffset& space_offset) { // Adjust to child's margin. LayoutUnit inline_offset = margins.inline_start; LayoutUnit block_offset = margins.block_start; @@ -138,9 +164,59 @@ inline_offset += float_offset; + block_offset -= space_offset.block_offset; + inline_offset -= space_offset.inline_offset; + return NGLogicalOffset(inline_offset, block_offset); } +// Calculates the relative position from {@code from_offset} of the +// floating object that is requested to be positioned from {@code origin_point}. +NGLogicalOffset PositionFloat(const NGLogicalOffset& origin_point, + const NGLogicalOffset& from_offset, + NGFloatingObject* floating_object) { + NGConstraintSpace* float_space = floating_object->space; + DCHECK(floating_object->fragment) << "Fragment cannot be null here"; + NGBoxFragment* float_fragment = + new NGBoxFragment(float_space->WritingMode(), float_space->Direction(), + toNGPhysicalBoxFragment(floating_object->fragment)); + // Find a layout opportunity that will fit our float. + const NGLayoutOpportunity opportunity = + FindLayoutOpportunityForFragment(floating_object->space, *float_fragment, + origin_point, floating_object->margins); + DCHECK(!opportunity.IsEmpty()) << "Opportunity is empty but it shouldn't be"; + + // Calculate the float offset if needed. + LayoutUnit float_offset; + if (floating_object->exclusion_type == NGExclusion::kFloatRight) { + float_offset = opportunity.size.inline_size - float_fragment->InlineSize(); + } + + // Add the float as an exclusion. + const NGExclusion exclusion = CreateExclusion( + *float_fragment, opportunity, float_offset, floating_object->margins, + floating_object->exclusion_type); + float_space->AddExclusion(exclusion); + + return CalculateLogicalOffsetForOpportunity( + opportunity, float_offset, floating_object->margins, from_offset); +} + +// Positions pending floats stored on the fragment builder starting from +// {@code origin_point}. +void PositionPendingFloats(const NGLogicalOffset& origin_point, + NGFragmentBuilder* builder) { + DCHECK(builder->BfcOffset()) << "Parent BFC offset should be known here"; + NGLogicalOffset from_offset = builder->BfcOffset().value(); + + for (auto& floating_object : builder->UnpositionedFloats()) { + NGLogicalOffset float_fragment_offset = + PositionFloat(origin_point, from_offset, floating_object); + builder->AddFloatingObject(floating_object, float_fragment_offset); + } + builder->MutableUnpositionedFloats().clear(); +} + // Whether an in-flow block-level child creates a new formatting context. // // This will *NOT* check the following cases: @@ -190,8 +266,7 @@ constraint_space_(constraint_space), break_token_(break_token), builder_(new NGFragmentBuilder(NGPhysicalFragment::kFragmentBox, - layout_object)), - is_fragment_margin_strut_block_start_updated_(false) { + layout_object)) { DCHECK(style_); } @@ -222,6 +297,18 @@ return true; } +NGLogicalOffset NGBlockLayoutAlgorithm::CalculateRelativeOffset( + const NGBoxFragment& fragment) { + LayoutUnit inline_offset = + border_and_padding_.inline_start + curr_child_margins_.inline_start; + LayoutUnit block_offset = content_size_; + if (fragment.BfcOffset()) { + block_offset = fragment.BfcOffset().value().block_offset - + builder_->BfcOffset().value().block_offset; + } + return {inline_offset, block_offset}; +} + NGPhysicalFragment* NGBlockLayoutAlgorithm::Layout() { WTF::Optional<MinAndMaxContentSizes> sizes; if (NeedMinAndMaxContentSizes(ConstraintSpace(), Style())) { @@ -268,6 +355,8 @@ builder_->SetWritingMode(constraint_space_->WritingMode()); builder_->SetInlineSize(inline_size).SetBlockSize(block_size); + // TODO(glebl): fix multicol after the new margin collapsing/floats algorithm + // based on BFCOffset is checked in. if (NGBlockBreakToken* token = CurrentBlockBreakToken()) { // Resume after a previous break. content_size_ = token->BreakOffset(); @@ -277,6 +366,19 @@ current_child_ = first_child_; } + curr_margin_strut_ = ConstraintSpace().MarginStrut(); + curr_bfc_offset_ = ConstraintSpace().BfcOffset(); + + // Margins collapsing: + // Do not collapse margins between parent and its child if there is + // border/padding between them. + if (border_and_padding_.block_start) { + curr_bfc_offset_.block_offset += curr_margin_strut_.Sum(); + builder_->SetBfcOffset(curr_bfc_offset_); + curr_margin_strut_ = NGMarginStrut(); + } + curr_bfc_offset_.block_offset += content_size_; + while (current_child_) { EPosition position = current_child_->Style()->position(); if (position == AbsolutePosition || position == FixedPosition) { @@ -301,7 +403,16 @@ break; } + // Margins collapsing: + // Bottom margins of an in-flow block box doesn't collapse with its last + // in-flow block-level child's bottom margin if the box has bottom + // border/padding. content_size_ += border_and_padding_.block_end; + if (border_and_padding_.block_end || + ConstraintSpace().IsNewFormattingContext()) { + content_size_ += curr_margin_strut_.Sum(); + curr_margin_strut_ = NGMarginStrut(); + } // Recompute the block-axis size now that we know our content size. block_size = @@ -311,6 +422,22 @@ // Layout our absolute and fixed positioned children. NGOutOfFlowLayoutPart(Style(), builder_).Run(); + // Non empty blocks always know their position in space: + if (block_size) { + curr_bfc_offset_.block_offset += curr_margin_strut_.Sum(); + UpdateFragmentBfcOffset(curr_bfc_offset_, ConstraintSpace(), builder_); + PositionPendingFloats(curr_bfc_offset_, builder_); + } + + // Margins collapsing: + // Do not collapse margins between the last in-flow child and bottom margin + // of its parent if the parent has height != auto() + if (!Style().logicalHeight().isAuto()) { + // TODO(glebl): handle minLogicalHeight, maxLogicalHeight. + curr_margin_strut_ = NGMarginStrut(); + } + builder_->SetEndMarginStrut(curr_margin_strut_); + builder_->SetInlineOverflow(max_inline_size_).SetBlockOverflow(content_size_); if (ConstraintSpace().HasBlockFragmentation()) @@ -321,23 +448,58 @@ return fragment; } -void NGBlockLayoutAlgorithm::FinishCurrentChildLayout(NGFragment* fragment) { - NGBoxStrut child_margins = ComputeMargins( - *space_for_current_child_, CurrentChildStyle(), - constraint_space_->WritingMode(), constraint_space_->Direction()); - NGLogicalOffset fragment_offset; +void NGBlockLayoutAlgorithm::FinishCurrentChildLayout( + NGFragment* base_fragment) { + const NGBoxFragment& fragment = *toNGBoxFragment(base_fragment); + if (!fragment.PhysicalFragment()->UnpositionedFloats().isEmpty()) + DCHECK(!builder_->BfcOffset()) << "Parent BFC offset shouldn't be set here"; + // Pull out unpositioned floats to the current fragment. This may needed if + // for example the child fragment could not position its floats because it's + // empty and therefore couldn't determine its position in space. + builder_->MutableUnpositionedFloats().appendVector( + fragment.PhysicalFragment()->UnpositionedFloats()); + if (CurrentChildStyle().isFloating()) { - fragment_offset = PositionFloatFragment(*fragment, child_margins); - } else { - ApplyAutoMargins(*space_for_current_child_, CurrentChildStyle(), - fragment->InlineSize(), &child_margins); - fragment_offset = PositionFragment(*fragment, child_margins); + NGFloatingObject* floating_object = new NGFloatingObject( + fragment.PhysicalFragment(), space_for_current_child_, current_child_, + CurrentChildStyle(), curr_child_margins_); + builder_->AddUnpositionedFloat(floating_object); + // No need to postpone the positioning if we know the correct offset. + if (builder_->BfcOffset()) { + NGLogicalOffset origin_point = curr_bfc_offset_; + // Adjust origin point to the margins of the last child. + // Example: <div style="margin-bottom: 20px"><float></div> + // <div style="margin-bottom: 30px"></div> + origin_point.block_offset += curr_margin_strut_.Sum(); + PositionPendingFloats(origin_point, builder_); + } + return; } + + // Fragment that knows its offset can be used to set parent's BFC position. + if (fragment.BfcOffset()) { + curr_bfc_offset_.block_offset = fragment.BfcOffset().value().block_offset; + UpdateFragmentBfcOffset(curr_bfc_offset_, ConstraintSpace(), builder_); + PositionPendingFloats(curr_bfc_offset_, builder_); + } + NGLogicalOffset fragment_offset = CalculateRelativeOffset(fragment); + if (fragmentainer_mapper_) fragmentainer_mapper_->ToVisualOffset(fragment_offset); else fragment_offset.block_offset -= PreviousBreakOffset(); - builder_->AddChild(fragment, fragment_offset); + + builder_->AddChild(base_fragment, fragment_offset); + + // Update margin strut. + curr_margin_strut_ = fragment.EndMarginStrut(); + curr_margin_strut_.Append(curr_child_margins_.block_end); + + content_size_ = fragment.BlockSize() + fragment_offset.block_offset; + max_inline_size_ = + std::max(max_inline_size_, fragment.InlineSize() + + curr_child_margins_.InlineSum() + + border_and_padding_.InlineSum()); } bool NGBlockLayoutAlgorithm::ProceedToNextUnfinishedSibling( @@ -480,133 +642,6 @@ return space_left; } -NGBoxStrut NGBlockLayoutAlgorithm::CollapseMargins( - const NGBoxStrut& margins, - const NGBoxFragment& fragment) { - bool is_zero_height_box = !fragment.BlockSize() && margins.IsEmpty() && - fragment.MarginStrut().IsEmpty(); - // Create the current child's margin strut from its children's margin strut or - // use margin strut from the the last non-empty child. - NGDeprecatedMarginStrut curr_margin_strut = - is_zero_height_box ? prev_child_margin_strut_ : fragment.MarginStrut(); - - // Calculate borders and padding for the current child. - NGBoxStrut border_and_padding = - ComputeBorders(CurrentChildStyle()) + - ComputePadding(ConstraintSpace(), CurrentChildStyle()); - - // Collapse BLOCK-START margins if there is no padding or border between - // parent (current child) and its first in-flow child. - if (border_and_padding.block_start) { - curr_margin_strut.SetMarginBlockStart(margins.block_start); - } else { - curr_margin_strut.AppendMarginBlockStart(margins.block_start); - } - - // Collapse BLOCK-END margins if - // 1) there is no padding or border between parent (current child) and its - // first/last in-flow child - // 2) parent's logical height is auto. - if (CurrentChildStyle().logicalHeight().isAuto() && - !border_and_padding.block_end) { - curr_margin_strut.AppendMarginBlockEnd(margins.block_end); - } else { - curr_margin_strut.SetMarginBlockEnd(margins.block_end); - } - - NGBoxStrut result_margins; - // Margins of the newly established formatting context do not participate - // in Collapsing Margins: - // - Compute margins block start for adjoining blocks *including* 1st block. - // - Compute margins block end for the last block. - // - Do not set the computed margins to the parent fragment. - if (constraint_space_->IsNewFormattingContext()) { - result_margins.block_start = ComputeCollapsedMarginBlockStart( - prev_child_margin_strut_, curr_margin_strut); - bool is_last_child = !current_child_->NextSibling(); - if (is_last_child) - result_margins.block_end = curr_margin_strut.BlockEndSum(); - return result_margins; - } - - // Zero-height boxes are ignored and do not participate in margin collapsing. - if (is_zero_height_box) - return result_margins; - - // Compute the margin block start for adjoining blocks *excluding* 1st block - if (is_fragment_margin_strut_block_start_updated_) { - result_margins.block_start = ComputeCollapsedMarginBlockStart( - prev_child_margin_strut_, curr_margin_strut); - } - - // Update the parent fragment's margin strut - UpdateMarginStrut(curr_margin_strut); - - prev_child_margin_strut_ = curr_margin_strut; - return result_margins; -} - -NGLogicalOffset NGBlockLayoutAlgorithm::PositionFragment( - const NGFragment& fragment, - const NGBoxStrut& margins) { - const NGBoxStrut collapsed_margins = - CollapseMargins(margins, toNGBoxFragment(fragment)); - - AdjustToClearance(ConstraintSpace(), CurrentChildStyle(), &content_size_); - - LayoutUnit inline_offset = - border_and_padding_.inline_start + margins.inline_start; - LayoutUnit block_offset = content_size_ + collapsed_margins.block_start; - - content_size_ += fragment.BlockSize() + collapsed_margins.BlockSum(); - max_inline_size_ = - std::max(max_inline_size_, fragment.InlineSize() + margins.InlineSum() + - border_and_padding_.InlineSum()); - return NGLogicalOffset(inline_offset, block_offset); -} - -NGLogicalOffset NGBlockLayoutAlgorithm::PositionFloatFragment( - const NGFragment& fragment, - const NGBoxStrut& margins) { - // TODO(glebl@chromium.org): Support the top edge alignment rule. - // Find a layout opportunity that will fit our float. - - // Update offset if there is a clearance. - NGLogicalOffset offset = CurrentChildConstraintSpace().Offset(); - AdjustToClearance(ConstraintSpace(), CurrentChildStyle(), - &offset.block_offset); - space_for_current_child_->SetOffset(offset); - - const NGLayoutOpportunity opportunity = FindLayoutOpportunityForFragment( - space_for_current_child_, fragment, margins); - DCHECK(!opportunity.IsEmpty()) << "Opportunity is empty but it shouldn't be"; - - NGExclusion::Type exclusion_type = NGExclusion::kFloatLeft; - // Calculate the float offset if needed. - LayoutUnit float_offset; - if (CurrentChildStyle().floating() == EFloat::kRight) { - float_offset = opportunity.size.inline_size - fragment.InlineSize(); - exclusion_type = NGExclusion::kFloatRight; - } - - // Add the float as an exclusion. - const NGExclusion exclusion = CreateExclusion( - fragment, opportunity, float_offset, margins, exclusion_type); - constraint_space_->AddExclusion(exclusion); - - return CalculateLogicalOffsetForOpportunity(opportunity, float_offset, - margins); -} - -void NGBlockLayoutAlgorithm::UpdateMarginStrut( - const NGDeprecatedMarginStrut& from) { - if (!is_fragment_margin_strut_block_start_updated_) { - builder_->SetMarginStrutBlockStart(from); - is_fragment_margin_strut_block_start_updated_ = true; - } - builder_->SetMarginStrutBlockEnd(from); -} - NGBoxStrut NGBlockLayoutAlgorithm::CalculateMargins( const NGConstraintSpace& space, const ComputedStyle& style) { @@ -630,15 +665,12 @@ NGBlockLayoutAlgorithm::CreateConstraintSpaceForCurrentChild() { // TODO(layout-ng): Orthogonal children should also shrink to fit (in *their* // inline axis) - // We have to keep this commented out for now until we correctly compute - // min/max content sizes in Layout(). bool shrink_to_fit = CurrentChildStyle().display() == EDisplay::InlineBlock || CurrentChildStyle().isFloating(); DCHECK(current_child_); - space_builder_ - ->SetIsNewFormattingContext( - IsNewFormattingContextForInFlowBlockLevelChild(ConstraintSpace(), - CurrentChildStyle())) + bool is_new_bfc = IsNewFormattingContextForInFlowBlockLevelChild( + ConstraintSpace(), CurrentChildStyle()); + space_builder_->SetIsNewFormattingContext(is_new_bfc) .SetIsShrinkToFit(shrink_to_fit) .SetWritingMode( FromPlatformWritingMode(CurrentChildStyle().getWritingMode())) @@ -649,11 +681,42 @@ curr_child_margins_ = CalculateMargins(*space_builder_->ToConstraintSpace(), CurrentChildStyle()); - NGConstraintSpace* child_space = space_builder_->ToConstraintSpace(); + // Clearance : + // - Collapse margins + // - Update curr_bfc_offset and parent BFC offset if needed. + // - Position all pending floats as position is known now. + // TODO(glebl): Fix the use case with clear: left and an intruding right. + // https://software.hixie.ch/utilities/js/live-dom-viewer/saved/4847 + if (CurrentChildStyle().clear() != EClear::kNone) { + curr_bfc_offset_.block_offset += curr_margin_strut_.Sum(); + UpdateFragmentBfcOffset(curr_bfc_offset_, ConstraintSpace(), builder_); + // Only collapse margins if it's an adjoining block with clearance. + if (!content_size_) { + curr_margin_strut_ = NGMarginStrut(); + curr_child_margins_.block_start = LayoutUnit(); + } + PositionPendingFloats(curr_bfc_offset_, builder_); + AdjustToClearance(constraint_space_->Exclusions(), CurrentChildStyle(), + builder_->BfcOffset().value(), &content_size_); + } - // TODO(layout-ng): Set offset through the space builder. - child_space->SetOffset(GetChildSpaceOffset()); - return child_space; + // Append the current margin strut with child's block start margin. + // Non empty border/padding use cases are handled inside of the child's + // layout. + curr_margin_strut_.Append(curr_child_margins_.block_start); + space_builder_->SetMarginStrut(curr_margin_strut_); + + // Set estimated BFC offset to the next child's constraint space. + curr_bfc_offset_ = builder_->BfcOffset() ? builder_->BfcOffset().value() + : ConstraintSpace().BfcOffset(); + curr_bfc_offset_.block_offset += content_size_; + curr_bfc_offset_.inline_offset += border_and_padding_.inline_start; + if (ConstraintSpace().IsNewFormattingContext()) { + curr_bfc_offset_.inline_offset += curr_child_margins_.inline_start; + } + space_builder_->SetBfcOffset(curr_bfc_offset_); + + return space_builder_->ToConstraintSpace(); } DEFINE_TRACE(NGBlockLayoutAlgorithm) {
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h index 6728849..932a888 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h
@@ -7,6 +7,7 @@ #include "core/CoreExport.h" #include "core/layout/ng/ng_block_node.h" +#include "core/layout/ng/ng_box_fragment.h" #include "core/layout/ng/ng_layout_algorithm.h" #include "core/layout/ng/ng_units.h" #include "wtf/RefPtr.h" @@ -19,7 +20,6 @@ class NGColumnMapper; class NGConstraintSpace; class NGConstraintSpaceBuilder; -class NGBoxFragment; class NGFragment; class NGFragmentBuilder; class NGPhysicalFragment; @@ -97,40 +97,9 @@ return content_size_; } - // Computes collapsed margins for 2 adjoining blocks and updates the resultant - // fragment's MarginStrut if needed. - // See https://www.w3.org/TR/CSS2/box.html#collapsing-margins - // - // @param child_margins Margins information for the current child. - // @param fragment Current child's fragment. - // @return NGBoxStrut with margins block start/end. - NGBoxStrut CollapseMargins(const NGBoxStrut& child_margins, - const NGBoxFragment& fragment); - - // Calculates position of the in-flow block-level fragment that needs to be - // positioned relative to the current fragment that is being built. - // - // @param fragment Fragment that needs to be placed. - // @param child_margins Margins information for the current child fragment. - // @return Position of the fragment in the parent's constraint space. - NGLogicalOffset PositionFragment(const NGFragment& fragment, - const NGBoxStrut& child_margins); - - // Calculates position of the float fragment that needs to be - // positioned relative to the current fragment that is being built. - // - // @param fragment Fragment that needs to be placed. - // @param child_margins Margins information for the current child fragment. - // @return Position of the fragment in the parent's constraint space. - NGLogicalOffset PositionFloatFragment(const NGFragment& fragment, - const NGBoxStrut& child_margins); - - // Updates block-{start|end} of the currently constructed fragment. - // - // This method is supposed to be called on every child but it only updates - // the block-start once (on the first non-zero height child fragment) and - // keeps updating block-end (on every non-zero height child). - void UpdateMarginStrut(const NGDeprecatedMarginStrut& from); + // Calculates offset for the provided fragment which is relative to the + // fragment's parent. + NGLogicalOffset CalculateRelativeOffset(const NGBoxFragment& fragment); NGLogicalOffset GetChildSpaceOffset() const { return NGLogicalOffset(border_and_padding_.inline_start, content_size_); @@ -174,10 +143,9 @@ LayoutUnit content_size_; LayoutUnit max_inline_size_; // MarginStrut for the previous child. - NGDeprecatedMarginStrut prev_child_margin_strut_; - // Whether the block-start was set for the currently built - // fragment's margin strut. - bool is_fragment_margin_strut_block_start_updated_ : 1; + NGMarginStrut curr_margin_strut_; + NGLogicalOffset bfc_offset_; + NGLogicalOffset curr_bfc_offset_; NGBoxStrut curr_child_margins_; };
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc index 8a3bf39..4b76f9c 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc
@@ -16,8 +16,8 @@ #include "core/layout/ng/ng_physical_box_fragment.h" #include "core/layout/ng/ng_physical_fragment.h" #include "core/layout/ng/ng_units.h" -#include "testing/gmock/include/gmock/gmock.h" #include "core/style/ComputedStyle.h" +#include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" namespace blink { @@ -44,7 +44,12 @@ : public ::testing::WithParamInterface<TestParamLayoutNG>, public RenderingTest { public: - NGBlockLayoutAlgorithmTest() {} + NGBlockLayoutAlgorithmTest() { + RuntimeEnabledFeatures::setLayoutNGEnabled(true); + } + ~NGBlockLayoutAlgorithmTest() { + RuntimeEnabledFeatures::setLayoutNGEnabled(false); + } protected: void SetUp() override { @@ -186,12 +191,9 @@ EXPECT_EQ(kMarginLeft, child->LeftOffset()); } -// Verifies the collapsing margins case for the next pair: -// - top margin of a box and top margin of its first in-flow child. // Verifies that floats are positioned at the top of the first child that can // determine its position after margins collapsed. -// TODO(glebl): Enable with new the float/margins collapsing algorithm. -TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_CollapsingMarginsCase1WithFloats) { +TEST_F(NGBlockLayoutAlgorithmTest, CollapsingMarginsCase1WithFloats) { setBodyInnerHTML( "<style>" " #container {" @@ -295,13 +297,12 @@ Pointee(expected_exclusion2)))); } -// Verifies the collapsing margins case for the next pair: +// Verifies the collapsing margins case for the next pairs: // - bottom margin of box and top margin of its next in-flow following sibling. // - top and bottom margins of a box that does not establish a new block // formatting context and that has zero computed 'min-height', zero or 'auto' // computed 'height', and no in-flow children -// TODO(glebl): Enable with new the float/margins collapsing algorithm. -TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_CollapsingMarginsCase2WithFloats) { +TEST_F(NGBlockLayoutAlgorithmTest, CollapsingMarginsCase2WithFloats) { setBodyInnerHTML( "<style>" "#first-child {" @@ -378,9 +379,10 @@ EXPECT_THAT(LayoutUnit(empty5_fragment_block_offset), empty5_fragment->TopOffset()); - ASSERT_EQ(3UL, body_fragment->PositionedFloats().size()); + ASSERT_EQ(1UL, body_fragment->PositionedFloats().size()); + ASSERT_EQ(1UL, body_fragment->PositionedFloats().size()); auto float_nonempties_fragment = - body_fragment->PositionedFloats().at(1)->fragment; + body_fragment->PositionedFloats().at(0)->fragment; // 70 = first_child's height(50) + first child's margin-bottom(20) EXPECT_THAT(LayoutUnit(70), float_nonempties_fragment->TopOffset()); EXPECT_THAT(LayoutUnit(0), float_nonempties_fragment->LeftOffset()); @@ -430,8 +432,7 @@ // Verifies the collapsing margins case for the next pair: // - bottom margin of a last in-flow child and bottom margin of its parent if // the parent has 'auto' computed height -// TODO(glebl): Enable with new the float/margins collapsing algorithm. -TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_CollapsingMarginsCase3) { +TEST_F(NGBlockLayoutAlgorithmTest, CollapsingMarginsCase3) { setBodyInnerHTML( "<style>" " #container {" @@ -467,22 +468,20 @@ // Margins are collapsed with the result 200 = std::max(20, 200) // The fragment size 258 == body's margin 8 + child's height 50 + 200 EXPECT_EQ(NGPhysicalSize(LayoutUnit(800), LayoutUnit(258)), fragment->Size()); - // EXPECT_EQ(NGMarginStrut({LayoutUnit(200)}), - // container_fragment->EndMarginStrut()); + EXPECT_EQ(NGMarginStrut({LayoutUnit(200)}), + container_fragment->EndMarginStrut()); // height == fixed run_test(Length(50, Fixed)); // Margins are not collapsed, so fragment still has margins == 20. // The fragment size 78 == body's margin 8 + child's height 50 + 20 - // EXPECT_EQ(NGPhysicalSize(LayoutUnit(800), LayoutUnit(78)), - // fragment->Size()); - // EXPECT_EQ(NGMarginStrut(), container_fragment->EndMarginStrut()); + EXPECT_EQ(NGPhysicalSize(LayoutUnit(800), LayoutUnit(78)), fragment->Size()); + EXPECT_EQ(NGMarginStrut(), container_fragment->EndMarginStrut()); } // Verifies that 2 adjoining margins are not collapsed if there is padding or // border that separates them. -// TODO(glebl): Enable with new the float/margins collapsing algorithm. -TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_CollapsingMarginsCase4) { +TEST_F(NGBlockLayoutAlgorithmTest, CollapsingMarginsCase4) { setBodyInnerHTML( "<style>" " #container {" @@ -546,7 +545,9 @@ // horizontal // </div> // </div> -TEST_F(NGBlockLayoutAlgorithmTest, CollapsingMarginsCase5) { +// TODO(glebl): fix writing modes support after new margin collapsing/floats +// algorithm is checked in. +TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_CollapsingMarginsCase5) { const int kVerticalDivMarginRight = 60; const int kVerticalDivWidth = 50; const int kHorizontalDivMarginLeft = 100; @@ -870,8 +871,7 @@ // Verifies that left/right floating and regular blocks can be positioned // correctly by the algorithm. -// TODO(glebl): Enable with new the float/margins collapsing algorithm. -TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_PositionFloatFragments) { +TEST_F(NGBlockLayoutAlgorithmTest, PositionFloatFragments) { setBodyInnerHTML( "<style>" " #container {" @@ -924,7 +924,6 @@ document().getElementsByTagName("html")->item(0)); // ** Verify LayoutNG fragments and the list of positioned floats ** - EXPECT_THAT(LayoutUnit(), fragment->TopOffset()); ASSERT_EQ(1UL, fragment->Children().size()); auto* body_fragment = toNGPhysicalBoxFragment(fragment->Children()[0]); EXPECT_THAT(LayoutUnit(8), body_fragment->TopOffset()); @@ -1044,8 +1043,7 @@ } // Verifies that NG block layout algorithm respects "clear" CSS property. -// TODO(glebl): Enable with new the float/margins collapsing algorithm. -TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_PositionFragmentsWithClear) { +TEST_F(NGBlockLayoutAlgorithmTest, PositionFragmentsWithClear) { setBodyInnerHTML( "<style>" " #container {" @@ -1252,7 +1250,9 @@ // <div id="parent" style="columns:2; column-fill:auto; column-gap:10px; // width:210px; height:100px;"> // </div> -TEST_F(NGBlockLayoutAlgorithmTest, EmptyMulticol) { +// TODO(glebl): reenable multicol after new margin collapsing/floats algorithm +// is checked in. +TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_EmptyMulticol) { // parent RefPtr<ComputedStyle> parent_style = ComputedStyle::create(); parent_style->setColumnCount(2); @@ -1282,7 +1282,9 @@ // width:210px; height:100px;"> // <div id="child"></div> // </div> -TEST_F(NGBlockLayoutAlgorithmTest, EmptyBlock) { +// TODO(glebl): reenable multicol after new margin collapsing/floats algorithm +// is checked in. +TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_EmptyBlock) { // parent RefPtr<ComputedStyle> parent_style = ComputedStyle::create(); parent_style->setColumnCount(2); @@ -1326,7 +1328,9 @@ // width:310px; height:100px;"> // <div id="child" style="width:60%; height:100px;"></div> // </div> -TEST_F(NGBlockLayoutAlgorithmTest, BlockInOneColumn) { +// TODO(glebl): reenable multicol after new margin collapsing/floats algorithm +// is checked in. +TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_BlockInOneColumn) { // parent RefPtr<ComputedStyle> parent_style = ComputedStyle::create(); parent_style->setColumnCount(2); @@ -1373,7 +1377,9 @@ // width:210px; height:100px;"> // <div id="child" style="width:75%; height:150px;"></div> // </div> -TEST_F(NGBlockLayoutAlgorithmTest, BlockInTwoColumns) { +// TODO(glebl): reenable multicol after new margin collapsing/floats algorithm +// is checked in. +TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_BlockInTwoColumns) { // parent RefPtr<ComputedStyle> parent_style = ComputedStyle::create(); parent_style->setColumnCount(2); @@ -1429,7 +1435,9 @@ // width:320px; height:100px;"> // <div id="child" style="width:75%; height:250px;"></div> // </div> -TEST_F(NGBlockLayoutAlgorithmTest, BlockInThreeColumns) { +// TODO(glebl): reenable multicol after new margin collapsing/floats algorithm +// is checked in. +TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_BlockInThreeColumns) { // parent RefPtr<ComputedStyle> parent_style = ComputedStyle::create(); parent_style->setColumnCount(3); @@ -1494,7 +1502,10 @@ // width:210px; height:100px;"> // <div id="child" style="width:1px; height:250px;"></div> // </div> -TEST_F(NGBlockLayoutAlgorithmTest, ActualColumnCountGreaterThanSpecified) { +// TODO(glebl): reenable multicol after new margin collapsing/floats algorithm +// is checked in. +TEST_F(NGBlockLayoutAlgorithmTest, + DISABLED_ActualColumnCountGreaterThanSpecified) { // parent RefPtr<ComputedStyle> parent_style = ComputedStyle::create(); parent_style->setColumnCount(2); @@ -1560,7 +1571,9 @@ // <div id="child1" style="width:75%; height:60px;"></div> // <div id="child2" style="width:85%; height:60px;"></div> // </div> -TEST_F(NGBlockLayoutAlgorithmTest, TwoBlocksInTwoColumns) { +// TODO(glebl): reenable multicol after new margin collapsing/floats algorithm +// is checked in. +TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_TwoBlocksInTwoColumns) { // parent RefPtr<ComputedStyle> parent_style = ComputedStyle::create(); parent_style->setColumnCount(3); @@ -1635,7 +1648,9 @@ // </div> // <div id="child2" style="width:85%; height:10px;"></div> // </div> -TEST_F(NGBlockLayoutAlgorithmTest, OverflowedBlock) { +// TODO(glebl): reenable multicol after new margin collapsing/floats algorithm +// is checked in. +TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_OverflowedBlock) { // parent RefPtr<ComputedStyle> parent_style = ComputedStyle::create(); parent_style->setColumnCount(3); @@ -1743,7 +1758,9 @@ // width:320px; height:100px;"> // <div id="child" style="float:left; width:75%; height:100px;"></div> // </div> -TEST_F(NGBlockLayoutAlgorithmTest, FloatInOneColumn) { +// TODO(glebl): reenable multicol after new margin collapsing/floats algorithm +// is checked in. +TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_FloatInOneColumn) { // parent RefPtr<ComputedStyle> parent_style = ComputedStyle::create(); parent_style->setColumnCount(3); @@ -1792,7 +1809,9 @@ // <div id="child1" style="float:left; width:15%; height:100px;"></div> // <div id="child2" style="float:right; width:16%; height:100px;"></div> // </div> -TEST_F(NGBlockLayoutAlgorithmTest, TwoFloatsInOneColumn) { +// TODO(glebl): reenable multicol after new margin collapsing/floats algorithm +// is checked in. +TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_TwoFloatsInOneColumn) { // parent RefPtr<ComputedStyle> parent_style = ComputedStyle::create(); parent_style->setColumnCount(3); @@ -1857,7 +1876,9 @@ // <div id="child1" style="float:left; width:15%; height:150px;"></div> // <div id="child2" style="float:right; width:16%; height:150px;"></div> // </div> -TEST_F(NGBlockLayoutAlgorithmTest, TwoFloatsInTwoColumns) { +// TODO(glebl): reenable multicol after new margin collapsing/floats algorithm +// is checked in. +TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_TwoFloatsInTwoColumns) { // parent RefPtr<ComputedStyle> parent_style = ComputedStyle::create(); parent_style->setColumnCount(3);
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_box_fragment.cc b/third_party/WebKit/Source/core/layout/ng/ng_box_fragment.cc index cda1638..09855a1 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_box_fragment.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_box_fragment.cc
@@ -9,12 +9,19 @@ namespace blink { -NGDeprecatedMarginStrut NGBoxFragment::MarginStrut() const { +const WTF::Optional<NGLogicalOffset>& NGBoxFragment::BfcOffset() const { + WRITING_MODE_IGNORED( + "Accessing BFC offset is allowed here because writing" + "modes are irrelevant in this case."); + return toNGPhysicalBoxFragment(physical_fragment_)->BfcOffset(); +} + +const NGMarginStrut& NGBoxFragment::EndMarginStrut() const { WRITING_MODE_IGNORED( "Accessing the margin strut is fine here. Changing the writing mode" - "establishes a new formatting context, for which a margin strut is never" - "set for a fragment."); - return toNGPhysicalBoxFragment(physical_fragment_)->MarginStrut(); + "establishes a new formatting context, for which a margin strut is" + "never set for a fragment."); + return toNGPhysicalBoxFragment(physical_fragment_)->EndMarginStrut(); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_box_fragment.h b/third_party/WebKit/Source/core/layout/ng/ng_box_fragment.h index dc105ae4..6695b352 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_box_fragment.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_box_fragment.h
@@ -20,7 +20,9 @@ NGPhysicalBoxFragment* physical_fragment) : NGFragment(writing_mode, direction, physical_fragment) {} - NGDeprecatedMarginStrut MarginStrut() const; + const WTF::Optional<NGLogicalOffset>& BfcOffset() const; + + const NGMarginStrut& EndMarginStrut() const; }; DEFINE_TYPE_CASTS(NGBoxFragment,
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc index 4ca9cf1..bcd6426 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc
@@ -24,6 +24,8 @@ bool is_block_direction_triggers_scrollbar, NGFragmentationType block_direction_fragmentation_type, bool is_new_fc, + const NGMarginStrut& margin_strut, + const NGLogicalOffset& bfc_offset, const std::shared_ptr<NGExclusions>& exclusions) : available_size_(available_size), percentage_resolution_size_(percentage_resolution_size), @@ -39,6 +41,8 @@ is_new_fc_(is_new_fc), writing_mode_(writing_mode), direction_(static_cast<unsigned>(direction)), + margin_strut_(margin_strut), + bfc_offset_(bfc_offset), exclusions_(exclusions) {} NGConstraintSpace* NGConstraintSpace::CreateFromLayoutObject( @@ -104,18 +108,19 @@ } NGLayoutOpportunityIterator* NGConstraintSpace::LayoutOpportunities( - unsigned clear, - bool for_inline_or_bfc) { - NGLayoutOpportunityIterator* iterator = new NGLayoutOpportunityIterator(this); + const WTF::Optional<NGLogicalOffset>& opt_origin_point) { + NGLayoutOpportunityIterator* iterator = + new NGLayoutOpportunityIterator(this, opt_origin_point); return iterator; } String NGConstraintSpace::ToString() const { - return String::format("%s,%s %sx%s", - offset_.inline_offset.toString().ascii().data(), - offset_.block_offset.toString().ascii().data(), + return String::format("Offset: %s,%s Size: %sx%s MarginStrut: %s", + bfc_offset_.inline_offset.toString().ascii().data(), + bfc_offset_.block_offset.toString().ascii().data(), AvailableSize().inline_size.toString().ascii().data(), - AvailableSize().block_size.toString().ascii().data()); + AvailableSize().block_size.toString().ascii().data(), + margin_strut_.ToString().ascii().data()); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h index d37c17b7..09f55f8 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h
@@ -9,6 +9,7 @@ #include "core/layout/ng/ng_units.h" #include "core/layout/ng/ng_writing_mode.h" #include "platform/heap/Handle.h" +#include "wtf/Optional.h" #include "wtf/text/WTFString.h" namespace blink { @@ -17,14 +18,6 @@ class NGBoxFragment; class NGLayoutOpportunityIterator; -// TODO(glebl@): unused, delete. -enum NGExclusionType { - kNGClearNone = 0, - kNGClearFloatLeft = 1, - kNGClearFloatRight = 2, - kNGClearFragment = 4 -}; - enum NGFragmentationType { kFragmentNone, kFragmentPage, @@ -65,11 +58,6 @@ // See: https://drafts.csswg.org/css-sizing/#available NGLogicalSize AvailableSize() const { return available_size_; } - // Offset relative to the root constraint space. - NGLogicalOffset Offset() const { return offset_; } - // TODO(layout-ng): Set offset via NGConstraintSpacebuilder. - void SetOffset(const NGLogicalOffset& offset) { offset_ = offset; } - // Return the block-direction space available in the current fragmentainer. LayoutUnit FragmentainerSpaceAvailable() const { DCHECK(HasBlockFragmentation()); @@ -122,8 +110,11 @@ void Subtract(const NGBoxFragment*); NGLayoutOpportunityIterator* LayoutOpportunities( - unsigned clear = kNGClearNone, - bool for_inline_or_bfc = false); + const WTF::Optional<NGLogicalOffset>& opt_origin_point = WTF::nullopt); + + NGMarginStrut MarginStrut() const { return margin_strut_; } + + NGLogicalOffset BfcOffset() const { return bfc_offset_; } DEFINE_INLINE_VIRTUAL_TRACE() {} @@ -144,6 +135,8 @@ bool is_block_direction_triggers_scrollbar, NGFragmentationType block_direction_fragmentation_type, bool is_new_fc, + const NGMarginStrut& margin_strut, + const NGLogicalOffset& bfc_offset, const std::shared_ptr<NGExclusions>& exclusions); NGLogicalSize available_size_; @@ -165,10 +158,11 @@ // formatting Context unsigned is_new_fc_ : 1; - NGLogicalOffset offset_; unsigned writing_mode_ : 3; unsigned direction_ : 1; + NGMarginStrut margin_strut_; + NGLogicalOffset bfc_offset_; const std::shared_ptr<NGExclusions> exclusions_; };
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.cc b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.cc index ac99cdd..e35cee16 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.cc
@@ -23,6 +23,7 @@ fragmentation_type_(parent_space->BlockFragmentationType()), is_new_fc_(parent_space->IsNewFormattingContext()), text_direction_(static_cast<unsigned>(parent_space->Direction())), + bfc_offset_(parent_space->bfc_offset_), exclusions_(parent_space->Exclusions()) {} NGConstraintSpaceBuilder::NGConstraintSpaceBuilder(NGWritingMode writing_mode) @@ -57,6 +58,12 @@ return *this; } +NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetMarginStrut( + const NGMarginStrut& margin_strut) { + margin_strut_ = margin_strut; + return *this; +} + NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetIsFixedSizeInline( bool is_fixed_size_inline) { is_fixed_size_inline_ = is_fixed_size_inline; @@ -119,6 +126,9 @@ bool is_in_parallel_flow = (parent_writing_mode_ == kHorizontalTopBottom) == (writing_mode_ == kHorizontalTopBottom); + NGMarginStrut margin_strut = is_new_fc_ ? NGMarginStrut() : margin_strut_; + NGLogicalOffset bfc_offset = is_new_fc_ ? NGLogicalOffset() : bfc_offset_; + if (is_in_parallel_flow) { return new NGConstraintSpace( static_cast<NGWritingMode>(writing_mode_), @@ -131,7 +141,7 @@ is_inline_direction_triggers_scrollbar_, is_block_direction_triggers_scrollbar_, static_cast<NGFragmentationType>(fragmentation_type_), is_new_fc_, - exclusions); + margin_strut, bfc_offset, exclusions); } return new NGConstraintSpace( @@ -145,7 +155,7 @@ is_block_direction_triggers_scrollbar_, is_inline_direction_triggers_scrollbar_, static_cast<NGFragmentationType>(fragmentation_type_), is_new_fc_, - exclusions); + margin_strut, bfc_offset, exclusions); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.h b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.h index 5bbcbf7..4427826 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.h
@@ -44,6 +44,13 @@ NGConstraintSpaceBuilder& SetWritingMode(NGWritingMode writing_mode); + NGConstraintSpaceBuilder& SetMarginStrut(const NGMarginStrut& margin_strut); + + NGConstraintSpaceBuilder& SetBfcOffset(const NGLogicalOffset& offset) { + bfc_offset_ = offset; + return *this; + } + // Creates a new constraint space. This may be called multiple times, for // example the constraint space will be different for a child which: // - Establishes a new formatting context. @@ -70,6 +77,8 @@ unsigned is_new_fc_ : 1; unsigned text_direction_ : 1; + NGMarginStrut margin_strut_; + NGLogicalOffset bfc_offset_; std::shared_ptr<NGExclusions> exclusions_; };
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc index 8a6fe311..49117713 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc
@@ -151,9 +151,10 @@ // // Expected: // Layout opportunity iterator generates the next opportunities: -// - 1st Start Point (0, 200): 350x150, 250x200 -// - 3rd Start Point (550, 200): 50x200 -// - 4th Start Point (0, 300): 600x50, 500x100 +// - 1st Start Point (0, 200): 350x150, 250x400 +// - 3rd Start Point (550, 200): 50x400 +// - 4th Start Point (0, 300): 600x50, 500x300 +// - 5th Start Point (0, 400): 600x200 // All other opportunities that are located before the origin point should be // filtered out. TEST(NGConstraintSpaceTest, LayoutOpportunitiesTwoInMiddleWithOriginAndLeader) { @@ -181,12 +182,16 @@ new NGLayoutOpportunityIterator(space, origin_point, leader_point); // 1st Start Point EXPECT_EQ("250,200 350x150", OpportunityToString(iterator->Next())); - EXPECT_EQ("250,200 250x200", OpportunityToString(iterator->Next())); + EXPECT_EQ("250,200 250x400", OpportunityToString(iterator->Next())); // 2nd Start Point - EXPECT_EQ("550,200 50x200", OpportunityToString(iterator->Next())); + EXPECT_EQ("550,200 50x400", OpportunityToString(iterator->Next())); // 3rd Start Point EXPECT_EQ("0,300 600x50", OpportunityToString(iterator->Next())); - EXPECT_EQ("0,300 500x100", OpportunityToString(iterator->Next())); + EXPECT_EQ("0,300 500x300", OpportunityToString(iterator->Next())); + // 4th Start Point + EXPECT_EQ("0,400 600x200", OpportunityToString(iterator->Next())); + // TODO(glebl): The opportunity below should not be generated. + EXPECT_EQ("250,400 350x200", OpportunityToString(iterator->Next())); // Iterator is exhausted. EXPECT_EQ("(empty)", OpportunityToString(iterator->Next())); }
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_floating_object.h b/third_party/WebKit/Source/core/layout/ng/ng_floating_object.h index c32a931..68a8431 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_floating_object.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_floating_object.h
@@ -20,7 +20,7 @@ struct CORE_EXPORT NGFloatingObject : public GarbageCollected<NGFloatingObject> { NGFloatingObject(NGPhysicalFragment* fragment, - const NGConstraintSpace* space, + NGConstraintSpace* space, NGBlockNode* node, const ComputedStyle& style, const NGBoxStrut& margins) @@ -32,7 +32,8 @@ } Member<NGPhysicalFragment> fragment; - Member<const NGConstraintSpace> space; + // TODO(glebl): Constraint space should be const here. + Member<NGConstraintSpace> space; Member<NGBlockNode> node; NGExclusion::Type exclusion_type; EClear clear_type;
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.cc b/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.cc index 70250224..8e9b6d1 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.cc
@@ -80,6 +80,12 @@ return *this; } +NGFragmentBuilder& NGFragmentBuilder::SetBfcOffset( + const NGLogicalOffset& offset) { + bfc_offset_ = offset; + return *this; +} + NGFragmentBuilder& NGFragmentBuilder::AddOutOfFlowChildCandidate( NGBlockNode* child, NGLogicalOffset child_offset) { @@ -136,20 +142,6 @@ return *this; } -NGFragmentBuilder& NGFragmentBuilder::SetMarginStrutBlockStart( - const NGDeprecatedMarginStrut& from) { - margin_strut_.margin_block_start = from.margin_block_start; - margin_strut_.negative_margin_block_start = from.negative_margin_block_start; - return *this; -} - -NGFragmentBuilder& NGFragmentBuilder::SetMarginStrutBlockEnd( - const NGDeprecatedMarginStrut& from) { - margin_strut_.margin_block_end = from.margin_block_end; - margin_strut_.negative_margin_block_end = from.negative_margin_block_end; - return *this; -} - NGPhysicalBoxFragment* NGFragmentBuilder::ToBoxFragment() { // TODO(layout-ng): Support text fragments DCHECK_EQ(type_, NGPhysicalFragment::kFragmentBox); @@ -182,8 +174,9 @@ return new NGPhysicalBoxFragment( layout_object_, physical_size, overflow_.ConvertToPhysical(writing_mode_), - children, out_of_flow_descendants_, out_of_flow_positions_, margin_strut_, - unpositioned_floats_, positioned_floats_, break_token); + children, out_of_flow_descendants_, out_of_flow_positions_, + unpositioned_floats_, positioned_floats_, bfc_offset_, end_margin_strut_, + break_token); } NGPhysicalTextFragment* NGFragmentBuilder::ToTextFragment(NGInlineNode* node,
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.h b/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.h index 901cf7b..6d197b3 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.h
@@ -38,6 +38,10 @@ NGFragmentBuilder& AddFloatingObject(NGFloatingObject*, const NGLogicalOffset&); + NGFragmentBuilder& SetBfcOffset(const NGLogicalOffset& offset); + + NGFragmentBuilder& AddUnpositionedFloat(NGFloatingObject* floating_object); + // Builder has non-trivial out-of-flow descendant methods. // These methods are building blocks for implementation of // out-of-flow descendants by layout algorithms. @@ -71,19 +75,16 @@ NGFragmentBuilder& AddOutOfFlowDescendant(NGBlockNode*, const NGStaticPosition&); - NGFragmentBuilder& AddUnpositionedFloat(NGFloatingObject* floating_object); - void SetBreakToken(NGBreakToken* token) { DCHECK(!break_token_); break_token_ = token; } bool HasBreakToken() const { return break_token_; } - // Sets MarginStrut for the resultant fragment. - NGFragmentBuilder& SetMarginStrutBlockStart( - const NGDeprecatedMarginStrut& from); - NGFragmentBuilder& SetMarginStrutBlockEnd( - const NGDeprecatedMarginStrut& from); + NGFragmentBuilder& SetEndMarginStrut(const NGMarginStrut& from) { + end_margin_strut_ = from; + return *this; + } // Offsets are not supposed to be set during fragment construction, so we // do not provide a setter here. @@ -94,14 +95,22 @@ unsigned start_index, unsigned end_index); - // List of floats that need to be positioned. - HeapVector<Member<NGFloatingObject>>& UnpositionedFloats() { + // Mutable list of floats that need to be positioned. + HeapVector<Member<NGFloatingObject>>& MutableUnpositionedFloats() { return unpositioned_floats_; } + // List of floats that need to be positioned. + const HeapVector<Member<NGFloatingObject>>& UnpositionedFloats() const { + return unpositioned_floats_; + } + + const WTF::Optional<NGLogicalOffset>& BfcOffset() const { + return bfc_offset_; + } + DECLARE_VIRTUAL_TRACE(); - private: // Out-of-flow descendant placement information. // The generated fragment must compute NGStaticPosition for all // out-of-flow descendants. @@ -129,8 +138,6 @@ NGLogicalSize size_; NGLogicalSize overflow_; - NGDeprecatedMarginStrut margin_strut_; - HeapVector<Member<NGPhysicalFragment>> children_; Vector<NGLogicalOffset> offsets_; @@ -148,6 +155,9 @@ HeapVector<Member<NGFloatingObject>> positioned_floats_; Member<NGBreakToken> break_token_; + + WTF::Optional<NGLogicalOffset> bfc_offset_; + NGMarginStrut end_margin_strut_; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.cc b/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.cc index 869deda..20eb67a 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.cc
@@ -27,13 +27,17 @@ const NGConstraintSpace& space, const NGLogicalOffset& origin_point) { NGLayoutOpportunity opportunity; - opportunity.offset = space.Offset(); - opportunity.size = space.AvailableSize(); + // TODO(glebl): Perhaps fix other methods (e.g IsContained) instead of using + // INT_MAX here. + opportunity.size.block_size = space.AvailableSize().block_size >= 0 + ? space.AvailableSize().block_size + : LayoutUnit(INT_MAX); + opportunity.size.inline_size = space.AvailableSize().inline_size >= 0 + ? space.AvailableSize().inline_size + : LayoutUnit(INT_MAX); // adjust to the origin_point. opportunity.offset += origin_point; - opportunity.size.inline_size -= origin_point.inline_offset; - opportunity.size.block_size -= origin_point.block_offset; return opportunity; } @@ -213,25 +217,6 @@ return rhs.size.inline_size < lhs.size.inline_size; } -void RunPreconditionChecks( - const NGConstraintSpace& space, - const WTF::Optional<NGLogicalOffset>& opt_origin_point, - const WTF::Optional<NGLogicalOffset>& opt_leader_point) { - if (opt_origin_point) { - NGLogicalOffset origin_point = opt_origin_point.value(); - DCHECK_GE(origin_point, space.Offset()) - << "Origin point " << origin_point - << " should lay below the constraint space's offset " << space.Offset(); - } - - if (opt_leader_point) { - NGLogicalOffset leader_point = opt_leader_point.value(); - DCHECK_GE(leader_point, space.Offset()) - << "Leader point " << leader_point - << " should lay below the constraint space's offset " << space.Offset(); - } -} - NGExclusion ToLeaderExclusion(const NGLogicalOffset& origin_point, const NGLogicalOffset& leader_point) { LayoutUnit inline_size = @@ -251,8 +236,6 @@ const WTF::Optional<NGLogicalOffset>& opt_origin_point, const WTF::Optional<NGLogicalOffset>& opt_leader_point) : constraint_space_(space) { - RunPreconditionChecks(*space, opt_origin_point, opt_leader_point); - // TODO(chrome-layout-team): Combine exclusions that shadow each other. auto& exclusions = constraint_space_->Exclusions(); DCHECK(std::is_sorted(exclusions->storage.begin(), exclusions->storage.end(),
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.h b/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.h index 7241c00..d0795238 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.h
@@ -26,12 +26,11 @@ // @param space Constraint space with exclusions for which this iterator needs // to generate layout opportunities. // @param opt_origin_point Optional origin_point parameter that is used as a - // default start point for layout opportunities. + // default start point for layout opportunities. // @param opt_leader_point Optional 'leader' parameter that is used to specify - // the - // ending point of temporary excluded rectangle which - // starts from 'origin'. This rectangle may represent a - // text fragment for example. + // the ending point of temporary excluded rectangle + // which starts from 'origin'. This rectangle may + // represent a text fragment for example. NGLayoutOpportunityIterator( NGConstraintSpace* space, const WTF::Optional<NGLogicalOffset>& opt_origin_point = WTF::nullopt,
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc b/third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc index b0516921..eaecb75 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc
@@ -14,7 +14,7 @@ namespace blink { // TODO(layout-ng): -// - positioned and/or replaced calculations +// - replaced calculations // - Take scrollbars into account bool NeedMinAndMaxContentSizes(const NGConstraintSpace& constraint_space, @@ -41,7 +41,6 @@ const WTF::Optional<MinAndMaxContentSizes>& min_and_max, const Length& length, LengthResolveType type) { - // TODO(layout-ng): Handle min/max/fit-content DCHECK(!length.isMaxSizeNone()); DCHECK_GE(constraint_space.AvailableSize().inline_size, LayoutUnit());
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.cc b/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.cc index 8efd4f9..845b55f 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.cc
@@ -13,9 +13,10 @@ HeapVector<Member<NGPhysicalFragment>>& children, HeapLinkedHashSet<WeakMember<NGBlockNode>>& out_of_flow_descendants, Vector<NGStaticPosition>& out_of_flow_positions, - NGDeprecatedMarginStrut margin_strut, HeapVector<Member<NGFloatingObject>>& unpositioned_floats, HeapVector<Member<NGFloatingObject>>& positioned_floats, + const WTF::Optional<NGLogicalOffset>& bfc_offset, + const NGMarginStrut& end_margin_strut, NGBreakToken* break_token) : NGPhysicalFragment(layout_object, size, @@ -26,7 +27,8 @@ unpositioned_floats, positioned_floats, break_token), - margin_strut_(margin_strut) { + bfc_offset_(bfc_offset), + end_margin_strut_(end_margin_strut) { children_.swap(children); }
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.h b/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.h index e9b2a171..eaf9f8cf 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.h
@@ -9,6 +9,7 @@ #include "core/layout/ng/ng_physical_fragment.h" #include "core/layout/ng/ng_units.h" #include "platform/heap/Handle.h" +#include "wtf/Optional.h" namespace blink { @@ -25,22 +26,28 @@ HeapVector<Member<NGPhysicalFragment>>& children, HeapLinkedHashSet<WeakMember<NGBlockNode>>& out_of_flow_descendants, Vector<NGStaticPosition>& out_of_flow_positions, - NGDeprecatedMarginStrut margin_strut, HeapVector<Member<NGFloatingObject>>& unpositioned_floats, HeapVector<Member<NGFloatingObject>>& positioned_floats, + const WTF::Optional<NGLogicalOffset>& bfc_offset, + const NGMarginStrut& end_margin_strut, NGBreakToken* break_token = nullptr); const HeapVector<Member<NGPhysicalFragment>>& Children() const { return children_; } - NGDeprecatedMarginStrut MarginStrut() const { return margin_strut_; } + const WTF::Optional<NGLogicalOffset>& BfcOffset() const { + return bfc_offset_; + } + + const NGMarginStrut& EndMarginStrut() const { return end_margin_strut_; } DECLARE_TRACE_AFTER_DISPATCH(); private: HeapVector<Member<NGPhysicalFragment>> children_; - NGDeprecatedMarginStrut margin_strut_; + const WTF::Optional<NGLogicalOffset> bfc_offset_; + const NGMarginStrut end_margin_strut_; }; WILL_NOT_BE_EAGERLY_TRACED_CLASS(NGPhysicalBoxFragment);
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_units.cc b/third_party/WebKit/Source/core/layout/ng/ng_units.cc index e474911..68c5031 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_units.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_units.cc
@@ -206,62 +206,12 @@ return strut; } -LayoutUnit NGDeprecatedMarginStrut::BlockEndSum() const { - return margin_block_end + negative_margin_block_end; +LayoutUnit NGMarginStrut::Sum() const { + return margin + negative_margin; } -void NGDeprecatedMarginStrut::AppendMarginBlockStart(const LayoutUnit& value) { - if (value < 0) { - negative_margin_block_start = - -std::max(value.abs(), negative_margin_block_start.abs()); - } else { - margin_block_start = std::max(value, margin_block_start); - } -} - -void NGDeprecatedMarginStrut::AppendMarginBlockEnd(const LayoutUnit& value) { - if (value < 0) { - negative_margin_block_end = - -std::max(value.abs(), negative_margin_block_end.abs()); - } else { - margin_block_end = std::max(value, margin_block_end); - } -} - -void NGDeprecatedMarginStrut::SetMarginBlockStart(const LayoutUnit& value) { - if (value < 0) { - negative_margin_block_start = value; - } else { - margin_block_start = value; - } -} - -void NGDeprecatedMarginStrut::SetMarginBlockEnd(const LayoutUnit& value) { - if (value < 0) { - negative_margin_block_end = value; - } else { - margin_block_end = value; - } -} - -String NGDeprecatedMarginStrut::ToString() const { - return String::format("Start: (%d %d) End: (%d %d)", - margin_block_start.toInt(), margin_block_end.toInt(), - negative_margin_block_start.toInt(), - negative_margin_block_end.toInt()); -} - -bool NGDeprecatedMarginStrut::IsEmpty() const { - return *this == NGDeprecatedMarginStrut(); -} - -bool NGDeprecatedMarginStrut::operator==( - const NGDeprecatedMarginStrut& other) const { - return std::tie(other.margin_block_start, other.margin_block_end, - other.negative_margin_block_start, - other.negative_margin_block_end) == - std::tie(margin_block_start, margin_block_end, - negative_margin_block_start, negative_margin_block_end); +bool NGMarginStrut::operator==(const NGMarginStrut& other) const { + return margin == other.margin && negative_margin == other.negative_margin; } void NGMarginStrut::Append(const LayoutUnit& value) { @@ -272,19 +222,10 @@ } } -LayoutUnit NGMarginStrut::Collapse() const { - return margin + negative_margin; -} - String NGMarginStrut::ToString() const { return String::format("%d %d", margin.toInt(), negative_margin.toInt()); } -bool NGMarginStrut::operator==(const NGMarginStrut& other) const { - return std::tie(other.margin, other.negative_margin) == - std::tie(margin, negative_margin); -} - bool NGExclusion::operator==(const NGExclusion& other) const { return std::tie(other.rect, other.type) == std::tie(rect, type); }
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_units.h b/third_party/WebKit/Source/core/layout/ng/ng_units.h index f2a5972a..b44aaa4 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_units.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_units.h
@@ -303,38 +303,17 @@ } // This struct is used for the margin collapsing calculation. -// TODO(glebl): Deprecated. It's being replaced by NGMarginStrut -struct CORE_EXPORT NGDeprecatedMarginStrut { - LayoutUnit margin_block_start; - LayoutUnit margin_block_end; - - LayoutUnit negative_margin_block_start; - LayoutUnit negative_margin_block_end; - - LayoutUnit BlockEndSum() const; - - void AppendMarginBlockStart(const LayoutUnit& value); - void AppendMarginBlockEnd(const LayoutUnit& value); - void SetMarginBlockStart(const LayoutUnit& value); - void SetMarginBlockEnd(const LayoutUnit& value); - - bool IsEmpty() const; - - String ToString() const; - - bool operator==(const NGDeprecatedMarginStrut& other) const; -}; - -// This struct is used for the margin collapsing calculation. struct CORE_EXPORT NGMarginStrut { LayoutUnit margin; LayoutUnit negative_margin; - bool operator==(const NGMarginStrut& other) const; - + // Appends negative or positive value to the current margin strut. void Append(const LayoutUnit& value); - LayoutUnit Collapse() const; + // Sum up negative and positive margins of this strut. + LayoutUnit Sum() const; + + bool operator==(const NGMarginStrut& other) const; String ToString() const; };
diff --git a/third_party/WebKit/Source/core/streams/OWNERS b/third_party/WebKit/Source/core/streams/OWNERS index 201d1fc..51b70dc 100644 --- a/third_party/WebKit/Source/core/streams/OWNERS +++ b/third_party/WebKit/Source/core/streams/OWNERS
@@ -1,5 +1,4 @@ tyoshino@chromium.org yhirano@chromium.org -# TEAM: blink-network-stack@google.com # COMPONENT: Blink>Network>StreamsAPI
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp index 7ae1f81..deca619c 100644 --- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp +++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -367,8 +367,6 @@ other.m_nonInheritedData.m_effectiveDisplay; m_nonInheritedData.m_originalDisplay = other.m_nonInheritedData.m_originalDisplay; - m_nonInheritedData.m_overflowAnchor = - other.m_nonInheritedData.m_overflowAnchor; m_nonInheritedData.m_overflowX = other.m_nonInheritedData.m_overflowX; m_nonInheritedData.m_overflowY = other.m_nonInheritedData.m_overflowY; m_nonInheritedData.m_verticalAlign = other.m_nonInheritedData.m_verticalAlign;
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h index 268ca8b6..09c9ece1 100644 --- a/third_party/WebKit/Source/core/style/ComputedStyle.h +++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -222,7 +222,6 @@ bool operator==(const NonInheritedData& other) const { return m_effectiveDisplay == other.m_effectiveDisplay && m_originalDisplay == other.m_originalDisplay && - m_overflowAnchor == other.m_overflowAnchor && m_overflowX == other.m_overflowX && m_overflowY == other.m_overflowY && m_verticalAlign == other.m_verticalAlign && @@ -251,7 +250,6 @@ unsigned m_effectiveDisplay : 5; // EDisplay unsigned m_originalDisplay : 5; // EDisplay - unsigned m_overflowAnchor : 2; // EOverflowAnchor unsigned m_overflowX : 3; // EOverflow unsigned m_overflowY : 3; // EOverflow unsigned m_verticalAlign : 4; // EVerticalAlign @@ -306,8 +304,6 @@ m_nonInheritedData.m_effectiveDisplay = m_nonInheritedData.m_originalDisplay = static_cast<unsigned>(initialDisplay()); - m_nonInheritedData.m_overflowAnchor = - static_cast<unsigned>(initialOverflowAnchor()); m_nonInheritedData.m_overflowX = static_cast<unsigned>(initialOverflowX()); m_nonInheritedData.m_overflowY = static_cast<unsigned>(initialOverflowY()); m_nonInheritedData.m_verticalAlign = @@ -1468,18 +1464,6 @@ SET_VAR(m_rareNonInheritedData, m_outline.m_offset, v); } - // Overflow properties. - // overflow-anchor - static EOverflowAnchor initialOverflowAnchor() { - return EOverflowAnchor::kAuto; - } - EOverflowAnchor overflowAnchor() const { - return static_cast<EOverflowAnchor>(m_nonInheritedData.m_overflowAnchor); - } - void setOverflowAnchor(EOverflowAnchor v) { - m_nonInheritedData.m_overflowAnchor = static_cast<unsigned>(v); - } - // overflow-x static EOverflow initialOverflowX() { return EOverflow::Visible; } EOverflow overflowX() const {
diff --git a/third_party/WebKit/Source/core/style/ComputedStyleConstants.h b/third_party/WebKit/Source/core/style/ComputedStyleConstants.h index 74209a4fd..8731135 100644 --- a/third_party/WebKit/Source/core/style/ComputedStyleConstants.h +++ b/third_party/WebKit/Source/core/style/ComputedStyleConstants.h
@@ -144,8 +144,6 @@ // Random visual rendering model attributes. Not inherited. -enum class EOverflowAnchor : unsigned { kVisible, kNone, kAuto }; - enum class EOverflow : unsigned { Visible, Hidden,
diff --git a/third_party/WebKit/Source/core/xmlhttprequest/OWNERS b/third_party/WebKit/Source/core/xmlhttprequest/OWNERS index 147dfb3..376f7910b 100644 --- a/third_party/WebKit/Source/core/xmlhttprequest/OWNERS +++ b/third_party/WebKit/Source/core/xmlhttprequest/OWNERS
@@ -3,5 +3,4 @@ tyoshino@chromium.org yhirano@chromium.org -# TEAM: blink-network-stack@google.com # COMPONENT: Blink>Network>XHR
diff --git a/third_party/WebKit/Source/devtools/BUILD.gn b/third_party/WebKit/Source/devtools/BUILD.gn index 5bfa86f..b76f90b8 100644 --- a/third_party/WebKit/Source/devtools/BUILD.gn +++ b/third_party/WebKit/Source/devtools/BUILD.gn
@@ -726,7 +726,6 @@ "front_end/Images/audits_logo_2x.png", "front_end/Images/audits_logo_bw.png", "front_end/Images/audits_logo_bw_2x.png", - "front_end/Images/applicationCache.png", "front_end/Images/breakpoint.png", "front_end/Images/breakpoint_2x.png", "front_end/Images/breakpointConditional.png", @@ -740,19 +739,12 @@ "front_end/Images/chromeSelect.png", "front_end/Images/chromeSelect_2x.png", "front_end/Images/deleteIcon.png", - "front_end/Images/domain.png", "front_end/Images/errorWave.png", "front_end/Images/errorWave_2x.png", - "front_end/Images/fileSystem.png", - "front_end/Images/forward.png", - "front_end/Images/frame.png", "front_end/Images/ic_info_black_18dp.svg", "front_end/Images/ic_warning_black_18dp.svg", "front_end/Images/navigationControls.png", "front_end/Images/navigationControls_2x.png", - "front_end/Images/paneAddButtons.png", - "front_end/Images/paneFilterButtons.png", - "front_end/Images/paneRefreshButtons.png", "front_end/Images/popoverArrows.png", "front_end/Images/profileGroupIcon.png", "front_end/Images/profileIcon.png", @@ -777,8 +769,6 @@ "front_end/Images/searchPrev.png", "front_end/Images/securityIcons_2x.png", "front_end/Images/securityIcons.png", - "front_end/Images/settingsListRemove.png", - "front_end/Images/settingsListRemove_2x.png", "front_end/Images/smallIcons.png", "front_end/Images/smallIcons_2x.png", "front_end/Images/speech.png", @@ -786,9 +776,7 @@ "front_end/Images/treeoutlineTriangles_2x.png", "front_end/Images/toolbarButtonGlyphs.png", "front_end/Images/toolbarButtonGlyphs_2x.png", - "front_end/Images/toolbarResizerHorizontal.png", "front_end/Images/toolbarResizerVertical.png", - "front_end/Images/toolbarItemSelected.png", "front_end/Images/touchCursor.png", "front_end/Images/touchCursor_2x.png", ]
diff --git a/third_party/WebKit/Source/devtools/front_end/Images/applicationCache.png b/third_party/WebKit/Source/devtools/front_end/Images/applicationCache.png deleted file mode 100644 index 254fd5b..0000000 --- a/third_party/WebKit/Source/devtools/front_end/Images/applicationCache.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/Source/devtools/front_end/Images/cookie.png b/third_party/WebKit/Source/devtools/front_end/Images/cookie.png deleted file mode 100644 index 846db58..0000000 --- a/third_party/WebKit/Source/devtools/front_end/Images/cookie.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/Source/devtools/front_end/Images/domain.png b/third_party/WebKit/Source/devtools/front_end/Images/domain.png deleted file mode 100644 index 68c75f3..0000000 --- a/third_party/WebKit/Source/devtools/front_end/Images/domain.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/Source/devtools/front_end/Images/fileSystem.png b/third_party/WebKit/Source/devtools/front_end/Images/fileSystem.png deleted file mode 100644 index f801ce6d..0000000 --- a/third_party/WebKit/Source/devtools/front_end/Images/fileSystem.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/Source/devtools/front_end/Images/forward.png b/third_party/WebKit/Source/devtools/front_end/Images/forward.png deleted file mode 100644 index 843392b..0000000 --- a/third_party/WebKit/Source/devtools/front_end/Images/forward.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/Source/devtools/front_end/Images/frame.png b/third_party/WebKit/Source/devtools/front_end/Images/frame.png deleted file mode 100644 index e17c829..0000000 --- a/third_party/WebKit/Source/devtools/front_end/Images/frame.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/Source/devtools/front_end/Images/paneAddButtons.png b/third_party/WebKit/Source/devtools/front_end/Images/paneAddButtons.png deleted file mode 100644 index ff25b0f..0000000 --- a/third_party/WebKit/Source/devtools/front_end/Images/paneAddButtons.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/Source/devtools/front_end/Images/paneFilterButtons.png b/third_party/WebKit/Source/devtools/front_end/Images/paneFilterButtons.png deleted file mode 100644 index 6c52820..0000000 --- a/third_party/WebKit/Source/devtools/front_end/Images/paneFilterButtons.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/Source/devtools/front_end/Images/paneRefreshButtons.png b/third_party/WebKit/Source/devtools/front_end/Images/paneRefreshButtons.png deleted file mode 100644 index 92ff209a..0000000 --- a/third_party/WebKit/Source/devtools/front_end/Images/paneRefreshButtons.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove.png b/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove.png deleted file mode 100644 index 1c30a87..0000000 --- a/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove_2x.png b/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove_2x.png deleted file mode 100644 index c5ff088..0000000 --- a/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove_2x.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/Source/devtools/front_end/Images/src/optimize_png.hashes b/third_party/WebKit/Source/devtools/front_end/Images/src/optimize_png.hashes index 295dce8b..169cc36 100644 --- a/third_party/WebKit/Source/devtools/front_end/Images/src/optimize_png.hashes +++ b/third_party/WebKit/Source/devtools/front_end/Images/src/optimize_png.hashes
@@ -5,10 +5,8 @@ "breakpointConditional.svg": "4cf90210b2af2ed84db2f60b07bcde28", "errorWave.svg": "e183fa242a22ed4784a92f6becbc2c45", "smallIcons.svg": "d884babbd1c785b92eb46ee736c95541", - "settingsListRemove.svg": "ce9e7c5c5cdaef28e6ee51d9478d5485", "toolbarButtonGlyphs.svg": "db0b7d1af08a57a11e5609e0b2cbbc01", "breakpoint.svg": "69cd92d807259c022791112809b97799", "treeoutlineTriangles.svg": "017d2f89437df0afc6b9cd5ff43735d9", - "search.svg": "fc990dd3836aec510d7ca1f36c2a3142", "audits_logo.svg": "647095d7981857c22a816eef12f75b91" -} \ No newline at end of file +}
diff --git a/third_party/WebKit/Source/devtools/front_end/Images/src/search.svg b/third_party/WebKit/Source/devtools/front_end/Images/src/search.svg deleted file mode 100644 index 7a8b1b86..0000000 --- a/third_party/WebKit/Source/devtools/front_end/Images/src/search.svg +++ /dev/null
@@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg width="11px" height="11px" viewBox="0 0 11 11" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> - <!-- Generator: Sketch 3.7.1 (28215) - http://www.bohemiancoding.com/sketch --> - <title>Search</title> - <desc>Created with Sketch.</desc> - <defs></defs> - <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> - <g id="Search" transform="translate(-3.000000, -3.000000)"> - <polygon id="bounds" opacity="0.5" points="0 0 16 0 16 16 0 16"></polygon> - <path d="M10.1920636,11.1062772 C9.44133351,11.6675985 8.50948503,12 7.5,12 C5.01471863,12 3,9.98528137 3,7.5 C3,5.01471863 5.01471863,3 7.5,3 C9.98528137,3 12,5.01471863 12,7.5 C12,8.61537283 11.5942081,9.63596789 10.9222047,10.4222047 L13.267767,12.767767 L12.5606602,13.4748737 L10.1920636,11.1062772 Z M7.5,11 C9.43299662,11 11,9.43299662 11,7.5 C11,5.56700338 9.43299662,4 7.5,4 C5.56700338,4 4,5.56700338 4,7.5 C4,9.43299662 5.56700338,11 7.5,11 Z" fill="#5B5B5B"></path> - </g> - </g> -</svg> \ No newline at end of file
diff --git a/third_party/WebKit/Source/devtools/front_end/Images/src/settingsListRemove.svg b/third_party/WebKit/Source/devtools/front_end/Images/src/settingsListRemove.svg deleted file mode 100644 index 66db651..0000000 --- a/third_party/WebKit/Source/devtools/front_end/Images/src/settingsListRemove.svg +++ /dev/null
@@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?><svg height="16" version="1.1" width="48" xmlns="http://www.w3.org/2000/svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" -><defs -/><sodipodi:namedview showgrid="false" -/><path d="M3 4.43 4.43 3 13 11.57 11.57 13z" fill="#8d8d8d" -/><path d="M4.43 13 3 11.57 11.57 3 13 4.43z" fill="#8d8d8d" -/><path d="M4.4 12.97 3.41 11.98 11.6 3.79 12.59 4.79z" fill="#ccc" -/><path d="M12.59 11.98 11.6 12.97 3.41 4.79 4.4 3.79z" fill="#ccc" -/><path d="m19 4.43 1.43-1.43 8.57 8.57-1.43 1.43z" fill="#121212" -/><path d="m20.43 13-1.43-1.43 8.57-8.57 1.43 1.43z" fill="#121212" -/><path d="m20.4 12.97-0.99-0.99 8.19-8.19 0.99 0.99z" fill="#26262f" fill-opacity="0.94" -/><path d="m28.59 11.98-0.99 0.99-8.19-8.19 0.99-0.99z" fill="#26262f" fill-opacity="0.94" -/><path d="m35 4.43 1.43-1.43 8.57 8.57-1.43 1.43z" fill="#2e2e2e" -/><path d="m36.43 13-1.43-1.43 8.57-8.57 1.43 1.43z" fill="#2e2e2e" -/><path d="m36.4 12.97-0.99-0.99 8.19-8.19 0.99 0.99z" fill="#787878" -/><path d="m44.59 11.98-0.99 0.99-8.19-8.19 0.99-0.99z" fill="#787878"/></svg -> \ No newline at end of file
diff --git a/third_party/WebKit/Source/devtools/front_end/Images/src/svg2png.hashes b/third_party/WebKit/Source/devtools/front_end/Images/src/svg2png.hashes index 295dce8b..169cc36 100644 --- a/third_party/WebKit/Source/devtools/front_end/Images/src/svg2png.hashes +++ b/third_party/WebKit/Source/devtools/front_end/Images/src/svg2png.hashes
@@ -5,10 +5,8 @@ "breakpointConditional.svg": "4cf90210b2af2ed84db2f60b07bcde28", "errorWave.svg": "e183fa242a22ed4784a92f6becbc2c45", "smallIcons.svg": "d884babbd1c785b92eb46ee736c95541", - "settingsListRemove.svg": "ce9e7c5c5cdaef28e6ee51d9478d5485", "toolbarButtonGlyphs.svg": "db0b7d1af08a57a11e5609e0b2cbbc01", "breakpoint.svg": "69cd92d807259c022791112809b97799", "treeoutlineTriangles.svg": "017d2f89437df0afc6b9cd5ff43735d9", - "search.svg": "fc990dd3836aec510d7ca1f36c2a3142", "audits_logo.svg": "647095d7981857c22a816eef12f75b91" -} \ No newline at end of file +}
diff --git a/third_party/WebKit/Source/devtools/front_end/Images/toolbarItemSelected.png b/third_party/WebKit/Source/devtools/front_end/Images/toolbarItemSelected.png deleted file mode 100644 index 505daf2..0000000 --- a/third_party/WebKit/Source/devtools/front_end/Images/toolbarItemSelected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/Source/devtools/front_end/Images/toolbarResizerHorizontal.png b/third_party/WebKit/Source/devtools/front_end/Images/toolbarResizerHorizontal.png deleted file mode 100644 index 674b895..0000000 --- a/third_party/WebKit/Source/devtools/front_end/Images/toolbarResizerHorizontal.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/Source/devtools/front_end/Images/transformControls.png b/third_party/WebKit/Source/devtools/front_end/Images/transformControls.png deleted file mode 100644 index 53b73d06..0000000 --- a/third_party/WebKit/Source/devtools/front_end/Images/transformControls.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/Source/devtools/front_end/Images/transformControls_2x.png b/third_party/WebKit/Source/devtools/front_end/Images/transformControls_2x.png deleted file mode 100644 index ba831929..0000000 --- a/third_party/WebKit/Source/devtools/front_end/Images/transformControls_2x.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js index 59263a5..27a37e2 100644 --- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js +++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
@@ -54,31 +54,47 @@ * @type {!Array.<!Console.ConsoleView.RegexMatchRange>} */ this._regexMatchRanges = []; + this._filter = new Console.ConsoleViewFilter(this._updateMessageList.bind(this)); this._executionContextComboBox = new UI.ToolbarComboBox(null, 'console-context'); - this._executionContextComboBox.setMaxWidth(200); + this._executionContextComboBox.setMaxWidth(80); this._consoleContextSelector = new Console.ConsoleContextSelector(this._executionContextComboBox.selectElement()); - this._showAllMessagesCheckbox = new UI.ToolbarCheckbox(Common.UIString('Show all messages')); - this._filter = new Console.ConsoleViewFilter(this._showAllMessagesCheckbox, this._updateMessageList.bind(this)); + this._showSettingsPaneSetting = Common.settings.createSetting('consoleShowSettingsToolbar', false); + this._showSettingsPaneButton = new UI.ToolbarSettingToggle( + this._showSettingsPaneSetting, 'largeicon-settings-gear', Common.UIString('Console settings')); - this._filterBar = new UI.FilterBar('consoleView'); - - this._preserveLogCheckbox = new UI.ToolbarCheckbox( - Common.UIString('Preserve log'), Common.UIString('Do not clear log on page reload / navigation'), - Common.moduleSetting('preserveConsoleLog')); this._progressToolbarItem = new UI.ToolbarItem(createElement('div')); var toolbar = new UI.Toolbar('', this._contentsElement); toolbar.appendToolbarItem(UI.Toolbar.createActionButton( /** @type {!UI.Action }*/ (UI.actionRegistry.action('console.clear')))); - toolbar.appendToolbarItem(this._filterBar.filterButton()); + toolbar.appendSeparator(); toolbar.appendToolbarItem(this._executionContextComboBox); - toolbar.appendToolbarItem(this._preserveLogCheckbox); + toolbar.appendSeparator(); + toolbar.appendToolbarItem(this._filter._textFilterUI); + toolbar.appendToolbarItem(this._filter._levelComboBox); toolbar.appendToolbarItem(this._progressToolbarItem); + toolbar.appendSpacer(); + toolbar.appendText(''); + toolbar.appendSeparator(); + toolbar.appendToolbarItem(this._showSettingsPaneButton); - this._filterBar.show(this._contentsElement); - this._filter.addFilters(this._filterBar); + this._preserveLogCheckbox = new UI.ToolbarCheckbox( + Common.UIString('Preserve log'), Common.UIString('Do not clear log on page reload / navigation'), + Common.moduleSetting('preserveConsoleLog')); + this._hideNetworkMessagesCheckbox = new UI.ToolbarCheckbox( + Common.UIString('Hide network'), Common.UIString('Hide network messages'), + this._filter._hideNetworkMessagesSetting); + + var settingsToolbar = new UI.Toolbar('', this._contentsElement); + settingsToolbar.appendToolbarItem(this._hideNetworkMessagesCheckbox); + settingsToolbar.appendToolbarItem(this._preserveLogCheckbox); + settingsToolbar.appendToolbarItem(this._filter._showTargetMessagesCheckbox); + if (!this._showSettingsPaneSetting.get()) + settingsToolbar.element.classList.add('hidden'); + this._showSettingsPaneSetting.addChangeListener( + () => settingsToolbar.element.classList.toggle('hidden', !this._showSettingsPaneSetting.get())); this._viewport = new Console.ConsoleViewport(this); this._viewport.setStickToBottom(true); @@ -95,9 +111,6 @@ this._messagesElement.insertBefore(this._filterStatusMessageElement, this._messagesElement.firstChild); this._filterStatusTextElement = this._filterStatusMessageElement.createChild('span', 'console-info'); this._filterStatusMessageElement.createTextChild(' '); - this._resetFiltersLink = createElementWithClass('span', 'link'); - this._resetFiltersLink.textContent = Common.UIString('filters'); - this._resetFiltersLink.addEventListener('click', () => this._filterBar.showOnce(), true); this._topGroup = Console.ConsoleGroup.createTopGroup(); this._currentGroup = this._topGroup; @@ -112,13 +125,6 @@ var selectAllFixer = this._messagesElement.createChild('div', 'console-view-fix-select-all'); selectAllFixer.textContent = '.'; - this._showAllMessagesCheckbox.inputElement.checked = true; - this._showAllMessagesCheckbox.inputElement.addEventListener('change', this._updateMessageList.bind(this), false); - - this._showAllMessagesCheckbox.element.classList.add('hidden'); - - toolbar.appendToolbarItem(this._showAllMessagesCheckbox); - this._registerShortcuts(); this._messagesElement.addEventListener('contextmenu', this._handleContextMenuEvent.bind(this), false); @@ -269,7 +275,6 @@ */ targetAdded(target) { this._viewport.invalidate(); - this._updateAllMessagesCheckbox(); } /** @@ -277,12 +282,6 @@ * @param {!SDK.Target} target */ targetRemoved(target) { - this._updateAllMessagesCheckbox(); - } - - _updateAllMessagesCheckbox() { - var hasMultipleCotexts = SDK.targetManager.targets(SDK.Target.Capability.JS).length > 1; - this._showAllMessagesCheckbox.element.classList.toggle('hidden', !hasMultipleCotexts); } _registerWithMessageSink() { @@ -328,7 +327,7 @@ _executionContextChanged() { this._prompt.clearAutocomplete(); - if (!this._showAllMessagesCheckbox.checked()) + if (this._filter._showTargetMessagesCheckbox.checked()) this._updateMessageList(); } @@ -427,10 +426,9 @@ _updateFilterStatus() { this._filterStatusTextElement.removeChildren(); - this._filterStatusTextElement.appendChild(UI.formatLocalized( - this._hiddenByFilterCount === 1 ? '1 message is hidden by %s.' : - this._hiddenByFilterCount + ' messages are hidden by %s.', - [this._resetFiltersLink])); + this._filterStatusTextElement.createTextChild(Common.UIString( + this._hiddenByFilterCount === 1 ? '1 message is hidden by filters.' : + this._hiddenByFilterCount + ' messages are hidden by filters.')); this._filterStatusMessageElement.style.display = this._hiddenByFilterCount ? '' : 'none'; } @@ -1036,14 +1034,13 @@ /** * @unrestricted */ -Console.ConsoleViewFilter = class extends Common.Object { +Console.ConsoleViewFilter = class { /** - * @param {!UI.ToolbarCheckbox} showAllMessagesCheckbox * @param {function()} filterChangedCallback */ - constructor(showAllMessagesCheckbox, filterChangedCallback) { - super(); - this._showAllMessagesCheckbox = showAllMessagesCheckbox; + constructor(filterChangedCallback) { + this._showTargetMessagesCheckbox = + new UI.ToolbarCheckbox(Common.UIString('Selected context only'), undefined, undefined, filterChangedCallback); this._filterChanged = filterChangedCallback; this._messageURLFiltersSetting = Common.settings.createSetting('messageURLFilters', {}); @@ -1054,15 +1051,9 @@ this._messageURLFiltersSetting.addChangeListener(this._filterChanged); this._messageLevelFiltersSetting.addChangeListener(this._filterChanged); this._hideNetworkMessagesSetting.addChangeListener(this._filterChanged); - } - addFilters(filterBar) { - this._textFilterUI = new UI.TextFilterUI(true); - this._textFilterUI.addEventListener(UI.FilterUI.Events.FilterChanged, this._textFilterChanged, this); - filterBar.addFilter(this._textFilterUI); - - this._hideNetworkMessagesCheckbox = - new UI.CheckboxFilterUI('', Common.UIString('Hide network'), true, this._hideNetworkMessagesSetting); + this._textFilterUI = new UI.ToolbarInput(Common.UIString('Filter'), 0.2, 1); + this._textFilterUI.addEventListener(UI.ToolbarInput.Event.TextChanged, this._textFilterChanged, this); var levels = [ {value: SDK.ConsoleMessage.MessageLevel.Verbose, label: Common.UIString('Verbose')}, @@ -1071,13 +1062,19 @@ {value: SDK.ConsoleMessage.MessageLevel.Error, label: Common.UIString('Errors')} ]; - var levelFilter = new UI.ComboBoxFilterUI(levels, Common.UIString('Level: '), this._messageLevelFiltersSetting); - filterBar.addFilter(levelFilter); - filterBar.addFilter(this._hideNetworkMessagesCheckbox); + this._levelComboBox = + new UI.ToolbarSettingComboBox(levels, this._messageLevelFiltersSetting, Common.UIString('Level')); } - _textFilterChanged(event) { - this._filterRegex = this._textFilterUI.regex(); + _textFilterChanged() { + this._filterText = this._textFilterUI.value(); + this._filterRegex = null; + if (this._filterText.startsWith('/') && this._filterText.endsWith('/')) { + try { + this._filterRegex = new RegExp(this._filterText.substring(1, this._filterText.length - 1), 'i'); + } catch (e) { + } + } this._filterChanged(); } @@ -1121,14 +1118,14 @@ if (!message.target()) return true; - if (!this._showAllMessagesCheckbox.checked() && executionContext) { + if (this._showTargetMessagesCheckbox.checked() && executionContext) { if (message.target() !== executionContext.target()) return false; if (message.executionContextId && message.executionContextId !== executionContext.id) return false; } - if (Common.moduleSetting('hideNetworkMessages').get() && + if (this._hideNetworkMessagesSetting.get() && viewMessage.consoleMessage().source === SDK.ConsoleMessage.MessageSource.Network) return false; @@ -1148,9 +1145,11 @@ return false; if (this._filterRegex) { - this._filterRegex.lastIndex = 0; if (!viewMessage.matchesFilterRegex(this._filterRegex)) return false; + } else if (this._filterText) { + if (!viewMessage.matchesFilterText(this._filterText)) + return false; } return true; @@ -1159,10 +1158,10 @@ reset() { this._messageURLFiltersSetting.set({}); this._messageLevelFiltersSetting.set(SDK.ConsoleMessage.MessageLevel.Info); - this._showAllMessagesCheckbox.inputElement.checked = true; - Common.moduleSetting('hideNetworkMessages').set(false); + this._showTargetMessagesCheckbox.inputElement.checked = false; + this._hideNetworkMessagesSetting.set(false); this._textFilterUI.setValue(''); - this._filterChanged(); + this._textFilterChanged(); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js b/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js index 3215d2a..c4c5aea 100644 --- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js +++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js
@@ -817,6 +817,15 @@ return regexObject.test(text); } + /** + * @param {string} filter + * @return {boolean} + */ + matchesFilterText(filter) { + var text = this.contentElement().deepTextContent(); + return text.toLowerCase().includes(filter.toLowerCase()); + } + updateTimestamp() { if (!this._contentElement) return;
diff --git a/third_party/WebKit/Source/devtools/front_end/console/module.json b/third_party/WebKit/Source/devtools/front_end/console/module.json index 258492e8..63642bd3 100644 --- a/third_party/WebKit/Source/devtools/front_end/console/module.json +++ b/third_party/WebKit/Source/devtools/front_end/console/module.json
@@ -80,24 +80,6 @@ { "type": "setting", "category": "Console", - "title": "Hide violations", - "settingName": "hideViolationMessages", - "settingType": "boolean", - "defaultValue": true, - "options": [ - { - "value": true, - "title": "Hide violations" - }, - { - "value": false, - "title": "Show violations" - } - ] - }, - { - "type": "setting", - "category": "Console", "title": "Log XMLHttpRequests", "settingName": "monitoringXHREnabled", "settingType": "boolean",
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js index 186e9662..3fa83bd3 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js +++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
@@ -301,11 +301,14 @@ Common.UIString('Memory'), this._showMemorySetting, Common.UIString('Show memory timeline.')); this._panelToolbar.appendToolbarItem(this._showMemoryToolbarCheckbox); - // Settings - this._panelToolbar.appendToolbarItem(this._showSettingsPaneButton); - // GC this._panelToolbar.appendToolbarItem(UI.Toolbar.createActionButtonForId('components.collect-garbage')); + + // Settings + this._panelToolbar.appendSpacer(); + this._panelToolbar.appendText(''); + this._panelToolbar.appendSeparator(); + this._panelToolbar.appendToolbarItem(this._showSettingsPaneButton); } _createSettingsPane() { @@ -720,12 +723,12 @@ centered.createChild('p').appendChild(UI.formatLocalized( 'To capture a new recording, click the record button or hit %s.%s' + - 'To evaluate the page load, click the reload button or hit %s to record the reload.', + 'To evaluate the page load, click the reload button or hit %s to record the reload.', [recordNode, createElement('br'), reloadNode])); centered.createChild('p').appendChild(UI.formatLocalized( 'After recording, select an area of interest in the overview by dragging. ' + - 'Then, zoom and pan the timeline with the mousewheel or %s keys. %s', + 'Then, zoom and pan the timeline with the mousewheel or %s keys. %s', [navigateNode, learnMoreNode])); var cpuProfilerHintSetting = Common.settings.createSetting('timelineShowProfilerHint', true); @@ -739,8 +742,8 @@ var performanceSpan = encloseWithTag('b', Common.UIString('Performance')); warning.createChild('div').appendChild(UI.formatLocalized( 'The %s panel provides the combined functionality of Timeline and CPU profiler.%s' + - 'The JavaScript CPU profiler will be removed shortly. Meanwhile, it\'s available under ' + - '%s \u2192 More Tools \u2192 JavaScript Profiler.', + 'The JavaScript CPU profiler will be removed shortly. Meanwhile, it\'s available under ' + + '%s \u2192 More Tools \u2192 JavaScript Profiler.', [performanceSpan, createElement('p'), UI.Icon.create('largeicon-menu')])); }
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js b/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js index 8e6f552..80c23c5 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js
@@ -553,12 +553,15 @@ /** * @param {string=} placeholder * @param {number=} growFactor + * @param {number=} shrinkFactor */ - constructor(placeholder, growFactor) { + constructor(placeholder, growFactor, shrinkFactor) { super(createElementWithClass('input', 'toolbar-item')); this.element.addEventListener('input', this._onChangeCallback.bind(this), false); if (growFactor) this.element.style.flexGrow = growFactor; + if (shrinkFactor) + this.element.style.flexShrink = shrinkFactor; if (placeholder) this.element.setAttribute('placeholder', placeholder); this._value = ''; @@ -895,6 +898,68 @@ /** * @unrestricted */ +UI.ToolbarSettingComboBox = class extends UI.ToolbarComboBox { + /** + * @param {!Array.<!{value: string, label: string, title: string, default:(boolean|undefined)}>} options + * @param {!Common.Setting} setting + * @param {string=} optGroup + */ + constructor(options, setting, optGroup) { + super(null); + this._setting = setting; + this._options = options; + this._selectElement.addEventListener('change', this._valueChanged.bind(this), false); + var optionContainer = this._selectElement; + var optGroupElement = optGroup ? this._selectElement.createChild('optgroup') : null; + if (optGroupElement) { + optGroupElement.label = optGroup; + optionContainer = optGroupElement; + } + for (var i = 0; i < options.length; ++i) { + var dataOption = options[i]; + var option = this.createOption(dataOption.label, dataOption.title, dataOption.value); + optionContainer.appendChild(option); + if (setting.get() === dataOption.value) + this.setSelectedIndex(i); + } + + setting.addChangeListener(this._settingChanged, this); + } + + /** + * @return {string} + */ + value() { + return this._options[this.selectedIndex()].value; + } + + _settingChanged() { + if (this._muteSettingListener) + return; + + var value = this._setting.get(); + for (var i = 0; i < this._options.length; ++i) { + if (value === this._options[i].value) { + this.setSelectedIndex(i); + break; + } + } + } + + /** + * @param {!Event} event + */ + _valueChanged(event) { + var option = this._options[this.selectedIndex()]; + this._muteSettingListener = true; + this._setting.set(option.value); + this._muteSettingListener = false; + } +}; + +/** + * @unrestricted + */ UI.ToolbarCheckbox = class extends UI.ToolbarItem { /** * @param {string} text
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/toolbar.css b/third_party/WebKit/Source/devtools/front_end/ui/toolbar.css index 98fa05e4..6223cbf 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/toolbar.css +++ b/third_party/WebKit/Source/devtools/front_end/ui/toolbar.css
@@ -201,7 +201,7 @@ /* Input */ input.toolbar-item { - width: 200px; + width: 120px; height: 20px; padding: 3px; margin: 1px 3px;
diff --git a/third_party/WebKit/Source/modules/bluetooth/Bluetooth.cpp b/third_party/WebKit/Source/modules/bluetooth/Bluetooth.cpp index 5174625..3f2e4fa 100644 --- a/third_party/WebKit/Source/modules/bluetooth/Bluetooth.cpp +++ b/third_party/WebKit/Source/modules/bluetooth/Bluetooth.cpp
@@ -25,14 +25,6 @@ namespace blink { namespace { -// A name coming from an adv packet is max 29 bytes (adv packet max size -// 31 bytes - 2 byte length field), but the name can also be acquired via -// gap.device_name, so it is limited to the max EIR packet size of 240 bytes. -// See Core Spec 5.0, vol 3, C, 8.1.2. -const size_t kMaxFilterNameLength = 240; -const char kFilterNameTooLong[] = - "A 'name' or 'namePrefix' longer than 240 bytes results in no devices " - "being found, because a device can't acquire a name longer than 240 bytes."; // Per the Bluetooth Spec: The name is a user-friendly name associated with the // device and consists of a maximum of 248 bytes coded according to the UTF-8 // standard. @@ -73,10 +65,6 @@ exceptionState.throwTypeError(kDeviceNameTooLong); return; } - if (nameLength > kMaxFilterNameLength) { - exceptionState.throwDOMException(NotFoundError, kFilterNameTooLong); - return; - } canonicalizedFilter->name = filter.name(); } @@ -86,10 +74,6 @@ exceptionState.throwTypeError(kDeviceNameTooLong); return; } - if (namePrefixLength > kMaxFilterNameLength) { - exceptionState.throwDOMException(NotFoundError, kFilterNameTooLong); - return; - } if (filter.namePrefix().length() == 0) { exceptionState.throwTypeError( "'namePrefix', if present, must me non-empty.");
diff --git a/third_party/WebKit/Source/modules/bluetooth/testing/clusterfuzz/wbt_fakes.py b/third_party/WebKit/Source/modules/bluetooth/testing/clusterfuzz/wbt_fakes.py index 530c2d4..dddb407 100644 --- a/third_party/WebKit/Source/modules/bluetooth/testing/clusterfuzz/wbt_fakes.py +++ b/third_party/WebKit/Source/modules/bluetooth/testing/clusterfuzz/wbt_fakes.py
@@ -34,7 +34,7 @@ 'heart_rate', 'human_interface_device', 'device_information', - 'a_device_name_that_is_longer_than_29_bytes_but_shorter_than_240_bytes', + 'a_device_name_that_is_longer_than_29_bytes_but_shorter_than_248_bytes', BLOCKLISTED_UUID, CONNECTION_ERROR_UUIDS[0], DISCONNECTION_UUID, @@ -49,7 +49,7 @@ 'generic_access', 'heart_rate', 'human_interface_device', - 'a_device_name_that_is_longer_than_29_bytes_but_shorter_than_240_bytes', + 'a_device_name_that_is_longer_than_29_bytes_but_shorter_than_248_bytes', BLOCKLISTED_UUID, DISCONNECTION_UUID, GATT_ERROR_UUID, @@ -140,7 +140,7 @@ ), ( 'DeviceNameLongerThan29BytesAdapter', - ['a_device_name_that_is_longer_than_29_bytes_but_shorter_than_240_bytes'], + ['a_device_name_that_is_longer_than_29_bytes_but_shorter_than_248_bytes'], ), ]
diff --git a/third_party/WebKit/Source/modules/eventsource/OWNERS b/third_party/WebKit/Source/modules/eventsource/OWNERS index c7dc007..f68039b 100644 --- a/third_party/WebKit/Source/modules/eventsource/OWNERS +++ b/third_party/WebKit/Source/modules/eventsource/OWNERS
@@ -1,5 +1,4 @@ tyoshino@chromium.org yhirano@chromium.org -# TEAM: blink-network-stack@google.com # COMPONENT: Blink>Network
diff --git a/third_party/WebKit/Source/modules/fetch/OWNERS b/third_party/WebKit/Source/modules/fetch/OWNERS index 9595a97..fd48f75d 100644 --- a/third_party/WebKit/Source/modules/fetch/OWNERS +++ b/third_party/WebKit/Source/modules/fetch/OWNERS
@@ -3,5 +3,4 @@ tyoshino@chromium.org yhirano@chromium.org -# TEAM: blink-network-stack@google.com # COMPONENT: Blink>Network>FetchAPI
diff --git a/third_party/WebKit/Source/modules/websockets/OWNERS b/third_party/WebKit/Source/modules/websockets/OWNERS index 055777f..f7ce2d3 100644 --- a/third_party/WebKit/Source/modules/websockets/OWNERS +++ b/third_party/WebKit/Source/modules/websockets/OWNERS
@@ -1,5 +1,4 @@ tyoshino@chromium.org yhirano@chromium.org -# TEAM: blink-network-stack@google.com # COMPONENT: Blink>Network>WebSockets
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_github.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_github.py index 55f8cd4..c5ab1ff 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_github.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_github.py
@@ -5,13 +5,8 @@ import base64 import json import logging -import os -import sys import urllib2 -from webkitpy.common.system.filesystem import FileSystem -from webkitpy.common.webkit_finder import WebKitFinder - _log = logging.getLogger(__name__) API_BASE = 'https://api.github.com' @@ -20,12 +15,11 @@ class WPTGitHub(object): - def __init__(self, host): + def __init__(self, host, user, token): self.host = host - self.user = self.host.environ.get('GH_USER') - self.token = self.host.environ.get('GH_TOKEN') - - assert self.user and self.token, 'must have GH_USER and GH_TOKEN env vars' + self.user = user + self.token = token + assert self.user and self.token def auth_token(self): return base64.encodestring('{}:{}'.format(self.user, self.token)).strip()
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_github_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_github_unittest.py index 34025ac..84f515d 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_github_unittest.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_github_unittest.py
@@ -4,39 +4,20 @@ import base64 import unittest + from webkitpy.common.host_mock import MockHost from webkitpy.w3c.wpt_github import WPTGitHub -class WPTGitHubEnvTest(unittest.TestCase): - - def setUp(self): - self.host = MockHost() - - def test_requires_env_vars(self): - self.assertRaises(AssertionError, lambda: WPTGitHub(self.host)) - - def test_requires_gh_user_env_var(self): - self.host.environ['GH_USER'] = 'rutabaga' - self.assertRaises(AssertionError, lambda: WPTGitHub(self.host)) - - def test_requires_gh_token_env_var(self): - self.host.environ['GH_TOKEN'] = 'deadbeefcafe' - self.assertRaises(AssertionError, lambda: WPTGitHub(self.host)) - - class WPTGitHubTest(unittest.TestCase): - def setUp(self): - self.host = MockHost() - self.host.environ['GH_USER'] = 'rutabaga' - self.host.environ['GH_TOKEN'] = 'deadbeefcafe' - self.wpt_github = WPTGitHub(self.host) - - def test_properties(self): - self.assertEqual(self.wpt_github.user, 'rutabaga') - self.assertEqual(self.wpt_github.token, 'deadbeefcafe') + def test_init(self): + wpt_github = WPTGitHub(MockHost(), user='rutabaga', token='deadbeefcafe') + self.assertEqual(wpt_github.user, 'rutabaga') + self.assertEqual(wpt_github.token, 'deadbeefcafe') def test_auth_token(self): - expected = base64.encodestring('rutabaga:deadbeefcafe').strip() - self.assertEqual(self.wpt_github.auth_token(), expected) + wpt_github = wpt_github = WPTGitHub(MockHost(), user='rutabaga', token='deadbeefcafe') + self.assertEqual( + wpt_github.auth_token(), + base64.encodestring('rutabaga:deadbeefcafe').strip())
diff --git a/third_party/WebKit/Tools/Scripts/wpt-export b/third_party/WebKit/Tools/Scripts/wpt-export index f19ddab..0b3e4ae 100755 --- a/third_party/WebKit/Tools/Scripts/wpt-export +++ b/third_party/WebKit/Tools/Scripts/wpt-export
@@ -29,10 +29,24 @@ '--dry-run', action='store_true', help='See what would be done without actually creating or merging ' 'any pull requests.') + parser.add_argument( + '--user', + help='GitHub user name. Can also be provided using the GH_USER ' + 'environment variable.') + parser.add_argument( + '--token', + help='GitHub token or password. Can also be provided using the GH_TOKEN ' + 'environment variable.') args = parser.parse_args() - host = Host() - wpt_github = WPTGitHub(host) + if not args.user: + args.user = host.environ.get('GH_USER') + if not args.token: + args.token = host.environ.get('GH_TOKEN') + if not (args.user and args.token): + parser.error('Must provide both user and token for GitHub.') + + wpt_github = WPTGitHub(host, args.user, args.token) test_exporter = TestExporter(host, wpt_github, dry_run=args.dry_run) test_exporter.run()
diff --git a/third_party/WebKit/public/platform/modules/websockets/OWNERS b/third_party/WebKit/public/platform/modules/websockets/OWNERS index 48a1752..64084106 100644 --- a/third_party/WebKit/public/platform/modules/websockets/OWNERS +++ b/third_party/WebKit/public/platform/modules/websockets/OWNERS
@@ -4,5 +4,4 @@ per-file *.mojom=set noparent per-file *.mojom=file://ipc/SECURITY_OWNERS -# TEAM: blink-network-stack@google.com # COMPONENT: Blink>Network>WebSockets
diff --git a/third_party/pywebsocket/OWNERS b/third_party/pywebsocket/OWNERS index 055777f..f7ce2d3 100644 --- a/third_party/pywebsocket/OWNERS +++ b/third_party/pywebsocket/OWNERS
@@ -1,5 +1,4 @@ tyoshino@chromium.org yhirano@chromium.org -# TEAM: blink-network-stack@google.com # COMPONENT: Blink>Network>WebSockets
diff --git a/tools/chrome_proxy/webdriver/bypass.py b/tools/chrome_proxy/webdriver/bypass.py index d7d1b0c..3d5f3989 100644 --- a/tools/chrome_proxy/webdriver/bypass.py +++ b/tools/chrome_proxy/webdriver/bypass.py
@@ -23,5 +23,31 @@ for response in t.GetHTTPResponses(): self.assertNotHasChromeProxyViaHeader(response) + # Verify that CORS requests receive a block-once from the data reduction + # proxy by checking that those requests are retried without data reduction + # proxy. + def testCorsBypass(self): + with TestDriver() as test_driver: + test_driver.AddChromeArg('--enable-spdy-proxy-auth') + test_driver.LoadURL('http://www.gstatic.com/chrome/googlezip/cors/') + + # Navigate to a different page to verify that later requests are not + # blocked. + test_driver.LoadURL('http://check.googlezip.net/test.html') + + cors_requests = 0 + same_origin_requests = 0 + for response in test_driver.GetHTTPResponses(): + # The origin header implies that |response| is a CORS request. + if ('origin' not in response.request_headers): + self.assertHasChromeProxyViaHeader(response) + same_origin_requests = same_origin_requests + 1 + else: + self.assertNotHasChromeProxyViaHeader(response) + cors_requests = cors_requests + 1 + # Verify that both CORS and same origin requests were seen. + self.assertNotEqual(0, same_origin_requests) + self.assertNotEqual(0, cors_requests) + if __name__ == '__main__': IntegrationTest.RunAllTests()
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 2ea45cf..43c991ef 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -96428,6 +96428,7 @@ <int value="1495341532" label="disable-mtp-write-support"/> <int value="1496571153" label="enable-webapk"/> <int value="1497924954" label="js-flags"/> + <int value="1499163193" label="PostScriptPrinting:disabled"/> <int value="1505194447" label="disable-transition-compositing"/> <int value="1509901380" label="disable-drive-search-in-app-launcher"/> <int value="1510476448" label="disable-prefixed-encrypted-media"/> @@ -96532,6 +96533,7 @@ <int value="1969604362" label="enable-pinch-virtual-viewport"/> <int value="1980011075" label="debug-packed-apps"/> <int value="1980648371" label="PointerEventV1SpecCapturing:enabled"/> + <int value="1989877708" label="PostScriptPrinting:enabled"/> <int value="1992466116" label="enable-passive-event-listeners-due-to-fling"/> <int value="1993258379" label="enable-icon-ntp"/> <int value="1994431722" label="MaterialDesignUserMenu:disabled"/>
diff --git a/ui/display/display_layout.cc b/ui/display/display_layout.cc index bf20ae4b..9b5ee17 100644 --- a/ui/display/display_layout.cc +++ b/ui/display/display_layout.cc
@@ -5,6 +5,7 @@ #include "ui/display/display_layout.h" #include <algorithm> +#include <map> #include <set> #include <sstream> @@ -36,11 +37,265 @@ return iter != list.end(); } +// Extracts the displays IDs list from the displays list. +DisplayIdList DisplayListToDisplayIdList(const Displays& displays) { + DisplayIdList list; + for (const auto& display : displays) + list.emplace_back(display.id()); + + return list; +} + +// Ruturns nullptr if display with |id| is not found. Display* FindDisplayById(Displays* display_list, int64_t id) { auto iter = std::find_if(display_list->begin(), display_list->end(), [id](const Display& display) { return display.id() == id; }); - return &(*iter); + return iter == display_list->end() ? nullptr : &(*iter); +} + +// Returns the tree depth of the display with ID |display_id| from the tree root +// (i.e. from the primary display). +int GetDisplayTreeDepth( + int64_t display_id, + int64_t primary_id, + const std::map<int64_t, int64_t>& display_to_parent_ids_map) { + int64_t current_id = display_id; + int depth = 0; + const int kMaxDepth = 100; // Avoid layouts with cycles. + while (current_id != primary_id && depth < kMaxDepth) { + ++depth; + current_id = display_to_parent_ids_map.at(current_id); + } + + return depth; +} + +// Returns true if the child and parent displays are sharing a border that +// matches the child's relative position to its parent. +bool AreDisplaysTouching(const Display& child_display, + const Display& parent_display, + DisplayPlacement::Position child_position) { + const gfx::Rect& a_bounds = child_display.bounds(); + const gfx::Rect& b_bounds = parent_display.bounds(); + + if (child_position == DisplayPlacement::TOP || + child_position == DisplayPlacement::BOTTOM) { + const int rb = std::min(a_bounds.bottom(), b_bounds.bottom()); + const int ry = std::max(a_bounds.y(), b_bounds.y()); + return rb == ry; + } + + const int rx = std::max(a_bounds.x(), b_bounds.x()); + const int rr = std::min(a_bounds.right(), b_bounds.right()); + return rr == rx; +} + +// After the layout has been applied to the |display_list| and any possible +// overlaps have been fixed, this function is called to update the offsets in +// the |placement_list|. +void UpdateOffsets(Displays* display_list, + std::vector<DisplayPlacement>* placement_list) { + for (DisplayPlacement& placement : *placement_list) { + const Display* child_display = + FindDisplayById(display_list, placement.display_id); + const Display* parent_display = + FindDisplayById(display_list, placement.parent_display_id); + + if (!child_display || !parent_display) + continue; + + const gfx::Rect& child_bounds = child_display->bounds(); + const gfx::Rect& parent_bounds = parent_display->bounds(); + + if (placement.position == DisplayPlacement::TOP || + placement.position == DisplayPlacement::BOTTOM) { + placement.offset = child_bounds.x() - parent_bounds.x(); + } else { + placement.offset = child_bounds.y() - parent_bounds.y(); + } + } +} + +// Reparents |target_display| to |last_intersecting_source_display| if it's not +// touching with its current parent. +void MaybeReparentTargetDisplay( + int last_offset_x, + int last_offset_y, + const Display* last_intersecting_source_display, + const Display* target_display, + std::map<int64_t, int64_t>* display_to_parent_ids_map, + Displays* display_list, + std::vector<DisplayPlacement>* placement_list) { + // A de-intersection was performed. + // The offset target display may have moved such that it no longer touches + // its parent. Reparent if necessary. + const int64_t parent_display_id = + display_to_parent_ids_map->at(target_display->id()); + if (parent_display_id == last_intersecting_source_display->id()) { + // It was just de-intersected with the source display in such a way that + // they're touching, and the source display is its parent. So no need to + // do any reparenting. + return; + } + + Display* parent_display = FindDisplayById(display_list, parent_display_id); + DCHECK(parent_display); + + auto target_display_placement_itr = + std::find_if(placement_list->begin(), placement_list->end(), + [&target_display](const DisplayPlacement& p) { + return p.display_id == target_display->id(); + }); + DCHECK(target_display_placement_itr != placement_list->end()); + DisplayPlacement& target_display_placement = *target_display_placement_itr; + if (AreDisplaysTouching(*target_display, *parent_display, + target_display_placement.position)) { + return; + } + + // Reparent the target to source and update the position. No need to + // update the offset here as it will be done later when UpdateOffsets() + // is called. + target_display_placement.parent_display_id = + last_intersecting_source_display->id(); + // Update the map. + (*display_to_parent_ids_map)[target_display->id()] = + last_intersecting_source_display->id(); + + if (last_offset_x) { + target_display_placement.position = + last_offset_x > 0 ? DisplayPlacement::RIGHT : DisplayPlacement::LEFT; + } else { + target_display_placement.position = + last_offset_y > 0 ? DisplayPlacement::BOTTOM : DisplayPlacement::TOP; + } +} + +// Offsets |display| by the provided |x| and |y| values. +void OffsetDisplay(Display* display, int x, int y) { + gfx::Point new_origin = display->bounds().origin(); + new_origin.Offset(x, y); + gfx::Insets insets = display->GetWorkAreaInsets(); + display->set_bounds(gfx::Rect(new_origin, display->bounds().size())); + display->UpdateWorkAreaFromInsets(insets); +} + +// Calculates the amount of offset along the X or Y axes for the target display +// with |target_bounds| to de-intersect with the source display with +// |source_bounds|. +// These functions assume both displays already intersect. +int CalculateOffsetX(const gfx::Rect& source_bounds, + const gfx::Rect& target_bounds) { + if (target_bounds.x() >= 0) { + // Target display moves along the +ve X direction. + return source_bounds.right() - target_bounds.x(); + } + + // Target display moves along the -ve X direction. + return -(target_bounds.right() - source_bounds.x()); +} +int CalculateOffsetY(const gfx::Rect& source_bounds, + const gfx::Rect& target_bounds) { + if (target_bounds.y() >= 0) { + // Target display moves along the +ve Y direction. + return source_bounds.bottom() - target_bounds.y(); + } + + // Target display moves along the -ve Y direction. + return -(target_bounds.bottom() - source_bounds.y()); +} + +// Fixes any overlapping displays and reparents displays if necessary. +void DeIntersectDisplays(int64_t primary_id, + Displays* display_list, + std::vector<DisplayPlacement>* placement_list, + std::set<int64_t>* updated_displays) { + std::map<int64_t, int64_t> display_to_parent_ids_map; + for (const DisplayPlacement& placement : *placement_list) { + display_to_parent_ids_map.insert( + std::make_pair(placement.display_id, placement.parent_display_id)); + } + + std::vector<Display*> sorted_displays; + for (Display& display : *display_list) + sorted_displays.push_back(&display); + + // Sort the displays first by their depth in the display hierarchy tree, and + // then by distance of their top left points from the origin. This way we + // process the displays starting at the root (the primary display), in the + // order of their decendence spanning out from the primary display. + std::sort(sorted_displays.begin(), sorted_displays.end(), [&](Display* d1, + Display* d2) { + const int d1_depth = + GetDisplayTreeDepth(d1->id(), primary_id, display_to_parent_ids_map); + const int d2_depth = + GetDisplayTreeDepth(d2->id(), primary_id, display_to_parent_ids_map); + + if (d1_depth != d2_depth) + return d1_depth < d2_depth; + + return d1->bounds().OffsetFromOrigin().LengthSquared() < + d2->bounds().OffsetFromOrigin().LengthSquared(); + }); + // This must result in the primary display being at the front of the list. + DCHECK_EQ(sorted_displays.front()->id(), primary_id); + + for (int i = 1; i < static_cast<int>(sorted_displays.size()); ++i) { + Display* target_display = sorted_displays[i]; + const Display* last_intersecting_source_display = nullptr; + int last_offset_x = 0; + int last_offset_y = 0; + for (int j = i - 1; j >= 0; --j) { + const Display* source_display = sorted_displays[j]; + const gfx::Rect source_bounds = source_display->bounds(); + const gfx::Rect target_bounds = target_display->bounds(); + + gfx::Rect intersection = source_bounds; + intersection.Intersect(target_bounds); + + if (intersection.IsEmpty()) + continue; + + // Calculate offsets along both X and Y axes such that either can remove + // the overlap, but choose and apply the smaller offset. This way we have + // more predictable results. + int offset_x = 0; + int offset_y = 0; + if (intersection.width()) + offset_x = CalculateOffsetX(source_bounds, target_bounds); + if (intersection.height()) + offset_y = CalculateOffsetY(source_bounds, target_bounds); + + if (offset_x == 0 && offset_y == 0) + continue; + + // Choose the smaller offset. + if (std::abs(offset_x) <= std::abs(offset_y)) + offset_y = 0; + else + offset_x = 0; + + OffsetDisplay(target_display, offset_x, offset_y); + updated_displays->insert(target_display->id()); + + // The most recent performed de-intersection data. + last_intersecting_source_display = source_display; + last_offset_x = offset_x; + last_offset_y = offset_y; + } + + if (!last_intersecting_source_display) + continue; + + MaybeReparentTargetDisplay(last_offset_x, last_offset_y, + last_intersecting_source_display, target_display, + &display_to_parent_ids_map, display_list, + placement_list); + } + + // The offsets might have changed and we must update them. + UpdateOffsets(display_list, placement_list); } } // namespace @@ -182,9 +437,19 @@ void DisplayLayout::ApplyToDisplayList(Displays* display_list, std::vector<int64_t>* updated_ids, - int minimum_offset_overlap) const { + int minimum_offset_overlap) { + if (placement_list.empty()) + return; + + if (!DisplayLayout::Validate(DisplayListToDisplayIdList(*display_list), + *this)) { + // Prevent invalid and non-relevant display layouts. + return; + } + // Layout from primary, then dependent displays. std::set<int64_t> parents; + std::set<int64_t> updated_displays; parents.insert(primary_id); while (parents.size()) { int64_t parent_id = *parents.begin(); @@ -192,21 +457,34 @@ for (const DisplayPlacement& placement : placement_list) { if (placement.parent_display_id == parent_id) { if (ApplyDisplayPlacement(placement, display_list, - minimum_offset_overlap) && - updated_ids) { - updated_ids->push_back(placement.display_id); + minimum_offset_overlap)) { + updated_displays.insert(placement.display_id); } parents.insert(placement.display_id); } } } + + // Now that all the placements have been applied, we must detect and fix any + // overlapping displays. + DeIntersectDisplays(primary_id, display_list, &placement_list, + &updated_displays); + + if (updated_ids) { + updated_ids->insert(updated_ids->begin(), updated_displays.begin(), + updated_displays.end()); + } } // static bool DisplayLayout::Validate(const DisplayIdList& list, const DisplayLayout& layout) { // The primary display should be in the list. - DCHECK(IsIdInList(layout.primary_id, list)); + if (!IsIdInList(layout.primary_id, list)) { + LOG(ERROR) << "The primary id: " << layout.primary_id + << " is not in the id list."; + return false; + } // Unified mode, or mirror mode switched from unified mode, // may not have the placement yet.
diff --git a/ui/display/display_layout.h b/ui/display/display_layout.h index e9f85f7..dfb783f 100644 --- a/ui/display/display_layout.h +++ b/ui/display/display_layout.h
@@ -86,10 +86,11 @@ // Applies the layout to the displays in |display_list|. // |updated_ids| (optional) contains the ids for displays whose bounds have // changed. |minimum_offset_overlap| represents the minimum required overlap - // between displays. + // between displays. Any overlap between displays will be fixed, and the + // display placement will be fixed. void ApplyToDisplayList(Displays* display_list, std::vector<int64_t>* updated_ids, - int minimum_offset_overlap) const; + int minimum_offset_overlap); // Validates the layout object. static bool Validate(const DisplayIdList& list, const DisplayLayout& layout);
diff --git a/ui/display/manager/display_manager.cc b/ui/display/manager/display_manager.cc index ed78526..68b7abf 100644 --- a/ui/display/manager/display_manager.cc +++ b/ui/display/manager/display_manager.cc
@@ -208,6 +208,11 @@ return layout; } +const DisplayLayout& DisplayManager::GetCurrentResolvedDisplayLayout() const { + return current_resolved_layout_ ? *current_resolved_layout_ + : GetCurrentDisplayLayout(); +} + DisplayIdList DisplayManager::GetCurrentDisplayIdList() const { if (IsInUnifiedMode()) { return CreateDisplayIdList(software_mirroring_display_list_); @@ -246,7 +251,8 @@ // TODO(oshima): Call UpdateDisplays instead. std::vector<int64_t> updated_ids; - ApplyDisplayLayout(GetCurrentDisplayLayout(), &active_display_list_, + current_resolved_layout_ = GetCurrentDisplayLayout().Copy(); + ApplyDisplayLayout(current_resolved_layout_.get(), &active_display_list_, &updated_ids); for (int64_t id : updated_ids) { NotifyMetricsChanged(GetDisplayForId(id), @@ -1380,7 +1386,8 @@ // display_list does not have translation set, so ApplyDisplayLayout cannot // provide accurate change information. We'll find the changes after the call. - ApplyDisplayLayout(layout, display_list, nullptr); + current_resolved_layout_ = layout.Copy(); + ApplyDisplayLayout(current_resolved_layout_.get(), display_list, nullptr); size_t num_displays = display_list->size(); for (size_t index = 0; index < num_displays; ++index) { const Display& display = (*display_list)[index]; @@ -1400,11 +1407,17 @@ delegate_->CreateOrUpdateMirroringDisplay(list); } -void DisplayManager::ApplyDisplayLayout(const DisplayLayout& layout, +void DisplayManager::ApplyDisplayLayout(DisplayLayout* layout, Displays* display_list, std::vector<int64_t>* updated_ids) { - layout.ApplyToDisplayList(display_list, updated_ids, - kMinimumOverlapForInvalidOffset); + if (multi_display_mode_ == UNIFIED) { + // Applying the layout in unified mode doesn't make sense, since there's no + // layout. + return; + } + + layout->ApplyToDisplayList(display_list, updated_ids, + kMinimumOverlapForInvalidOffset); } void DisplayManager::RunPendingTasksForTest() {
diff --git a/ui/display/manager/display_manager.h b/ui/display/manager/display_manager.h index 604508a..c664402 100644 --- a/ui/display/manager/display_manager.h +++ b/ui/display/manager/display_manager.h
@@ -128,6 +128,9 @@ // Returns the display layout used for current displays. const DisplayLayout& GetCurrentDisplayLayout() const; + // Returns the actual display layout after it has been resolved and applied. + const DisplayLayout& GetCurrentResolvedDisplayLayout() const; + // Returns the current display list. DisplayIdList GetCurrentDisplayIdList() const; @@ -412,7 +415,7 @@ // Applies the |layout| and updates the bounds of displays in |display_list|. // |updated_ids| contains the ids for displays whose bounds have changed. - void ApplyDisplayLayout(const DisplayLayout& layout, + void ApplyDisplayLayout(DisplayLayout* layout, Displays* display_list, std::vector<int64_t>* updated_ids); @@ -427,6 +430,8 @@ std::unique_ptr<DisplayLayoutStore> layout_store_; + std::unique_ptr<DisplayLayout> current_resolved_layout_; + int64_t first_display_id_ = kInvalidDisplayId; // List of current active displays.
diff --git a/ui/display/mojo/BUILD.gn b/ui/display/mojo/BUILD.gn index 76f79e1..c0d0732 100644 --- a/ui/display/mojo/BUILD.gn +++ b/ui/display/mojo/BUILD.gn
@@ -7,6 +7,7 @@ mojom("interfaces") { sources = [ "display.mojom", + "display_mode.mojom", ] public_deps = [
diff --git a/ui/display/mojo/display_mode.mojom b/ui/display/mojo/display_mode.mojom new file mode 100644 index 0000000..892521ca --- /dev/null +++ b/ui/display/mojo/display_mode.mojom
@@ -0,0 +1,14 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module display.mojom; + +import "ui/gfx/geometry/mojo/geometry.mojom"; + +// Corresponds to display::DisplayMode +struct DisplayMode { + gfx.mojom.Size size; + bool is_interlaced; + float refresh_rate; +};
diff --git a/ui/display/mojo/display_mode.typemap b/ui/display/mojo/display_mode.typemap new file mode 100644 index 0000000..c37f44507 --- /dev/null +++ b/ui/display/mojo/display_mode.typemap
@@ -0,0 +1,14 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +mojom = "//ui/display/mojo/display_mode.mojom" +public_headers = [ "//ui/display/types/display_mode.h" ] +traits_headers = [ "//ui/display/mojo/display_mode_struct_traits.h" ] +public_deps = [ + "//ui/display", +] +deps = [ + "//ui/gfx/geometry", +] +type_mappings = [ "display.mojom.DisplayMode=std::unique_ptr<display::DisplayMode>[move_only]" ]
diff --git a/ui/display/mojo/display_mode_struct_traits.h b/ui/display/mojo/display_mode_struct_traits.h new file mode 100644 index 0000000..8d7d2bc0 --- /dev/null +++ b/ui/display/mojo/display_mode_struct_traits.h
@@ -0,0 +1,45 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_DISPLAY_MOJO_DISPLAY_MODE_STRUCT_TRAITS_H_ +#define UI_DISPLAY_MOJO_DISPLAY_MODE_STRUCT_TRAITS_H_ + +#include "ui/display/types/display_mode.h" +#include "ui/display/mojo/display_mode.mojom.h" +#include "ui/gfx/geometry/size.h" + +namespace mojo { + +template <> +struct StructTraits<display::mojom::DisplayModeDataView, + std::unique_ptr<display::DisplayMode>> { + static const gfx::Size& size( + const std::unique_ptr<display::DisplayMode>& display_mode) { + return display_mode->size(); + } + + static bool is_interlaced( + const std::unique_ptr<display::DisplayMode>& display_mode) { + return display_mode->is_interlaced(); + } + + static float refresh_rate( + const std::unique_ptr<display::DisplayMode>& display_mode) { + return display_mode->refresh_rate(); + } + + static bool Read(display::mojom::DisplayModeDataView data, + std::unique_ptr<display::DisplayMode>* out) { + gfx::Size size; + if (!data.ReadSize(&size)) + return false; + *out = base::MakeUnique<display::DisplayMode>(size, data.is_interlaced(), + data.refresh_rate()); + return true; + } +}; + +} // namespace mojo + +#endif // UI_DISPLAY_MOJO_DISPLAY_MODE_STRUCT_TRAITS_H_
diff --git a/ui/display/mojo/display_struct_traits_test.mojom b/ui/display/mojo/display_struct_traits_test.mojom index 1c20bf2..0f3216f 100644 --- a/ui/display/mojo/display_struct_traits_test.mojom +++ b/ui/display/mojo/display_struct_traits_test.mojom
@@ -5,9 +5,13 @@ module display.mojom; import "ui/display/mojo/display.mojom"; +import "ui/display/mojo/display_mode.mojom"; interface DisplayStructTraitsTest { [Sync] EchoDisplay(Display in) => (Display out); + + [Sync] + EchoDisplayMode(DisplayMode in) => (DisplayMode out); };
diff --git a/ui/display/mojo/display_struct_traits_unittest.cc b/ui/display/mojo/display_struct_traits_unittest.cc index a223bdd..64b7ba3 100644 --- a/ui/display/mojo/display_struct_traits_unittest.cc +++ b/ui/display/mojo/display_struct_traits_unittest.cc
@@ -7,6 +7,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "ui/display/display.h" #include "ui/display/mojo/display_struct_traits_test.mojom.h" +#include "ui/display/types/display_mode.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/size.h" @@ -31,6 +32,11 @@ callback.Run(in); } + void EchoDisplayMode(std::unique_ptr<DisplayMode> in, + const EchoDisplayModeCallback& callback) override { + callback.Run(std::move(in)); + } + base::MessageLoop loop_; // A MessageLoop is needed for Mojo IPC to work. mojo::BindingSet<mojom::DisplayStructTraitsTest> traits_test_bindings_; @@ -79,4 +85,22 @@ CheckDisplaysEqual(input, output); } +TEST_F(DisplayStructTraitsTest, DefaultDisplayMode) { + // Prepare sample input with random values + + std::unique_ptr<DisplayMode> input = + base::MakeUnique<DisplayMode>(gfx::Size(15, 29), true, 61.0); + + mojom::DisplayStructTraitsTestPtr proxy = GetTraitsTestProxy(); + std::unique_ptr<DisplayMode> output; + + proxy->EchoDisplayMode(input->Clone(), &output); + + // We want to test each component individually to make sure each data member + // was correctly serialized and deserialized. + EXPECT_EQ(input->size(), output->size()); + EXPECT_EQ(input->is_interlaced(), output->is_interlaced()); + EXPECT_EQ(input->refresh_rate(), output->refresh_rate()); +} + } // namespace display
diff --git a/ui/display/mojo/typemaps.gni b/ui/display/mojo/typemaps.gni index c527c4d7..3c2456c 100644 --- a/ui/display/mojo/typemaps.gni +++ b/ui/display/mojo/typemaps.gni
@@ -2,4 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -typemaps = [ "//ui/display/mojo/display.typemap" ] +typemaps = [ + "//ui/display/mojo/display.typemap", + "//ui/display/mojo/display_mode.typemap", +]
diff --git a/ui/ozone/platform/x11/ozone_platform_x11.cc b/ui/ozone/platform/x11/ozone_platform_x11.cc index 06458c6..6db5b67 100644 --- a/ui/ozone/platform/x11/ozone_platform_x11.cc +++ b/ui/ozone/platform/x11/ozone_platform_x11.cc
@@ -77,8 +77,7 @@ PlatformWindowDelegate* delegate, const gfx::Rect& bounds) override { std::unique_ptr<X11WindowOzone> window = base::MakeUnique<X11WindowOzone>( - event_source_.get(), window_manager_.get(), delegate); - window->SetBounds(bounds); + event_source_.get(), window_manager_.get(), delegate, bounds); window->Create(); window->SetTitle(base::ASCIIToUTF16("Ozone X11")); return std::move(window);
diff --git a/ui/platform_window/x11/x11_window.cc b/ui/platform_window/x11/x11_window.cc index f54b41667..3c4ee2a 100644 --- a/ui/platform_window/x11/x11_window.cc +++ b/ui/platform_window/x11/x11_window.cc
@@ -17,8 +17,8 @@ namespace ui { -X11Window::X11Window(PlatformWindowDelegate* delegate) - : X11WindowBase(delegate) { +X11Window::X11Window(PlatformWindowDelegate* delegate, const gfx::Rect& bounds) + : X11WindowBase(delegate, bounds) { DCHECK(PlatformEventSource::GetInstance()); PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this); }
diff --git a/ui/platform_window/x11/x11_window.h b/ui/platform_window/x11/x11_window.h index c3f15cf..388aab7 100644 --- a/ui/platform_window/x11/x11_window.h +++ b/ui/platform_window/x11/x11_window.h
@@ -16,7 +16,7 @@ class X11_WINDOW_EXPORT X11Window : public X11WindowBase, public PlatformEventDispatcher { public: - explicit X11Window(PlatformWindowDelegate* delegate); + X11Window(PlatformWindowDelegate* delegate, const gfx::Rect& bounds); ~X11Window() override; // PlatformWindow:
diff --git a/ui/platform_window/x11/x11_window_base.cc b/ui/platform_window/x11/x11_window_base.cc index 799933e..7d72b246 100644 --- a/ui/platform_window/x11/x11_window_base.cc +++ b/ui/platform_window/x11/x11_window_base.cc
@@ -41,12 +41,14 @@ } // namespace -X11WindowBase::X11WindowBase(PlatformWindowDelegate* delegate) +X11WindowBase::X11WindowBase(PlatformWindowDelegate* delegate, + const gfx::Rect& bounds) : delegate_(delegate), xdisplay_(gfx::GetXDisplay()), xwindow_(None), xroot_window_(DefaultRootWindow(xdisplay_)), - atom_cache_(xdisplay_, kAtomsToCache) { + atom_cache_(xdisplay_, kAtomsToCache), + bounds_(bounds) { DCHECK(delegate_); TouchFactory::SetTouchDeviceListFromCommandLine(); } @@ -70,19 +72,21 @@ } void X11WindowBase::Create() { + DCHECK(!bounds_.size().IsEmpty()); + XSetWindowAttributes swa; memset(&swa, 0, sizeof(swa)); swa.background_pixmap = None; swa.bit_gravity = NorthWestGravity; swa.override_redirect = g_override_redirect; - xwindow_ = XCreateWindow( - xdisplay_, xroot_window_, requested_bounds_.x(), requested_bounds_.y(), - requested_bounds_.width(), requested_bounds_.height(), - 0, // border width - CopyFromParent, // depth - InputOutput, - CopyFromParent, // visual - CWBackPixmap | CWBitGravity | CWOverrideRedirect, &swa); + xwindow_ = + XCreateWindow(xdisplay_, xroot_window_, bounds_.x(), bounds_.y(), + bounds_.width(), bounds_.height(), + 0, // border width + CopyFromParent, // depth + InputOutput, + CopyFromParent, // visual + CWBackPixmap | CWBitGravity | CWOverrideRedirect, &swa); // Setup XInput event mask. long event_mask = ButtonPressMask | ButtonReleaseMask | FocusChangeMask | @@ -135,8 +139,8 @@ // will ignore toplevel XMoveWindow commands. XSizeHints size_hints; size_hints.flags = PPosition | PWinGravity; - size_hints.x = requested_bounds_.x(); - size_hints.y = requested_bounds_.y(); + size_hints.x = bounds_.x(); + size_hints.y = bounds_.y(); // Set StaticGravity so that the window position is not affected by the // frame width when running with window manager. size_hints.win_gravity = StaticGravity; @@ -174,20 +178,30 @@ } void X11WindowBase::SetBounds(const gfx::Rect& bounds) { - requested_bounds_ = bounds; - if (!window_mapped_ || bounds == confirmed_bounds_) + if (bounds == bounds_) return; - XWindowChanges changes = {0}; - unsigned value_mask = CWX | CWY | CWWidth | CWHeight; - changes.x = bounds.x(); - changes.y = bounds.y(); - changes.width = bounds.width(); - changes.height = bounds.height(); - XConfigureWindow(xdisplay_, xwindow_, value_mask, &changes); + + if (window_mapped_) { + XWindowChanges changes = {0}; + unsigned value_mask = CWX | CWY | CWWidth | CWHeight; + changes.x = bounds.x(); + changes.y = bounds.y(); + changes.width = bounds.width(); + changes.height = bounds.height(); + XConfigureWindow(xdisplay_, xwindow_, value_mask, &changes); + } + + // Assume that the resize will go through as requested, which should be the + // case if we're running without a window manager. If there's a window + // manager, it can modify or ignore the request, but (per ICCCM) we'll get a + // (possibly synthetic) ConfigureNotify about the actual size and correct + // |bounds_| later. + bounds_ = bounds; + delegate_->OnBoundsChanged(bounds_); } gfx::Rect X11WindowBase::GetBounds() { - return confirmed_bounds_; + return bounds_; } void X11WindowBase::SetTitle(const base::string16& title) { @@ -222,8 +236,7 @@ void X11WindowBase::MoveCursorTo(const gfx::Point& location) { XWarpPointer(xdisplay_, None, xroot_window_, 0, 0, 0, 0, - confirmed_bounds_.x() + location.x(), - confirmed_bounds_.y() + location.y()); + bounds_.x() + location.x(), bounds_.y() + location.y()); } void X11WindowBase::ConfineCursorToBounds(const gfx::Rect& bounds) {} @@ -266,9 +279,9 @@ } gfx::Rect bounds(translated_x_in_pixels, translated_y_in_pixels, xev->xconfigure.width, xev->xconfigure.height); - if (confirmed_bounds_ != bounds) { - confirmed_bounds_ = bounds; - delegate_->OnBoundsChanged(confirmed_bounds_); + if (bounds_ != bounds) { + bounds_ = bounds; + delegate_->OnBoundsChanged(bounds_); } break; }
diff --git a/ui/platform_window/x11/x11_window_base.h b/ui/platform_window/x11/x11_window_base.h index aefbbcc..9e7e17b 100644 --- a/ui/platform_window/x11/x11_window_base.h +++ b/ui/platform_window/x11/x11_window_base.h
@@ -24,7 +24,7 @@ // are platform specific are left unimplemented. class X11_WINDOW_EXPORT X11WindowBase : public PlatformWindow { public: - explicit X11WindowBase(PlatformWindowDelegate* delegate); + X11WindowBase(PlatformWindowDelegate* delegate, const gfx::Rect& bounds); ~X11WindowBase() override; // Creates new underlying XWindow. Does not map XWindow. @@ -71,11 +71,8 @@ base::string16 window_title_; - // Setting the bounds is an asynchronous operation in X11. |requested_bounds_| - // is the bounds requested using XConfigureWindow, and |confirmed_bounds_| is - // the bounds the X11 server has set on the window. - gfx::Rect requested_bounds_; - gfx::Rect confirmed_bounds_; + // The bounds of |xwindow_|. + gfx::Rect bounds_; bool window_mapped_ = false;
diff --git a/ui/platform_window/x11/x11_window_ozone.cc b/ui/platform_window/x11/x11_window_ozone.cc index 13cf354a..c3051cb5 100644 --- a/ui/platform_window/x11/x11_window_ozone.cc +++ b/ui/platform_window/x11/x11_window_ozone.cc
@@ -18,8 +18,9 @@ X11WindowOzone::X11WindowOzone(X11EventSourceLibevent* event_source, X11WindowManagerOzone* window_manager, - PlatformWindowDelegate* delegate) - : X11WindowBase(delegate), + PlatformWindowDelegate* delegate, + const gfx::Rect& bounds) + : X11WindowBase(delegate, bounds), event_source_(event_source), window_manager_(window_manager) { DCHECK(event_source_);
diff --git a/ui/platform_window/x11/x11_window_ozone.h b/ui/platform_window/x11/x11_window_ozone.h index da847ecc..9f49af4b 100644 --- a/ui/platform_window/x11/x11_window_ozone.h +++ b/ui/platform_window/x11/x11_window_ozone.h
@@ -22,7 +22,8 @@ public: X11WindowOzone(X11EventSourceLibevent* event_source, X11WindowManagerOzone* window_manager, - PlatformWindowDelegate* delegate); + PlatformWindowDelegate* delegate, + const gfx::Rect& bounds); ~X11WindowOzone() override; // PlatformWindow:
diff --git a/ui/webui/resources/html/action_link_css.html b/ui/webui/resources/html/action_link_css.html index 024fa7da..9ece1d5 100644 --- a/ui/webui/resources/html/action_link_css.html +++ b/ui/webui/resources/html/action_link_css.html
@@ -24,6 +24,10 @@ opacity: 0.65; pointer-events: none; } + + [is='action-link'].no-outline { + outline: none; + } </style> </template> </dom-module>
diff --git a/url/gurl.cc b/url/gurl.cc index 43f3052..041001a 100644 --- a/url/gurl.cc +++ b/url/gurl.cc
@@ -12,6 +12,7 @@ #include "base/logging.h" #include "base/strings/string_piece.h" #include "base/strings/string_util.h" +#include "base/trace_event/memory_usage_estimator.h" #include "url/url_canon_stdstring.h" #include "url/url_util.h" @@ -474,6 +475,12 @@ inner_url_.swap(other->inner_url_); } +size_t GURL::EstimateMemoryUsage() const { + return base::trace_event::EstimateMemoryUsage(spec_) + + base::trace_event::EstimateMemoryUsage(inner_url_) + + (parsed_.inner_parsed() ? sizeof(url::Parsed) : 0); +} + std::ostream& operator<<(std::ostream& out, const GURL& url) { return out << url.possibly_invalid_spec(); }
diff --git a/url/gurl.h b/url/gurl.h index 5753230d..175cb60 100644 --- a/url/gurl.h +++ b/url/gurl.h
@@ -405,6 +405,10 @@ return inner_url_.get(); } + // Estimates dynamic memory usage. + // See base/trace_event/memory_usage_estimator.h for more info. + size_t EstimateMemoryUsage() const; + private: // Variant of the string parsing constructor that allows the caller to elect // retain trailing whitespace, if any, on the passed URL spec, but only if