diff --git a/.clang-tidy b/.clang-tidy index 8fc6db17..9a08d165 100644 --- a/.clang-tidy +++ b/.clang-tidy
@@ -6,6 +6,7 @@ bugprone-assert-side-effect, bugprone-bool-pointer-implicit-conversion, bugprone-dangling-handle, + bugprone-forward-declaration-namespace, bugprone-inaccurate-erase, bugprone-string-constructor, bugprone-string-integer-assignment,
diff --git a/DEPS b/DEPS index 9acef3c..974d329 100644 --- a/DEPS +++ b/DEPS
@@ -320,7 +320,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': '21381f5e1c4dffe6ce43121e8cd55803647896ca', + 'angle_revision': '0ed0de4f0b7f5a81fbe35b28e6a68a739f365556', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. @@ -328,7 +328,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. - 'pdfium_revision': 'ef0eeaa9e423c5aa002180cbc448f784c8e621ae', + 'pdfium_revision': '09fbd30d50a95a0939f28d5561b7c61ec04533d0', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling BoringSSL # and whatever else without interference from each other. @@ -387,7 +387,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling chromium_variations # and whatever else without interference from each other. - 'chromium_variations_revision': '2c5458c1057e9a8d69cfa6c15f42ef6446b1629a', + 'chromium_variations_revision': '4dcad64009561689b670e3474feabe23f8f38ef1', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling CrossBench # and whatever else without interference from each other. @@ -827,7 +827,7 @@ 'src/clank': { 'url': Var('chrome_git') + '/clank/internal/apps.git' + '@' + - '8a57d2d318a0d62648d9590be11bc6d60f247b7d', + '02bdd9c092ea06c0725790d86580609dd29f1df9', 'condition': 'checkout_android and checkout_src_internal', }, @@ -1205,7 +1205,7 @@ Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), 'src/third_party/devtools-frontend-internal': { - 'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + '9c278bd6f25a7da69b438b262acd0da6d2f78b1a', + 'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + 'f1e5383735bc898c30f28de269f82b1ea975cbb1', 'condition': 'checkout_src_internal', }, @@ -1665,7 +1665,7 @@ Var('pdfium_git') + '/pdfium.git' + '@' + Var('pdfium_revision'), 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + '98921c2a0c99fa8e97f5e6c369cc3e16473c695e', + Var('android_git') + '/platform/external/perfetto.git' + '@' + '22d2e541befaff7d4e62960aa761531c79b2e586', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '8ef97ff3b7332e38e61b347a2fbed425a4617151', @@ -1973,7 +1973,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/help_app/app', - 'version': 'yX3aqwi1ZvCy5HEUQqzEtnnnhPoKQZo8g1SkFgDTxEYC', + 'version': 'QirZmxUIzRgGFNM52KLcELPWm6ZfHJkn7QtoX0qpIXsC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -1984,7 +1984,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/media_app/app', - 'version': 'oItR7uvFa3UzB1_FfURZN_oceZdbKAQBLtGiyOp7occC', + 'version': 'SdNSoB5hJYgfMZuA-TLhW7CXvlkYXsLOttWn5ihsqGIC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -2017,7 +2017,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/projector_app/app', - 'version': 'GB7HSiK_48sadKBTgeQVvHWsliSshLDgAwJsQAKt1_QC', + 'version': 'fms9BGz44VtSbqhgdlrlbngqqcCTUZ2ideXAunuRtc4C', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -4036,7 +4036,7 @@ 'src/components/optimization_guide/internal': { 'url': Var('chrome_git') + '/chrome/components/optimization_guide.git' + '@' + - '7b2f0838de2b4376b099b37b142e8383182d89fd', + 'b7e6fb03e487cc73b04e63306c1e58f435efa6c4', 'condition': 'checkout_src_internal', },
diff --git a/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn b/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn index cb8d904..655a1c14 100644 --- a/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn +++ b/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn
@@ -201,7 +201,7 @@ "FORCE_ENABLE_RAW_PTR_EXCLUSION=$force_enable_raw_ptr_exclusion", - "USE_FULL_MTE=use_full_mte", + "USE_FULL_MTE=$use_full_mte", "RECORD_ALLOC_INFO=$_record_alloc_info", "USE_FREESLOT_BITMAP=$use_freeslot_bitmap",
diff --git a/base/win/.clang-tidy b/base/win/.clang-tidy index c9ed663..9724afa 100644 --- a/base/win/.clang-tidy +++ b/base/win/.clang-tidy
@@ -2,6 +2,7 @@ Checks: '-*, bugprone-argument-comment, bugprone-bool-pointer-implicit-conversion, + bugprone-forward-declaration-namespace, bugprone-unique-ptr-array-mismatch, bugprone-virtual-near-miss, google-build-namespaces,
diff --git a/chrome/VERSION b/chrome/VERSION index bf17e07..58713d7 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=124 MINOR=0 -BUILD=6333 +BUILD=6335 PATCH=0
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 66d55c0..2ce19d2 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -8794,13 +8794,6 @@ flag_descriptions::kWebIdentityDigitalCredentialsName, flag_descriptions::kWebIdentityDigitalCredentialsDescription, kOsAndroid, FEATURE_VALUE_TYPE(features::kWebIdentityDigitalCredentials)}, - {"autofill-highlight-only-changed-value-in-preview-mode", - flag_descriptions::kAutofillHighlightOnlyChangedValuesInPreviewModeName, - flag_descriptions:: - kAutofillHighlightOnlyChangedValuesInPreviewModeDescription, - kOsDesktop, - FEATURE_VALUE_TYPE( - autofill::features::kAutofillHighlightOnlyChangedValuesInPreviewMode)}, {"sanitizer-api", flag_descriptions::kSanitizerApiName, flag_descriptions::kSanitizerApiDescription, kOsAll,
diff --git a/chrome/browser/accessibility/media_app/ax_media_app.h b/chrome/browser/accessibility/media_app/ax_media_app.h index 569b12e5..f3b5498 100644 --- a/chrome/browser/accessibility/media_app/ax_media_app.h +++ b/chrome/browser/accessibility/media_app/ax_media_app.h
@@ -9,7 +9,7 @@ #include "content/public/browser/browser_context.h" #include "third_party/skia/include/core/SkBitmap.h" -#include "ui/gfx/geometry/insets.h" +#include "ui/gfx/geometry/rect_f.h" namespace ash { @@ -25,7 +25,7 @@ virtual void AccessibilityEnabledChanged(bool enabled) = 0; virtual content::BrowserContext* GetBrowserContext() const = 0; virtual SkBitmap RequestBitmap(const std::string& page_id) = 0; - virtual void SetViewport(const gfx::Insets& viewport_box) = 0; + virtual void SetViewport(const gfx::RectF& viewport_box) = 0; protected: AXMediaApp() = default;
diff --git a/chrome/browser/accessibility/media_app/ax_media_app_untrusted_handler.cc b/chrome/browser/accessibility/media_app/ax_media_app_untrusted_handler.cc index 73e5bc70..fd1d88ef 100644 --- a/chrome/browser/accessibility/media_app/ax_media_app_untrusted_handler.cc +++ b/chrome/browser/accessibility/media_app/ax_media_app_untrusted_handler.cc
@@ -9,6 +9,7 @@ #include <utility> #include "ash/constants/ash_features.h" +#include "base/check_is_test.h" #include "base/check_op.h" #include "base/feature_list.h" #include "base/functional/bind.h" @@ -25,6 +26,7 @@ #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/web_contents.h" +#include "mojo/public/cpp/bindings/message.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/accessibility/ax_action_data.h" #include "ui/accessibility/ax_node.h" @@ -41,8 +43,6 @@ namespace ash { -namespace { - // The ID used for the AX document root. constexpr ui::AXNodeID kDocumentRootNodeId = 1; @@ -55,6 +55,8 @@ // MediaApp and manage resources (caps the number of pages stored at a time). constexpr size_t kMaxPages = 10000; +namespace { + bool ReportIfNonExistentPageId( const std::string& context, const std::string& page_id, @@ -103,8 +105,9 @@ service_router->BindScreenAIAnnotator( screen_ai_annotator_.BindNewPipeAndPassReceiver()); OcrNextDirtyPageIfAny(); - if (media_app_) { + // `media_app_` is only used for testing. + CHECK_IS_TEST(); media_app_->OcrServiceEnabledChanged(true); } } @@ -116,6 +119,10 @@ void AXMediaAppUntrustedHandler::PerformAction( const ui::AXActionData& action_data) { + if (!document_.GetRoot()) { + return; + } + CHECK(document_.ax_tree()); switch (action_data.action) { case ax::mojom::Action::kBlur: case ax::mojom::Action::kClearAccessibilityFocus: @@ -127,17 +134,112 @@ case ax::mojom::Action::kGetImageData: case ax::mojom::Action::kIncrement: case ax::mojom::Action::kLoadInlineTextBoxes: - return; + return; // Irrelevant for Backlight. case ax::mojom::Action::kScrollBackward: + case ax::mojom::Action::kScrollUp: { + float y_min = static_cast<float>(document_.GetRoot()->GetIntAttribute( + ax::mojom::IntAttribute::kScrollYMin)); + viewport_box_.set_y( + std::max(viewport_box_.y() - viewport_box_.height(), y_min)); + if (media_app_) { + // `media_app_` is only used for testing. + CHECK_IS_TEST(); + media_app_->SetViewport(viewport_box_); + } + return; + } case ax::mojom::Action::kScrollForward: - case ax::mojom::Action::kScrollUp: - case ax::mojom::Action::kScrollDown: - case ax::mojom::Action::kScrollLeft: - case ax::mojom::Action::kScrollRight: - case ax::mojom::Action::kScrollToMakeVisible: + case ax::mojom::Action::kScrollDown: { + float y_max = static_cast<float>(document_.GetRoot()->GetIntAttribute( + ax::mojom::IntAttribute::kScrollYMax)); + viewport_box_.set_y( + std::min(viewport_box_.y() + viewport_box_.height(), y_max)); + if (media_app_) { + // `media_app_` is only used for testing. + CHECK_IS_TEST(); + media_app_->SetViewport(viewport_box_); + } + return; + } + case ax::mojom::Action::kScrollLeft: { + float x_min = static_cast<float>(document_.GetRoot()->GetIntAttribute( + ax::mojom::IntAttribute::kScrollXMin)); + viewport_box_.set_x( + std::max(viewport_box_.x() - viewport_box_.width(), x_min)); + if (media_app_) { + // `media_app_` is only used for testing. + CHECK_IS_TEST(); + media_app_->SetViewport(viewport_box_); + } + return; + } + case ax::mojom::Action::kScrollRight: { + float x_max = static_cast<float>(document_.GetRoot()->GetIntAttribute( + ax::mojom::IntAttribute::kScrollXMax)); + viewport_box_.set_x( + std::min(viewport_box_.x() + viewport_box_.width(), x_max)); + if (media_app_) { + // `media_app_` is only used for testing. + CHECK_IS_TEST(); + media_app_->SetViewport(viewport_box_); + } + return; + } + case ax::mojom::Action::kScrollToMakeVisible: { + if (!media_app_) { + CHECK_NE(action_data.target_tree_id, ui::AXTreeIDUnknown()); + } else { + // `media_app_` is only used for testing. + CHECK_IS_TEST(); + } + CHECK_NE(action_data.target_node_id, ui::kInvalidAXNodeID); + CHECK_EQ(pages_.size(), document_.GetRoot()->GetUnignoredChildCount()); + for (size_t page_index = 0u; const auto& page : pages_) { + const std::unique_ptr<ui::AXTreeManager>& page_manager = page.second; + if (page_manager->GetTreeID() != action_data.target_tree_id) { + ++page_index; + continue; + } + ui::AXNode* target_node = + page_manager->GetNode(action_data.target_node_id); + if (!target_node) { + break; + } + CHECK(page_manager->ax_tree()); + // Passing an empty `RectF` for the node bounds will initialize it + // automatically to `target_node->data().relative_bounds.bounds`. + gfx::RectF global_bounds = + page_manager->ax_tree()->RelativeToTreeBounds( + target_node, /*node_bounds=*/gfx::RectF()); + global_bounds.Offset(document_.GetRoot() + ->GetUnignoredChildAtIndex(page_index) + ->data() + .relative_bounds.bounds.OffsetFromOrigin()); + if (global_bounds.x() < viewport_box_.x()) { + viewport_box_.set_x(global_bounds.x()); + } else if (global_bounds.right() > viewport_box_.right()) { + viewport_box_.set_x( + std::max(0.0f, global_bounds.right() - viewport_box_.width())); + } + if (global_bounds.y() < viewport_box_.y()) { + viewport_box_.set_y(global_bounds.y()); + } else if (global_bounds.bottom() > viewport_box_.bottom()) { + viewport_box_.set_y( + std::max(0.0f, global_bounds.bottom() - viewport_box_.height())); + } + break; + } + if (media_app_) { + // `media_app_` is only used for testing. + CHECK_IS_TEST(); + media_app_->SetViewport(viewport_box_); + } + return; + } + case ax::mojom::Action::kScrollToPoint: NOTIMPLEMENTED(); return; - case ax::mojom::Action::kScrollToPoint: + // Used only on Android. case ax::mojom::Action::kScrollToPositionAtRowColumn: case ax::mojom::Action::kSetAccessibilityFocus: case ax::mojom::Action::kSetScrollOffset: @@ -161,12 +263,15 @@ case ax::mojom::Action::kStopDuckingMedia: case ax::mojom::Action::kSuspendMedia: case ax::mojom::Action::kLongClick: + NOTIMPLEMENTED(); return; } } void AXMediaAppUntrustedHandler::OnAXModeAdded(ui::AXMode mode) { if (media_app_) { + // `media_app_` is only used for testing. + CHECK_IS_TEST(); media_app_->AccessibilityEnabledChanged( accessibility_state_utils::IsScreenReaderEnabled()); } @@ -214,7 +319,7 @@ } page_metadata_[page_id].page_num = i + 1; // 1-indexed. page_metadata_[page_id].rect = page_metadata[i]->rect; - // Page location can only be set after the corresponding |pages_| + // Page location can only be set after the corresponding `pages_` // `AXTreeManager` entry has been created, so don't update it for first // load. if (!is_first_load) { @@ -255,10 +360,6 @@ OcrNextDirtyPageIfAny(); } -void AXMediaAppUntrustedHandler::ViewportUpdated( - const ::gfx::RectF& viewport_box, - float scale_factor) {} - content::WebContents* AXMediaAppUntrustedHandler::GetMediaAppWebContents() const { Profile* profile = @@ -322,6 +423,39 @@ #endif // defined(USE_AURA) } +void AXMediaAppUntrustedHandler::ViewportUpdated(const gfx::RectF& viewport_box, + float scale_factor) { + // TODO(nektar): Use scale factor to convert to device independent pixels. + viewport_box_ = viewport_box; + if (!document_.GetRoot()) { + return; + } + CHECK(document_.ax_tree()); + ui::AXNodeData document_root_data = document_.GetRoot()->data(); + document_root_data.AddIntAttribute( + ax::mojom::IntAttribute::kScrollX, + base::checked_cast<int32_t>(viewport_box_.x())); + document_root_data.AddIntAttribute( + ax::mojom::IntAttribute::kScrollXMax, + base::checked_cast<int32_t>( + document_root_data.relative_bounds.bounds.width() - + viewport_box_.width())); + document_root_data.AddIntAttribute( + ax::mojom::IntAttribute::kScrollY, + base::checked_cast<int32_t>(viewport_box_.y())); + document_root_data.AddIntAttribute( + ax::mojom::IntAttribute::kScrollYMax, + base::checked_cast<int32_t>( + document_root_data.relative_bounds.bounds.height() - + viewport_box_.height())); + ui::AXTreeUpdate document_update; + document_update.root_id = document_root_data.id; + document_update.nodes = {document_root_data}; + if (!document_.ax_tree()->Unserialize(document_update)) { + mojo::ReportBadMessage(document_.ax_tree()->error()); + } +} + void AXMediaAppUntrustedHandler::UpdatePageLocation( const std::string& page_id, const gfx::RectF& page_location) { @@ -498,8 +632,12 @@ } auto dirty_page_id = PopDirtyPage(); // TODO(b/289012145): Refactor this code to support things happening - // asynchronously - e.g. RequestBitmap will be async. + // asynchronously - i.e. `RequestBitmap` will be async. if (media_app_) { + // `media_app_` is only used for testing. + CHECK_IS_TEST(); + // TODO(b/303133098): Change this as soon as `RequestBitmap` becomes + // available by the Backlight team. SkBitmap page_bitmap = media_app_->RequestBitmap(dirty_page_id); screen_ai_annotator_->PerformOcrAndReturnAXTreeUpdate( page_bitmap, @@ -545,7 +683,7 @@ } // Update the page location again - running the page through OCR overwrites // the previous `AXTree` it was given and thus the page location it was - // already given in `PageMetadataUpdated ()`. Restore it here. + // already given in `PageMetadataUpdated()`. Restore it here. UpdatePageLocation(dirty_page_id, page_metadata_[dirty_page_id].rect); SendAXTreeToAccessibilityService(*pages_[dirty_page_id], *page_serializers_[dirty_page_id]);
diff --git a/chrome/browser/accessibility/media_app/ax_media_app_untrusted_handler.h b/chrome/browser/accessibility/media_app/ax_media_app_untrusted_handler.h index 479f335c..42b74286 100644 --- a/chrome/browser/accessibility/media_app/ax_media_app_untrusted_handler.h +++ b/chrome/browser/accessibility/media_app/ax_media_app_untrusted_handler.h
@@ -97,6 +97,9 @@ void ViewportUpdated(const ::gfx::RectF& viewport_box, float scale_factor) override; + // TODO(b/309860428): Delete once AXMediaApp is deleted. + void SetMediaAppForTesting(AXMediaApp* media_app) { media_app_ = media_app; } + protected: void PushDirtyPage(const std::string& dirty_page_id); std::string PopDirtyPage(); @@ -134,6 +137,7 @@ // This `BrowserContext` will always outlive the WebUI, so this is safe. raw_ref<content::BrowserContext> browser_context_; mojo::Remote<media_app_ui::mojom::OcrUntrustedPage> media_app_page_; + gfx::RectF viewport_box_; base::circular_deque<std::string> dirty_page_ids_; ui::AXTreeID document_tree_id_ = ui::AXTreeID::CreateNewAXTreeID(); SEQUENCE_CHECKER(sequence_checker_);
diff --git a/chrome/browser/accessibility/media_app/ax_media_app_untrusted_handler_browsertest.cc b/chrome/browser/accessibility/media_app/ax_media_app_untrusted_handler_browsertest.cc index d0e9894..5b040948 100644 --- a/chrome/browser/accessibility/media_app/ax_media_app_untrusted_handler_browsertest.cc +++ b/chrome/browser/accessibility/media_app/ax_media_app_untrusted_handler_browsertest.cc
@@ -39,6 +39,7 @@ #include "content/public/test/accessibility_notification_waiter.h" #include "mojo/public/cpp/bindings/remote.h" #include "services/screen_ai/public/test/fake_screen_ai_annotator.h" +#include "ui/accessibility/ax_action_data.h" #include "ui/accessibility/ax_event_generator.h" #include "ui/accessibility/ax_node.h" #include "ui/accessibility/ax_tree.h" @@ -51,34 +52,34 @@ namespace ash::test { -namespace { - using ash::media_app_ui::mojom::PageMetadataPtr; +namespace { + +// Page coordinates are expressed as a `gfx::RectF`, so float values should be +// used. + // Gap or padding between pages. -constexpr uint64_t kTestPageGap = 2; -// Width of a test page. -constexpr uint64_t kTestPageWidth = 3; -// Height of a test page. -constexpr uint64_t kTestPageHeight = 8; +constexpr float kTestPageGap = 2.0f; +constexpr float kTestPageWidth = 3.0f; +constexpr float kTestPageHeight = 8.0f; // Use letters to generate fake IDs for fake page metadata. If more than 26 // pages are needed, more characters can be added. constexpr std::string_view kTestPageIds = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; -// Create fake page metadata with pages of the same size positioned 10 units -// spaced apart. +// Create fake page metadata with pages of the same size positioned +// (kTestPageWidth + kTestPageGap) unit spaced apart. std::vector<PageMetadataPtr> CreateFakePageMetadata(const uint64_t num_pages) { - if (num_pages > kTestPageIds.size()) { - LOG(ERROR) << "Can't make more than " << kTestPageIds.size() << " pages."; - } - uint64_t x = 0, y = 0; + EXPECT_LE(num_pages, kTestPageIds.size()) + << "Can't make more than " << kTestPageIds.size() << " pages."; std::vector<PageMetadataPtr> fake_page_metadata; for (uint64_t i = 0; i < num_pages; ++i) { PageMetadataPtr page = ash::media_app_ui::mojom::PageMetadata::New(); page->id = std::format("Page{}", kTestPageIds[i]); - page->rect = gfx::RectF(x, y + kTestPageGap * i + kTestPageHeight * i, - kTestPageWidth, kTestPageHeight); + page->rect = + gfx::RectF(/*x=*/0.0f, /*y=*/kTestPageGap * i + kTestPageHeight * i, + kTestPageWidth, kTestPageHeight); fake_page_metadata.push_back(std::move(page)); } return fake_page_metadata; @@ -87,8 +88,8 @@ std::vector<PageMetadataPtr> ClonePageMetadataPtrs( const std::vector<PageMetadataPtr>& metadata) { std::vector<PageMetadataPtr> fake_page_metadata; - for (const auto& page : metadata) { - auto cloned_page = mojo::Clone(page); + for (const PageMetadataPtr& page : metadata) { + PageMetadataPtr cloned_page = mojo::Clone(page); fake_page_metadata.push_back(std::move(cloned_page)); } return fake_page_metadata; @@ -113,10 +114,10 @@ handler_ = std::make_unique<TestAXMediaAppUntrustedHandler>( *browser()->profile(), std::move(pageRemote)); + ASSERT_NE(nullptr, handler_.get()); // TODO(b/309860428): Delete MediaApp interface - after we implement all // Mojo APIs, it should not be needed any more. handler_->SetMediaAppForTesting(&fake_media_app_); - ASSERT_NE(nullptr, handler_.get()); #if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE) handler_->SetIsOcrServiceEnabledForTesting(); handler_->SetScreenAIAnnotatorForTesting( @@ -153,7 +154,8 @@ #if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE) IN_PROC_BROWSER_TEST_F(AXMediaAppUntrustedHandlerTest, PageMetadataUpdated) { const size_t kTestNumPages = 3; - auto fake_metadata = CreateFakePageMetadata(kTestNumPages); + std::vector<PageMetadataPtr> fake_metadata = + CreateFakePageMetadata(kTestNumPages); handler_->PageMetadataUpdated(ClonePageMetadataPtrs(fake_metadata)); WaitForOcringPages(kTestNumPages); @@ -249,11 +251,12 @@ IN_PROC_BROWSER_TEST_F(AXMediaAppUntrustedHandlerTest, PageContentsUpdatedEdit) { const size_t kTestNumPages = 3; - auto fake_metadata = CreateFakePageMetadata(kTestNumPages); + std::vector<PageMetadataPtr> fake_metadata = + CreateFakePageMetadata(kTestNumPages); handler_->PageMetadataUpdated(ClonePageMetadataPtrs(fake_metadata)); WaitForOcringPages(kTestNumPages); - // All pages have gone through OCR. + // All pages must have gone through OCR. ASSERT_EQ(kTestNumPages, fake_media_app_.PageIdsWithBitmap().size()); EXPECT_EQ("PageA", fake_media_app_.PageIdsWithBitmap()[0]); EXPECT_EQ("PageB", fake_media_app_.PageIdsWithBitmap()[1]); @@ -272,11 +275,12 @@ IN_PROC_BROWSER_TEST_F(AXMediaAppUntrustedHandlerTest, PageRotation) { const size_t kTestNumPages = 4; - auto fake_metadata = CreateFakePageMetadata(kTestNumPages); + std::vector<PageMetadataPtr> fake_metadata = + CreateFakePageMetadata(kTestNumPages); handler_->PageMetadataUpdated(ClonePageMetadataPtrs(fake_metadata)); WaitForOcringPages(kTestNumPages); - // All pages have gone through OCR. + // All pages must have gone through OCR. ASSERT_EQ(kTestNumPages, fake_media_app_.PageIdsWithBitmap().size()); EXPECT_EQ("PageA", fake_media_app_.PageIdsWithBitmap()[0]); EXPECT_EQ("PageB", fake_media_app_.PageIdsWithBitmap()[1]); @@ -359,7 +363,8 @@ browser()->tab_strip_model()->GetActiveWebContents(), ui::kAXModeComplete, ui::AXEventGenerator::Event::CHILDREN_CHANGED); const size_t kTestNumPages = 1u; - auto fake_metadata = CreateFakePageMetadata(kTestNumPages); + std::vector<PageMetadataPtr> fake_metadata = + CreateFakePageMetadata(kTestNumPages); handler_->PageMetadataUpdated(ClonePageMetadataPtrs(fake_metadata)); WaitForOcringPages(kTestNumPages); ASSERT_TRUE(child_tree_added_waiter.WaitForNotification()); @@ -496,6 +501,198 @@ "scrollable=true is_line_breaking_object=true\n", pending_serialized_updates[9].ToString()); } + +IN_PROC_BROWSER_TEST_F(AXMediaAppUntrustedHandlerTest, ScrollUpAndDown) { + constexpr size_t kTestNumPages = 3u; + std::vector<PageMetadataPtr> fake_metadata = + CreateFakePageMetadata(kTestNumPages); + handler_->PageMetadataUpdated(ClonePageMetadataPtrs(fake_metadata)); + WaitForOcringPages(kTestNumPages); + + // All pages must have gone through OCR. + ASSERT_EQ(kTestNumPages, fake_media_app_.PageIdsWithBitmap().size()); + EXPECT_EQ("PageA", fake_media_app_.PageIdsWithBitmap()[0]); + EXPECT_EQ("PageB", fake_media_app_.PageIdsWithBitmap()[1]); + EXPECT_EQ("PageC", fake_media_app_.PageIdsWithBitmap()[2]); + + // View the second page by scrolling to it. + handler_->ViewportUpdated( + gfx::RectF(/*x=*/0.0f, /*y=*/kTestPageHeight + kTestPageGap, + kTestPageWidth, kTestPageHeight), + /*scale_factor=*/1.0f); + + ui::AXActionData scroll_action_data; + scroll_action_data.action = ax::mojom::Action::kScrollUp; + scroll_action_data.target_tree_id = handler_->GetDocumentTreeIDForTesting(); + handler_->PerformAction(scroll_action_data); + EXPECT_EQ(gfx::RectF(/*x=*/0.0f, /*y=*/kTestPageGap, kTestPageWidth, + kTestPageHeight), + fake_media_app_.ViewportBox()); + + // Scroll up again, which should only scroll to the top of the document, i.e. + // viewport should not get a negative y value. + handler_->PerformAction(scroll_action_data); + EXPECT_EQ( + gfx::RectF(/*x =*/0.0f, /*y=*/0.0f, kTestPageWidth, kTestPageHeight), + fake_media_app_.ViewportBox()); + + // View the second page again by scrolling to it. + handler_->ViewportUpdated( + gfx::RectF(/*x=*/0.0f, /*y=*/kTestPageHeight + kTestPageGap, + kTestPageWidth, kTestPageHeight), + /*scale_factor=*/1.0f); + + scroll_action_data.action = ax::mojom::Action::kScrollDown; + handler_->PerformAction(scroll_action_data); + EXPECT_EQ(gfx::RectF(/*x=*/0.0f, /*y=*/kTestPageGap + kTestPageHeight * 2.0f, + kTestPageWidth, kTestPageHeight), + fake_media_app_.ViewportBox()); + + // Scroll down again, which should only scroll to the bottom of the document + // but not further. + handler_->PerformAction(scroll_action_data); + EXPECT_EQ( + gfx::RectF(/*x=*/0.0f, /*y=*/(kTestPageGap + kTestPageHeight) * 2.0f, + kTestPageWidth, kTestPageHeight), + fake_media_app_.ViewportBox()); +} + +IN_PROC_BROWSER_TEST_F(AXMediaAppUntrustedHandlerTest, ScrollLeftAndRight) { + constexpr float kTestViewportWidth = kTestPageWidth / 3.0f; + constexpr float kTestViewportHeight = kTestPageHeight; + constexpr size_t kTestNumPages = 3u; + std::vector<PageMetadataPtr> fake_metadata = + CreateFakePageMetadata(kTestNumPages); + handler_->PageMetadataUpdated(ClonePageMetadataPtrs(fake_metadata)); + WaitForOcringPages(kTestNumPages); + + // All pages must have gone through OCR. + ASSERT_EQ(kTestNumPages, fake_media_app_.PageIdsWithBitmap().size()); + EXPECT_EQ("PageA", fake_media_app_.PageIdsWithBitmap()[0]); + EXPECT_EQ("PageB", fake_media_app_.PageIdsWithBitmap()[1]); + EXPECT_EQ("PageC", fake_media_app_.PageIdsWithBitmap()[2]); + + // View the center part of the second page by scrolling to it. + handler_->ViewportUpdated(gfx::RectF(/*x=*/kTestViewportWidth, + /*y=*/kTestPageHeight + kTestPageGap, + kTestViewportWidth, kTestViewportHeight), + /*scale_factor=*/1.0f); + + ui::AXActionData scroll_action_data; + scroll_action_data.action = ax::mojom::Action::kScrollLeft; + scroll_action_data.target_tree_id = handler_->GetDocumentTreeIDForTesting(); + handler_->PerformAction(scroll_action_data); + EXPECT_EQ(gfx::RectF(/*x=*/0.0f, /*y=*/kTestPageHeight + kTestPageGap, + kTestViewportWidth, kTestViewportHeight), + fake_media_app_.ViewportBox()); + + // No scrolling should happen because we are already at the leftmost position + // of the second page. + handler_->PerformAction(scroll_action_data); + EXPECT_EQ(gfx::RectF(/*x=*/0.0f, /*y=*/kTestPageHeight + kTestPageGap, + kTestViewportWidth, kTestViewportHeight), + fake_media_app_.ViewportBox()); + + // View the rightmost part of the second page again by scrolling to it. + handler_->ViewportUpdated(gfx::RectF(/*x=*/kTestViewportWidth * 2.0f, + /*y=*/kTestViewportHeight + kTestPageGap, + kTestViewportWidth, kTestViewportHeight), + /*scale_factor=*/1.0f); + + scroll_action_data.action = ax::mojom::Action::kScrollRight; + handler_->PerformAction(scroll_action_data); + EXPECT_EQ(gfx::RectF(/*x=*/kTestPageWidth - kTestViewportWidth, + /*y=*/kTestViewportHeight + kTestPageGap, + kTestViewportWidth, kTestViewportHeight), + fake_media_app_.ViewportBox()); + + handler_->PerformAction(scroll_action_data); + EXPECT_EQ(gfx::RectF(/*x=*/kTestPageWidth - 1.0f, + /*y=*/kTestViewportHeight + kTestPageGap, + kTestViewportWidth, kTestViewportHeight), + fake_media_app_.ViewportBox()); +} + +IN_PROC_BROWSER_TEST_F(AXMediaAppUntrustedHandlerTest, ScrollToMakeVisible) { + constexpr float kPageX = 0.0f; + constexpr float kPageY = 0.0f; + constexpr float kViewportWidth = 2.0f; + constexpr float kViewportHeight = 4.0f; + std::vector<PageMetadataPtr> fake_metadata; + PageMetadataPtr fake_page = ash::media_app_ui::mojom::PageMetadata::New(); + fake_page->id = std::format("Page{}", kTestPageIds[0]); + fake_page->rect = + gfx::RectF(/*x=*/kPageX, /*y=*/kPageY, kTestPageWidth, kTestPageHeight); + fake_metadata.push_back(std::move(fake_page)); + handler_->PageMetadataUpdated(ClonePageMetadataPtrs(fake_metadata)); + WaitForOcringPages(1u); + + // All pages must have gone through OCR. + ASSERT_EQ(1u, fake_media_app_.PageIdsWithBitmap().size()); + EXPECT_EQ("PageA", fake_media_app_.PageIdsWithBitmap()[0]); + + ui::AXActionData scroll_action_data; + scroll_action_data.action = ax::mojom::Action::kScrollToMakeVisible; + scroll_action_data.target_tree_id = + handler_->GetPagesForTesting().at(fake_metadata[0]->id)->GetTreeID(); + ASSERT_NE(nullptr, + handler_->GetPagesForTesting().at(fake_metadata[0]->id)->GetRoot()); + scroll_action_data.target_node_id = + handler_->GetPagesForTesting().at(fake_metadata[0]->id)->GetRoot()->id(); + + // "Scroll to make visible", which should scroll forward. + handler_->ViewportUpdated( + gfx::RectF(/*x=*/0.0f, /*y=*/0.0f, kViewportWidth, kViewportHeight), + /*scale_factor=*/1.0f); + handler_->PerformAction(scroll_action_data); + EXPECT_EQ(gfx::RectF(/*x=*/kPageX + kTestPageWidth - kViewportWidth, + /*y=*/kPageY + kTestPageHeight - kViewportHeight, + kViewportWidth, kViewportHeight), + fake_media_app_.ViewportBox()); + handler_->ViewportUpdated( + gfx::RectF(/*x=*/0.0f, /*y=*/kPageY, kViewportWidth, kViewportHeight), + /*scale_factor=*/1.0f); + handler_->PerformAction(scroll_action_data); + EXPECT_EQ(gfx::RectF(/*x=*/kPageX + kTestPageWidth - kViewportWidth, + /*y=*/kPageY + kTestPageHeight - kViewportHeight, + kViewportWidth, kViewportHeight), + fake_media_app_.ViewportBox()); + + // "Scroll to make visible", which should scroll backward. + handler_->ViewportUpdated(gfx::RectF(/*x=*/kPageX + kTestPageWidth - 1.0f, + /*y=*/kPageY + kTestPageHeight - 1.0f, + kViewportWidth, kViewportHeight), + /*scale_factor=*/1.0f); + handler_->PerformAction(scroll_action_data); + EXPECT_EQ(gfx::RectF(kPageX, kPageY, kViewportWidth, kViewportHeight), + fake_media_app_.ViewportBox()); + handler_->ViewportUpdated( + gfx::RectF(/*x=*/kPageX + kTestPageWidth, /*y=*/kPageY + kTestPageHeight, + kViewportWidth, kViewportHeight), + /*scale_factor=*/1.0f); + handler_->PerformAction(scroll_action_data); + EXPECT_EQ(gfx::RectF(kPageX, kPageY, kViewportWidth, kViewportHeight), + fake_media_app_.ViewportBox()); + + // No scrolling should be needed because page can fit into viewport. + handler_->ViewportUpdated( + gfx::RectF(kPageX, kPageY, kTestPageWidth, kTestPageHeight), + /*scale_factor=*/1.0f); + handler_->PerformAction(scroll_action_data); + EXPECT_EQ(gfx::RectF(kPageX, kPageY, kTestPageWidth, kTestPageHeight), + fake_media_app_.ViewportBox()); + + // Viewport can only display part of the page; so "scroll to make visible" + // should only scroll to the top-left corner. + handler_->ViewportUpdated( + gfx::RectF(/*x=*/kPageX + kTestPageWidth - kViewportWidth, + /*y-*/ kPageY + kTestPageHeight - kViewportHeight, + kViewportWidth, kViewportHeight), + /*scale_factor=*/1.0f); + handler_->PerformAction(scroll_action_data); + EXPECT_EQ(gfx::RectF(kPageX, kPageY, kViewportWidth, kViewportHeight), + fake_media_app_.ViewportBox()); +} #endif // BUILDFLAG(ENABLE_SCREEN_AI_SERVICE) } // namespace ash::test
diff --git a/chrome/browser/accessibility/media_app/test/fake_ax_media_app.cc b/chrome/browser/accessibility/media_app/test/fake_ax_media_app.cc index 4ed9e85..17310ee 100644 --- a/chrome/browser/accessibility/media_app/test/fake_ax_media_app.cc +++ b/chrome/browser/accessibility/media_app/test/fake_ax_media_app.cc
@@ -30,7 +30,7 @@ return fake_bitmap; } -void FakeAXMediaApp::SetViewport(const gfx::Insets& viewport_box) { +void FakeAXMediaApp::SetViewport(const gfx::RectF& viewport_box) { viewport_box_ = viewport_box; }
diff --git a/chrome/browser/accessibility/media_app/test/fake_ax_media_app.h b/chrome/browser/accessibility/media_app/test/fake_ax_media_app.h index 47e18c64..a5b0938 100644 --- a/chrome/browser/accessibility/media_app/test/fake_ax_media_app.h +++ b/chrome/browser/accessibility/media_app/test/fake_ax_media_app.h
@@ -5,18 +5,16 @@ #ifndef CHROME_BROWSER_ACCESSIBILITY_MEDIA_APP_TEST_FAKE_AX_MEDIA_APP_H_ #define CHROME_BROWSER_ACCESSIBILITY_MEDIA_APP_TEST_FAKE_AX_MEDIA_APP_H_ -#include <stdint.h> - #include <vector> #include "chrome/browser/accessibility/media_app/ax_media_app.h" #include "content/public/browser/browser_context.h" #include "third_party/skia/include/core/SkBitmap.h" -#include "ui/gfx/geometry/insets.h" +#include "ui/gfx/geometry/rect_f.h" namespace ash::test { -// Used for testing: A fake Media App (AKA Backlight) that implements only the +// Used for testing. A fake Media App (AKA Backlight) that implements only the // API used by the accessibility layer. class FakeAXMediaApp final : public ash::AXMediaApp { public: @@ -30,20 +28,20 @@ const std::vector<std::string>& PageIdsWithBitmap() const { return page_ids_with_bitmap_; } - const gfx::Insets& GetViewportBox() const { return viewport_box_; } + const gfx::RectF& ViewportBox() const { return viewport_box_; } // `AXMediaApp`: void OcrServiceEnabledChanged(bool enabled) override; void AccessibilityEnabledChanged(bool enabled) override; content::BrowserContext* GetBrowserContext() const override; SkBitmap RequestBitmap(const std::string& page_id) override; - void SetViewport(const gfx::Insets& viewport_box) override; + void SetViewport(const gfx::RectF& viewport_box) override; private: bool ocr_service_enabled_ = false; bool accessibility_enabled_ = false; std::vector<std::string> page_ids_with_bitmap_; - gfx::Insets viewport_box_; + gfx::RectF viewport_box_; }; } // namespace ash::test
diff --git a/chrome/browser/lacros/remote_apps/remote_apps_proxy_lacros_unittest.cc b/chrome/browser/lacros/remote_apps/remote_apps_proxy_lacros_unittest.cc index 1dea8b3..ec43130cc 100644 --- a/chrome/browser/lacros/remote_apps/remote_apps_proxy_lacros_unittest.cc +++ b/chrome/browser/lacros/remote_apps/remote_apps_proxy_lacros_unittest.cc
@@ -135,6 +135,9 @@ } void TearDown() override { + event_router_ = nullptr; + testing_profile_ = nullptr; + proxy_.reset(); testing_profile_manager_.DeleteAllTestingProfiles(); testing::Test::TearDown(); }
diff --git a/chrome/browser/permissions/permission_element_browsertest.cc b/chrome/browser/permissions/permission_element_browsertest.cc index 7d0e926..100a2fc 100644 --- a/chrome/browser/permissions/permission_element_browsertest.cc +++ b/chrome/browser/permissions/permission_element_browsertest.cc
@@ -15,13 +15,12 @@ #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_utils.h" #include "net/test/embedded_test_server/embedded_test_server.h" +#include "third_party/blink/public/common/features_generated.h" #include "ui/events/base_event_utils.h" #include "ui/views/widget/any_widget_observer.h" namespace { -const base::TimeDelta kDefaultDisableTimeout = base::Milliseconds(1000); - // Simulates a click on an element with the given |id|. void ClickElementWithId(content::WebContents* web_contents, const std::string& id) { @@ -53,7 +52,10 @@ class PermissionElementBrowserTest : public InProcessBrowserTest { public: PermissionElementBrowserTest() { - feature_list_.InitAndEnableFeature(features::kPermissionElement); + feature_list_.InitWithFeatures( + {features::kPermissionElement, + blink::features::kDisablePEPCSecurityForTesting}, + {}); } PermissionElementBrowserTest(const PermissionElementBrowserTest&) = delete; @@ -68,11 +70,6 @@ browser(), embedded_test_server()->GetURL("/permissions/permission_element.html"), 1)); - // Delay a short time to make sure all <permission> elements are clickable. - base::RunLoop run_loop; - base::SingleThreadTaskRunner::GetCurrentDefault()->PostDelayedTask( - FROM_HERE, run_loop.QuitClosure(), kDefaultDisableTimeout); - run_loop.Run(); } content::WebContents* web_contents() {
diff --git a/chrome/browser/permissions/permission_manager_factory.cc b/chrome/browser/permissions/permission_manager_factory.cc index d648554..7258788 100644 --- a/chrome/browser/permissions/permission_manager_factory.cc +++ b/chrome/browser/permissions/permission_manager_factory.cc
@@ -115,6 +115,9 @@ std::make_unique<MediaStreamDevicePermissionContext>( profile, ContentSettingsType::MEDIASTREAM_MIC); + permission_contexts[ContentSettingsType::SPEAKER_SELECTION] = + std::make_unique<SpeakerSelectionPermissionContext>(profile); + // TODO(crbug.com/1025610): Move once Notifications are supported on WebLayer. permission_contexts[ContentSettingsType::NOTIFICATIONS] = std::make_unique<NotificationPermissionContext>(profile); @@ -147,9 +150,6 @@ std::make_unique<permissions::CapturedSurfaceControlPermissionContext>( profile); - permission_contexts[ContentSettingsType::SPEAKER_SELECTION] = - std::make_unique<permissions::SpeakerSelectionPermissionContext>(profile); - #if BUILDFLAG(IS_CHROMEOS) && BUILDFLAG(USE_CUPS) permission_contexts[ContentSettingsType::WEB_PRINTING] = std::make_unique<WebPrintingPermissionContext>(profile);
diff --git a/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/camera_stream.ts b/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/camera_stream.ts index be4e69b..578967e 100644 --- a/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/camera_stream.ts +++ b/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/camera_stream.ts
@@ -155,4 +155,5 @@ button?.addEventListener( 'click', () => globalThis.webCamFaceLandmarker.init()); button?.removeAttribute('hidden'); + chrome.runtime.sendMessage(undefined, {type: 'cameraStreamReadyForTesting'}); });
diff --git a/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze.ts b/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze.ts index 01866a1..cd9ac7fe 100644 --- a/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze.ts +++ b/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze.ts
@@ -14,10 +14,15 @@ private gestureHandler_: GestureHandler; private onInitCallbackForTest_: (() => void)|undefined; private initialized_ = false; + declare private cameraStreamReadyPromise_: Promise<void>; + private cameraStreamReadyResolver_?: () => void; constructor() { this.mouseController_ = new MouseController(); this.gestureHandler_ = new GestureHandler(this.mouseController_); + this.cameraStreamReadyPromise_ = new Promise(resolve => { + this.cameraStreamReadyResolver_ = resolve; + }); this.init_(); } @@ -50,6 +55,8 @@ chrome.runtime.onMessage.addListener(message => { if (message.type === 'faceLandmarkerResult') { this.processFaceLandmarkerResult_(message.result); + } else if (message.type === 'cameraStreamReadyForTesting') { + this.cameraStreamReadyResolver_!(); } return false;
diff --git a/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze_mediapipe_test.js b/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze_mediapipe_test.js index e1b421f6e..776bc6bd 100644 --- a/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze_mediapipe_test.js +++ b/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze_mediapipe_test.js
@@ -34,28 +34,12 @@ window.chrome.accessibilityPrivate = this.mockAccessibilityPrivate; } - /** Gets the webCamFaceLandmarker object from the camera stream context. */ - getWebCamFaceLandmarker() { - const window = chrome.extension.getViews().find( - view => view.location.href.includes('camera_stream.html')); - - return window ? window.webCamFaceLandmarker : null; - } - /** @return {!webCamFaceLandmarker} */ async waitForWebCamFaceLandmarker() { - if (this.getWebCamFaceLandmarker()) { - return this.getWebCamFaceLandmarker(); - } - - return new Promise(resolve => { - const id = setInterval(() => { - if (this.getWebCamFaceLandmarker()) { - clearInterval(id); - resolve(this.getWebCamFaceLandmarker()); - } - }, 1000); - }); + await this.getFaceGaze().cameraStreamReadyPromise_; + const window = chrome.extension.getViews().find( + view => view.location.href.includes('camera_stream.html')); + return window.webCamFaceLandmarker; } };
diff --git a/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze_test_support.js b/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze_test_support.js index d641808..cda3c5e 100644 --- a/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze_test_support.js +++ b/chrome/browser/resources/chromeos/accessibility/accessibility_common/facegaze/facegaze_test_support.js
@@ -22,24 +22,10 @@ * @return {!webCamFaceLandmarker} */ async waitForWebCamFaceLandmarker() { - const getWebCamFaceLandmarker = () => { - const window = chrome.extension.getViews().find( - view => view.location.href.includes('camera_stream.html')); - return window ? window.webCamFaceLandmarker : null; - }; - - if (getWebCamFaceLandmarker()) { - return getWebCamFaceLandmarker(); - } - - return new Promise(resolve => { - const id = setInterval(() => { - if (getWebCamFaceLandmarker()) { - clearInterval(id); - resolve(getWebCamFaceLandmarker()); - } - }, 1000); - }); + await accessibilityCommon.getFaceGazeForTest().cameraStreamReadyPromise_; + const window = chrome.extension.getViews().find( + view => view.location.href.includes('camera_stream.html')); + return window.webCamFaceLandmarker; } /** Instantiates the FaceLandmarker. */
diff --git a/chrome/browser/ui/startup/bad_flags_prompt.cc b/chrome/browser/ui/startup/bad_flags_prompt.cc index fd2bd40..3733d118 100644 --- a/chrome/browser/ui/startup/bad_flags_prompt.cc +++ b/chrome/browser/ui/startup/bad_flags_prompt.cc
@@ -41,6 +41,7 @@ #include "sandbox/policy/switches.h" #include "services/device/public/cpp/hid/hid_switches.h" #include "services/network/public/cpp/network_switches.h" +#include "third_party/blink/public/common/features_generated.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/scoped_startup_resource_bundle.h" @@ -195,6 +196,10 @@ #if BUILDFLAG(IS_CHROMEOS_LACROS) &chromeos::features::kBlinkExtensionDiagnostics, #endif // BUILDFLAG(IS_CHROMEOS_LACROS) + + // This flag disables security for the Page Embedded Permission Control, for + // testing purposes. Can only be enabled via the command line. + &blink::features::kDisablePEPCSecurityForTesting, }; void ShowBadFlagsInfoBarHelper(content::WebContents* web_contents,
diff --git a/chrome/browser/ui/views/permissions/embedded_permission_prompt_interactive_uitest.cc b/chrome/browser/ui/views/permissions/embedded_permission_prompt_interactive_uitest.cc index bdcce14d..da045d0 100644 --- a/chrome/browser/ui/views/permissions/embedded_permission_prompt_interactive_uitest.cc +++ b/chrome/browser/ui/views/permissions/embedded_permission_prompt_interactive_uitest.cc
@@ -21,14 +21,14 @@ #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_utils.h" #include "net/dns/mock_host_resolver.h" +#include "third_party/blink/public/common/features_generated.h" #include "ui/base/interaction/element_identifier.h" #include "ui/views/controls/label.h" #include "url/origin.h" namespace { DEFINE_LOCAL_ELEMENT_IDENTIFIER_VALUE(kWebContentsElementId); -DEFINE_LOCAL_CUSTOM_ELEMENT_EVENT_TYPE(kElementReadyEvent); -const WebContentsInteractionTestUtil::DeepQuery kReadyElementQuery = {"#ready"}; +DEFINE_LOCAL_CUSTOM_ELEMENT_EVENT_TYPE(kPEPCVisibleEvent); } // namespace class EmbeddedPermissionPromptInteractiveTest : public InteractiveBrowserTest { @@ -36,12 +36,11 @@ EmbeddedPermissionPromptInteractiveTest() { https_server_ = std::make_unique<net::EmbeddedTestServer>( net::EmbeddedTestServer::TYPE_HTTPS); - feature_list_.InitWithFeatures({features::kPermissionElement, - permissions::features::kOneTimePermission}, - {}); - ready_element_visible_.where = kReadyElementQuery; - ready_element_visible_.type = StateChange::Type::kExists; - ready_element_visible_.event = kElementReadyEvent; + feature_list_.InitWithFeatures( + {features::kPermissionElement, + permissions::features::kOneTimePermission, + blink::features::kDisablePEPCSecurityForTesting}, + {}); } ~EmbeddedPermissionPromptInteractiveTest() override = default; @@ -83,9 +82,12 @@ } auto ClickOnPEPCElement(const std::string& element_id) { + StateChange pepc_visible; + pepc_visible.where = DeepQuery{"#" + element_id}; + pepc_visible.type = StateChange::Type::kExists; + pepc_visible.event = kPEPCVisibleEvent; return Steps( - WaitForStateChange(kWebContentsElementId, ready_element_visible_), - EnsurePresent(kWebContentsElementId, DeepQuery{"#" + element_id}), + WaitForStateChange(kWebContentsElementId, pepc_visible), MoveMouseTo(kWebContentsElementId, DeepQuery{"#" + element_id}), ClickMouse()); } @@ -253,7 +255,6 @@ private: std::unique_ptr<net::EmbeddedTestServer> https_server_; base::test::ScopedFeatureList feature_list_; - StateChange ready_element_visible_; }; // Failing on Windows, though manual testing of the same flow does not reproduce
diff --git a/chrome/build/android-arm32.pgo.txt b/chrome/build/android-arm32.pgo.txt index 7a4a784..4f2ad04 100644 --- a/chrome/build/android-arm32.pgo.txt +++ b/chrome/build/android-arm32.pgo.txt
@@ -1 +1 @@ -chrome-android32-main-1709276042-021209abe7839a98639a33ff9795ff37325566a3-40412b90c691904ff438f6c25a50616b4c3c957f.profdata +chrome-android32-main-1709379997-094a30f2f3bd422b364ee923e72a6e9b197330ab-2f4be1a46d64bbddbad4f0eba52b379b49b97e43.profdata
diff --git a/chrome/build/android-arm64.pgo.txt b/chrome/build/android-arm64.pgo.txt index 136e122..3c602d3 100644 --- a/chrome/build/android-arm64.pgo.txt +++ b/chrome/build/android-arm64.pgo.txt
@@ -1 +1 @@ -chrome-android64-main-1709276042-34a46b3b3c4a1875b57514e07d52dab9dd66a052-40412b90c691904ff438f6c25a50616b4c3c957f.profdata +chrome-android64-main-1709335899-14d6ec54e21341cd04a5ff6ac335343f4362e75a-c36391748c4f06cd036749fcc77250f6043da458.profdata
diff --git a/chrome/build/lacros64.pgo.txt b/chrome/build/lacros64.pgo.txt index 35153885..589cdd3 100644 --- a/chrome/build/lacros64.pgo.txt +++ b/chrome/build/lacros64.pgo.txt
@@ -1 +1 @@ -chrome-chromeos-amd64-generic-main-1709276042-35315db5cc505753be379587f5cdd664f4bd1270-40412b90c691904ff438f6c25a50616b4c3c957f.profdata +chrome-chromeos-amd64-generic-main-1709379997-80b4098f8a770a7f19d1b28089ff99f3902e94f0-2f4be1a46d64bbddbad4f0eba52b379b49b97e43.profdata
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index 19c02c2..80c2274 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1709272542-e669012cc90ec265c2e83e90155129bafa222dd6-e545f27e7821d93e0acbc119c92f648d52c14bcb.profdata +chrome-linux-main-1709379997-8a13e22284f2fa0012947fc64a9d0bcfaa06d1b6-2f4be1a46d64bbddbad4f0eba52b379b49b97e43.profdata
diff --git a/chrome/build/mac-arm.pgo.txt b/chrome/build/mac-arm.pgo.txt index 6e2f827..44ea86f0 100644 --- a/chrome/build/mac-arm.pgo.txt +++ b/chrome/build/mac-arm.pgo.txt
@@ -1 +1 @@ -chrome-mac-arm-main-1709308479-db231f1643e8ed09f840adc2dacdc5662e679748-d8280999ac0aaf51e6c74f9f913a366dd233a967.profdata +chrome-mac-arm-main-1709395181-8fe458bb48905a67fcb6ff0b798aa59241f7456d-66c71450d70cb986287febc4261ec4816d1112df.profdata
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index bc570ca..580a550 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-main-1709276042-42b1ac4d4c7af78a7679e3eafb4db1cc755b8285-40412b90c691904ff438f6c25a50616b4c3c957f.profdata +chrome-mac-main-1709379997-3aa988fbf14fe6bff1c30436d842b77e828ff311-2f4be1a46d64bbddbad4f0eba52b379b49b97e43.profdata
diff --git a/chrome/build/win-arm64.pgo.txt b/chrome/build/win-arm64.pgo.txt index 86c359c..f35ec223 100644 --- a/chrome/build/win-arm64.pgo.txt +++ b/chrome/build/win-arm64.pgo.txt
@@ -1 +1 @@ -chrome-win-arm64-main-1709276042-39d3a7122b2f77822abfa6ffef2785e2538a586d-40412b90c691904ff438f6c25a50616b4c3c957f.profdata +chrome-win-arm64-main-1709379997-05cb8318420c94c26e4f27f2534057fad07aae4f-2f4be1a46d64bbddbad4f0eba52b379b49b97e43.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index 3353718..4a076f1 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1709276042-ebbf33308ab763c820e92c7783c94200b825c85c-40412b90c691904ff438f6c25a50616b4c3c957f.profdata +chrome-win32-main-1709390651-96ff044afaeeba1f2defb1f907db4ff56c151383-5aaad04f3789177146c7b732745e0cada0399178.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index bd0a93e0..1f34ae10 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1709276042-af8a560556a7edb2c894d6c83cb62b40d8211894-40412b90c691904ff438f6c25a50616b4c3c957f.profdata +chrome-win64-main-1709390651-c392343567e04758a0d2525ac58532bd24d08846-5aaad04f3789177146c7b732745e0cada0399178.profdata
diff --git a/chrome/services/sharing/nearby/platform/wifi_lan_medium.cc b/chrome/services/sharing/nearby/platform/wifi_lan_medium.cc index 22b6290c..2c8ec7c 100644 --- a/chrome/services/sharing/nearby/platform/wifi_lan_medium.cc +++ b/chrome/services/sharing/nearby/platform/wifi_lan_medium.cc
@@ -5,6 +5,7 @@ #include "chrome/services/sharing/nearby/platform/wifi_lan_medium.h" #include "base/check.h" +#include "base/containers/span.h" #include "base/functional/bind.h" #include "base/logging.h" #include "base/metrics/histogram_functions.h" @@ -126,8 +127,7 @@ const std::string& ip_address, int port, CancellationFlag* cancellation_flag) { - net::IPAddress ip(reinterpret_cast<const uint8_t*>(ip_address.data()), - ip_address.length()); + net::IPAddress ip(base::as_byte_span(ip_address)); const net::AddressList address_list = net::AddressList::CreateFromIPAddress(ip, port);
diff --git a/chrome/test/data/permissions/permission_element.html b/chrome/test/data/permissions/permission_element.html index c1aeb75..c36a9d1 100644 --- a/chrome/test/data/permissions/permission_element.html +++ b/chrome/test/data/permissions/permission_element.html
@@ -22,14 +22,6 @@ })(); return true; } - - // Create a "ready" element after a second has passed to allow interactive - // tests to have a signal that the PEPC elements are ready to be clicked. - setTimeout(function() { - let el = document.createElement('div'); - el.id = "ready"; - document.body.appendChild(el); - }, 1000); </script> <body> <permission id="geolocation" type="geolocation">
diff --git a/chromeos/CHROMEOS_LKGM b/chromeos/CHROMEOS_LKGM index 80dc386f..93046ac 100644 --- a/chromeos/CHROMEOS_LKGM +++ b/chromeos/CHROMEOS_LKGM
@@ -1 +1 @@ -15803.0.0 \ No newline at end of file +15804.0.0 \ No newline at end of file
diff --git a/chromeos/ash/components/smbfs/ip_address_mojom_traits.cc b/chromeos/ash/components/smbfs/ip_address_mojom_traits.cc index 7e8258f..94cdb81 100644 --- a/chromeos/ash/components/smbfs/ip_address_mojom_traits.cc +++ b/chromeos/ash/components/smbfs/ip_address_mojom_traits.cc
@@ -19,7 +19,7 @@ return false; } - *out = net::IPAddress(bytes.data(), bytes.size()); + *out = net::IPAddress(bytes); return true; }
diff --git a/clank b/clank index 8a57d2d3..02bdd9c 160000 --- a/clank +++ b/clank
@@ -1 +1 @@ -Subproject commit 8a57d2d318a0d62648d9590be11bc6d60f247b7d +Subproject commit 02bdd9c092ea06c0725790d86580609dd29f1df9
diff --git a/components/autofill/content/renderer/form_autofill_util.cc b/components/autofill/content/renderer/form_autofill_util.cc index 43ad032..d19fc64 100644 --- a/components/autofill/content/renderer/form_autofill_util.cc +++ b/components/autofill/content/renderer/form_autofill_util.cc
@@ -1536,34 +1536,6 @@ return form_control_elements; } -// Calls SetPreventHighlightingOfAutofilledFields() on all form controls in the -// document. -// -// The effect is that, if `prevent_highlighting == true`, already autofilled -// values are not highlighted as such (with blue background). The intention is -// during a preview to make the previewed fields stand out. -void SetPreventHighlightingOfAutofilledFields(const WebDocument& document, - bool prevent_highlighting) { - if (!base::FeatureList::IsEnabled( - features::kAutofillHighlightOnlyChangedValuesInPreviewMode)) { - return; - } - for (const WebFormElement& form : - base::FeatureList::IsEnabled( - blink::features::kAutofillIncludeFormElementsInShadowDom) - ? document.GetTopLevelForms() - : document.Forms()) { - for (WebFormControlElement& form_control : form.GetFormControlElements()) { - form_control.SetPreventHighlightingOfAutofilledFields( - prevent_highlighting); - } - } - for (WebFormControlElement& form_control : - document.UnassociatedFormControls()) { - form_control.SetPreventHighlightingOfAutofilledFields(prevent_highlighting); - } -} - } // namespace std::vector<WebElement> GetWebElementsFromIdList(const WebDocument& document, @@ -2224,13 +2196,6 @@ mojom::FormActionType action_type, mojom::ActionPersistence action_persistence, FieldDataManager& field_data_manager) { - // If this is a preview, prevent already autofilled fields from being - // highlighted. - if (action_type == mojom::FormActionType::kFill && - action_persistence == mojom::ActionPersistence::kPreview) { - SetPreventHighlightingOfAutofilledFields(document, true); - } - // This container stores the FormFieldData::FillData* of `form.fields` that // will be filled into their corresponding blink elements. std::vector<std::pair<FieldRef, WebAutofillState>> filled_fields; @@ -2289,19 +2254,14 @@ // In preview mode, only fill the field if it changes the fields value. // With this, the WebAutofillState is not changed from kAutofilled to // kPreviewed. This prevents the highlighting to change. - if (action_persistence == mojom::ActionPersistence::kFill || - focused_field.data->value != focused_field.element.Value().Utf16() || - !base::FeatureList::IsEnabled( - features::kAutofillHighlightOnlyChangedValuesInPreviewMode)) { - filled_fields.emplace_back(focused_field.element, - focused_field.element.GetAutofillState()); - if (action_persistence == mojom::ActionPersistence::kFill) { - FillFormField(*focused_field.data, /*is_initiating_node=*/true, - focused_field.element, field_data_manager); - } else { - PreviewFormField(*focused_field.data, focused_field.element, - field_data_manager); - } + filled_fields.emplace_back(focused_field.element, + focused_field.element.GetAutofillState()); + if (action_persistence == mojom::ActionPersistence::kFill) { + FillFormField(*focused_field.data, /*is_initiating_node=*/true, + focused_field.element, field_data_manager); + } else { + PreviewFormField(*focused_field.data, focused_field.element, + field_data_manager); } } @@ -2344,10 +2304,6 @@ base::span<std::pair<WebFormControlElement, WebAutofillState>> previewed_elements, const WebFormControlElement& initiating_element) { - if (action_type == mojom::FormActionType::kFill) { - SetPreventHighlightingOfAutofilledFields(initiating_element.GetDocument(), - false); - } for (auto& [control_element, prior_autofill_state] : previewed_elements) { // We do not add null elements to `previewed_elements_` in AutofillAgent. DCHECK(!control_element.IsNull());
diff --git a/components/autofill/core/common/autofill_features.cc b/components/autofill/core/common/autofill_features.cc index ffd5124..2d6d6d6 100644 --- a/components/autofill/core/common/autofill_features.cc +++ b/components/autofill/core/common/autofill_features.cc
@@ -346,12 +346,6 @@ "AutofillLocalHeuristicsOverrides", base::FEATURE_DISABLED_BY_DEFAULT); -// When enabled, only changed values are highlighted in preview mode. -// TODO(crbug/1248585): Remove when launched. -BASE_FEATURE(kAutofillHighlightOnlyChangedValuesInPreviewMode, - "AutofillHighlightOnlyChangedValuesInPreviewMode", - base::FEATURE_DISABLED_BY_DEFAULT); - // When enabled, all behaviours related to the on-device machine learning // model for field type predictions will be guarded. // TODO(crbug.com/1465926): Remove when launched.
diff --git a/components/autofill/core/common/autofill_features.h b/components/autofill/core/common/autofill_features.h index 5c4b3fc..1466571 100644 --- a/components/autofill/core/common/autofill_features.h +++ b/components/autofill/core/common/autofill_features.h
@@ -117,8 +117,6 @@ extern const base::FeatureParam<bool> kAutofillConvergeToLonger; COMPONENT_EXPORT(AUTOFILL) BASE_DECLARE_FEATURE(kAutofillLocalHeuristicsOverrides); -COMPONENT_EXPORT(AUTOFILL) -BASE_DECLARE_FEATURE(kAutofillHighlightOnlyChangedValuesInPreviewMode); COMPONENT_EXPORT(AUTOFILL) BASE_DECLARE_FEATURE(kAutofillModelPredictions); COMPONENT_EXPORT(AUTOFILL) extern const base::FeatureParam<bool> kAutofillModelPredictionsAreActive;
diff --git a/components/openscreen_platform/network_util.cc b/components/openscreen_platform/network_util.cc index 3037eb35..8aafd063 100644 --- a/components/openscreen_platform/network_util.cc +++ b/components/openscreen_platform/network_util.cc
@@ -19,12 +19,12 @@ case openscreen::IPAddress::Version::kV4: { std::array<uint8_t, openscreen::IPAddress::kV4Size> bytes_v4; address.CopyToV4(bytes_v4.data()); - return net::IPAddress(bytes_v4.data(), bytes_v4.size()); + return net::IPAddress(bytes_v4); } case openscreen::IPAddress::Version::kV6: { std::array<uint8_t, openscreen::IPAddress::kV6Size> bytes_v6; address.CopyToV6(bytes_v6.data()); - return net::IPAddress(bytes_v6.data(), bytes_v6.size()); + return net::IPAddress(bytes_v6); } } }
diff --git a/components/optimization_guide/core/optimization_filter.cc b/components/optimization_guide/core/optimization_filter.cc index 86d78d4..8061462 100644 --- a/components/optimization_guide/core/optimization_filter.cc +++ b/components/optimization_guide/core/optimization_filter.cc
@@ -10,6 +10,7 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "crypto/sha2.h" +#include "url/gurl.h" namespace optimization_guide { @@ -25,7 +26,12 @@ if (!url.is_valid()) return false; - std::string clean_url = base::ToLowerASCII(url.GetAsReferrer().spec()); + GURL::Replacements replace_url_auth; + replace_url_auth.ClearUsername(); + replace_url_auth.ClearPassword(); + std::string clean_url = + base::ToLowerASCII(url.ReplaceComponents(replace_url_auth).spec()); + for (auto& regexp : regexps) { if (!regexp->ok()) { continue;
diff --git a/components/optimization_guide/core/optimization_filter_unittest.cc b/components/optimization_guide/core/optimization_filter_unittest.cc index 4454aaa..466e426 100644 --- a/components/optimization_guide/core/optimization_filter_unittest.cc +++ b/components/optimization_guide/core/optimization_filter_unittest.cc
@@ -114,8 +114,16 @@ /*exclusion_regexps=*/nullptr, /*skip_host_suffix_checking=*/false, proto::BLOOM_FILTER_FORMAT_PLAINTEXT); - // Fragments are not matched. - EXPECT_FALSE(opt_filter.Matches(GURL("https://shopping.com/#test"))); + EXPECT_TRUE(opt_filter.Matches(GURL("https://shopping.com/#test"))); +} + +TEST(OptimizationFilterTest, TestMatchesRegexpClearsAuth) { + std::unique_ptr<RegexpList> regexps(CreateRegexps({"test"})); + OptimizationFilter opt_filter(/*bloom_filter=*/nullptr, std::move(regexps), + /*exclusion_regexps=*/nullptr, + /*skip_host_suffix_checking=*/false, + proto::BLOOM_FILTER_FORMAT_PLAINTEXT); + EXPECT_FALSE(opt_filter.Matches(GURL("https://test:pwd@shopping.com/"))); } TEST(OptimizationFilterTest, TestMatchesRegexpInvalid) {
diff --git a/components/optimization_guide/internal b/components/optimization_guide/internal index 7b2f083..b7e6fb0 160000 --- a/components/optimization_guide/internal +++ b/components/optimization_guide/internal
@@ -1 +1 @@ -Subproject commit 7b2f0838de2b4376b099b37b142e8383182d89fd +Subproject commit b7e6fb03e487cc73b04e63306c1e58f435efa6c4
diff --git a/components/permissions/contexts/speaker_selection_permission_context.cc b/components/permissions/contexts/speaker_selection_permission_context.cc index d0c41a9..33bc30f 100644 --- a/components/permissions/contexts/speaker_selection_permission_context.cc +++ b/components/permissions/contexts/speaker_selection_permission_context.cc
@@ -5,47 +5,13 @@ #include "components/permissions/contexts/speaker_selection_permission_context.h" #include "components/content_settings/core/common/content_settings_types.h" +#include "components/permissions/permission_util.h" +#include "content/public/browser/render_frame_host.h" #include "third_party/blink/public/mojom/permissions_policy/permissions_policy.mojom.h" -namespace permissions { - SpeakerSelectionPermissionContext::SpeakerSelectionPermissionContext( content::BrowserContext* browser_context) : PermissionContextBase( browser_context, ContentSettingsType::SPEAKER_SELECTION, blink::mojom::PermissionsPolicyFeature::kSpeakerSelection) {} - -ContentSetting SpeakerSelectionPermissionContext::GetPermissionStatusInternal( - content::RenderFrameHost* render_frame_host, - const GURL& requesting_origin, - const GURL& embedding_origin) const { - // TODO(https://crbug.com/41492674): It will be revisited when the policy - // is enabled. - return CONTENT_SETTING_ASK; -} - -void SpeakerSelectionPermissionContext::DecidePermission( - permissions::PermissionRequestData request_data, - permissions::BrowserPermissionCallback callback) { - // TODO(https://crbug.com/41492674): It will be revisited when the policy - // is enabled. - NotifyPermissionSet(request_data.id, request_data.requesting_origin, - request_data.embedding_origin, std::move(callback), - /*persist=*/false, CONTENT_SETTING_DEFAULT, - /*is_one_time=*/false, - /*is_final_decision=*/true); -} - -void SpeakerSelectionPermissionContext::UpdateContentSetting( - const GURL& requesting_origin, - const GURL& embedding_origin, - ContentSetting content_setting, - bool is_one_time) { - // TODO(https://crbug.com/41492674): It should continue to support of - // implicit consent via getUserMedia(). - // https://w3c.github.io/mediacapture-output/#privacy-obtaining-consent) - NOTIMPLEMENTED(); -} - -} // namespace permissions
diff --git a/components/permissions/contexts/speaker_selection_permission_context.h b/components/permissions/contexts/speaker_selection_permission_context.h index fb49b1b26..0d5a8fb 100644 --- a/components/permissions/contexts/speaker_selection_permission_context.h +++ b/components/permissions/contexts/speaker_selection_permission_context.h
@@ -7,8 +7,9 @@ #include "components/permissions/permission_context_base.h" -namespace permissions { - +// TODO(https://crbug.com/41492674): speaker selection is not hooked with +// MediaStreamDevicesController yet, which could be when we have permission +// prompt for speaker selection. class SpeakerSelectionPermissionContext : public permissions::PermissionContextBase { public: @@ -20,23 +21,6 @@ delete; SpeakerSelectionPermissionContext& operator=( const SpeakerSelectionPermissionContext&) = delete; - - protected: - ContentSetting GetPermissionStatusInternal( - content::RenderFrameHost* render_frame_host, - const GURL& requesting_origin, - const GURL& embedding_origin) const override; - - void DecidePermission( - permissions::PermissionRequestData request_data, - permissions::BrowserPermissionCallback callback) override; - - void UpdateContentSetting(const GURL& requesting_origin, - const GURL& embedding_origin, - ContentSetting content_setting, - bool is_one_time) override; }; -} // namespace permissions - #endif // COMPONENTS_PERMISSIONS_CONTEXTS_SPEAKER_SELECTION_PERMISSION_CONTEXT_H_
diff --git a/components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_impl_unittest.cc b/components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_impl_unittest.cc index 595bf1d2..51ad553c 100644 --- a/components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_impl_unittest.cc +++ b/components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_impl_unittest.cc
@@ -20,18 +20,24 @@ #include "base/test/test_mock_time_task_runner.h" #include "base/time/time.h" #include "base/token.h" +#include "cc/base/math_util.h" #include "components/viz/common/frame_sinks/begin_frame_args.h" #include "components/viz/common/frame_sinks/copy_output_request.h" #include "components/viz/common/frame_sinks/copy_output_result.h" #include "components/viz/common/frame_sinks/copy_output_util.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "components/viz/common/surfaces/subtree_capture_id.h" #include "components/viz/common/surfaces/video_capture_target.h" +#include "components/viz/service/frame_sinks/gmb_video_frame_pool_context_provider.h" #include "components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_manager.h" +#include "gpu/command_buffer/client/client_shared_image.h" #include "media/base/limits.h" #include "media/base/test_helpers.h" #include "media/base/video_util.h" #include "media/capture/mojom/video_capture_buffer.mojom.h" #include "media/capture/mojom/video_capture_types.mojom.h" +#include "media/video/fake_gpu_memory_buffer.h" +#include "media/video/renderable_gpu_memory_buffer_video_frame_pool.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/receiver.h" @@ -108,6 +114,32 @@ } } +gfx::BufferFormat GetBufferFormatForVideoPixelFormat( + media::VideoPixelFormat format) { + switch (format) { + case media::PIXEL_FORMAT_ABGR: + return gfx::BufferFormat::RGBA_8888; + case media::PIXEL_FORMAT_NV12: + return gfx::BufferFormat::YUV_420_BIPLANAR; + default: + NOTREACHED_NORETURN(); + } +} + +gfx::Size GetBufferSizeInPixelsForVideoPixelFormat( + media::VideoPixelFormat format, + const gfx::Size& coded_size) { + switch (format) { + case media::PIXEL_FORMAT_ABGR: + return coded_size; + case media::PIXEL_FORMAT_NV12: + return {cc::MathUtil::CheckedRoundUp(coded_size.width(), 2), + cc::MathUtil::CheckedRoundUp(coded_size.height(), 2)}; + default: + NOTREACHED_NORETURN(); + } +} + // Dummy frame sink ID. const VideoCaptureTarget kVideoCaptureTarget(FrameSinkId(1, 1)); @@ -209,40 +241,60 @@ CHECK(info); mojo::Remote callbacks_remote(std::move(callbacks)); + scoped_refptr<media::VideoFrame> frame; - CHECK(data->is_read_only_shmem_region()); - base::ReadOnlySharedMemoryRegion& shmem_region = - data->get_read_only_shmem_region(); + if (data->is_read_only_shmem_region()) { + // kDefault + I420 / RGBA + base::ReadOnlySharedMemoryRegion& shmem_region = + data->get_read_only_shmem_region(); - // The |data| parameter is not nullable and mojo type mapping for - // `base::ReadOnlySharedMemoryRegion` defines that nullable version of it is - // the same type, with null check being equivalent to IsValid() check. Given - // the above, we should never be able to receive a read only shmem region - // that is not valid - mojo will enforce it for us. - DCHECK(shmem_region.IsValid()); + // The |data| parameter is not nullable and mojo type mapping for + // `base::ReadOnlySharedMemoryRegion` defines that nullable version of it + // is the same type, with null check being equivalent to IsValid() check. + // Given the above, we should never be able to receive a read only shmem + // region that is not valid - mojo will enforce it for us. + DCHECK(shmem_region.IsValid()); - auto required_bytes_to_hold_planes = - media::VideoFrame::AllocationSize(info->pixel_format, info->coded_size); - ASSERT_LE(required_bytes_to_hold_planes, shmem_region.GetSize()); + auto required_bytes_to_hold_planes = media::VideoFrame::AllocationSize( + info->pixel_format, info->coded_size); + ASSERT_LE(required_bytes_to_hold_planes, shmem_region.GetSize()); - // Map the shared memory buffer and re-constitute a VideoFrame instance - // around it for analysis via TakeFrame(). - base::ReadOnlySharedMemoryMapping mapping = shmem_region.Map(); - ASSERT_TRUE(mapping.IsValid()); - ASSERT_LE(required_bytes_to_hold_planes, mapping.size()); - scoped_refptr<media::VideoFrame> frame = - media::VideoFrame::WrapExternalData( - info->pixel_format, info->coded_size, info->visible_rect, - info->visible_rect.size(), mapping.GetMemoryAs<const uint8_t>(), - mapping.size(), info->timestamp); - ASSERT_TRUE(frame); + // Map the shared memory buffer and re-constitute a VideoFrame instance + // around it for analysis via TakeFrame(). + base::ReadOnlySharedMemoryMapping mapping = shmem_region.Map(); + ASSERT_TRUE(mapping.IsValid()); + ASSERT_LE(required_bytes_to_hold_planes, mapping.size()); + frame = media::VideoFrame::WrapExternalData( + info->pixel_format, info->coded_size, info->visible_rect, + info->visible_rect.size(), mapping.GetMemoryAs<const uint8_t>(), + mapping.size(), info->timestamp); + ASSERT_TRUE(frame); + frame->AddDestructionObserver( + base::BindOnce([](base::ReadOnlySharedMemoryMapping mapping) {}, + std::move(mapping))); + } else if (data->is_gpu_memory_buffer_handle()) { + // kNativeTexture + NV12 / RGBA + // Create a fake GpuMemoryBuffer as these test don't run the code to + // produce GPU frames. The mailbox values aren't important since + // IsLetterboxedFrame does no verification for GMB VideoFrames. + auto gmb_dummy = std::make_unique<media::FakeGpuMemoryBuffer>( + GetBufferSizeInPixelsForVideoPixelFormat(info->pixel_format, + info->coded_size), + GetBufferFormatForVideoPixelFormat(info->pixel_format)); + gpu::MailboxHolder mailbox_dummy[4]; + + // The frame is only gonna tell Letterbox to skip the test. + frame = media::VideoFrame::WrapExternalGpuMemoryBuffer( + info->visible_rect, info->visible_rect.size(), std::move(gmb_dummy), + mailbox_dummy, base::NullCallback(), info->timestamp); + ASSERT_TRUE(frame); + } else { + NOTREACHED_NORETURN(); + } + frame->set_metadata(info->metadata); frame->set_color_space(info->color_space); - - frame->AddDestructionObserver(base::BindOnce( - [](base::ReadOnlySharedMemoryMapping mapping) {}, std::move(mapping))); OnFrameCapturedMock(); - frames_.push_back(std::move(frame)); done_callbacks_.push_back( base::BindOnce(&mojom::FrameSinkVideoConsumerFrameCallbacks::Done, @@ -260,6 +312,27 @@ std::vector<base::OnceClosure> done_callbacks_; }; +class FakeGpuCopyResult : public CopyOutputResult { + public: + FakeGpuCopyResult(Format format, const gfx::Rect rect) + : CopyOutputResult(format, + CopyOutputResult::Destination::kNativeTextures, + rect, + false), + format_(format), + result_(TextureResult( + gpu::Mailbox{}, + gpu::SyncToken{}, + GetColorSpaceForPixelFormat( + CopyOutputRequestFormatToVideoPixelFormat(format)))) {} + + const TextureResult* GetTextureResult() const final { return &result_; } + + private: + Format format_; + TextureResult result_; +}; + class SolidColorRGBAResult : public CopyOutputResult { public: SolidColorRGBAResult(const gfx::Rect rect, SkColor color) @@ -405,15 +478,30 @@ EXPECT_EQ(expected_content_rect, request->result_selection()); std::unique_ptr<CopyOutputResult> result; - switch (request->result_format()) { - case CopyOutputRequest::ResultFormat::I420_PLANES: { - result = std::make_unique<SolidColorI420Result>( - request->result_selection(), RGBToYUV(color_)); + switch (request->result_destination()) { + case CopyOutputResult::Destination::kSystemMemory: { + // We need to construct the source frame. + switch (request->result_format()) { + case CopyOutputRequest::ResultFormat::I420_PLANES: { + result = std::make_unique<SolidColorI420Result>( + request->result_selection(), RGBToYUV(color_)); + break; + } + case CopyOutputRequest::ResultFormat::RGBA: { + result = std::make_unique<SolidColorRGBAResult>( + request->result_selection(), color_); + break; + } + default: { + NOTREACHED_NORETURN(); + } + } break; } - case CopyOutputRequest::ResultFormat::RGBA: { - result = std::make_unique<SolidColorRGBAResult>( - request->result_selection(), color_); + case CopyOutputResult::Destination::kNativeTextures: { + // We don't need to provide a real GPU result. + result = std::make_unique<FakeGpuCopyResult>( + request->result_format(), request->result_selection()); break; } default: { @@ -619,6 +707,11 @@ const VideoFrame& frame = *arg; + // Pretend kUseGpuMemoryBuffer rendered corrected data. + if (frame.HasGpuMemoryBuffer()) { + return true; + } + switch (pixel_format) { case media::PIXEL_FORMAT_ARGB: { return IsLetterboxedRGBA(color, content_rect, frame, result_listener); @@ -660,6 +753,68 @@ PropertiesCallback properties_cb_; }; +class TestGmbVideoFramePoolContext + : public media::RenderableGpuMemoryBufferVideoFramePool::Context { + public: + TestGmbVideoFramePoolContext() {} + ~TestGmbVideoFramePoolContext() override = default; + + std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer( + const gfx::Size& size, + gfx::BufferFormat format, + gfx::BufferUsage usage) override { + return std::make_unique<media::FakeGpuMemoryBuffer>(size, format); + } + + scoped_refptr<gpu::ClientSharedImage> CreateSharedImage( + gfx::GpuMemoryBuffer* gpu_memory_buffer, + const SharedImageFormat& si_format, + const gfx::ColorSpace& color_space, + GrSurfaceOrigin surface_origin, + SkAlphaType alpha_type, + uint32_t usage, + gpu::SyncToken& sync_token) override { + return base::MakeRefCounted<gpu::ClientSharedImage>( + gpu::Mailbox::GenerateForSharedImage(), + gpu::SharedImageMetadata(si_format, gpu_memory_buffer->GetSize(), + color_space, surface_origin, alpha_type, + usage), + sync_token, nullptr); + } + + scoped_refptr<gpu::ClientSharedImage> CreateSharedImage( + gfx::GpuMemoryBuffer* gpu_memory_buffer, + gfx::BufferPlane plane, + const gfx::ColorSpace& color_space, + GrSurfaceOrigin surface_origin, + SkAlphaType alpha_type, + uint32_t usage, + gpu::SyncToken& sync_token) override { + return base::MakeRefCounted<gpu::ClientSharedImage>( + gpu::Mailbox::GenerateForSharedImage(), + gpu::SharedImageMetadata( + GetSinglePlaneSharedImageFormat(gpu_memory_buffer->GetFormat()), + gpu_memory_buffer->GetSize(), color_space, surface_origin, + alpha_type, usage), + sync_token, nullptr); + } + + void DestroySharedImage( + const gpu::SyncToken& sync_token, + scoped_refptr<gpu::ClientSharedImage> shared_image) override {} +}; + +class TestGmbVideoFramePoolContextProvider + : public GmbVideoFramePoolContextProvider { + public: + ~TestGmbVideoFramePoolContextProvider() override = default; + + std::unique_ptr<media::RenderableGpuMemoryBufferVideoFramePool::Context> + CreateContext(base::OnceClosure on_context_lost) final { + return std::make_unique<TestGmbVideoFramePoolContext>(); + } +}; + } // namespace class FrameSinkVideoCapturerTest @@ -674,9 +829,13 @@ auto oracle = std::make_unique<InstrumentedVideoCaptureOracle>( true /* enable_auto_throttling */); oracle_ = oracle.get(); + + gmb_context_provider_ = + std::make_unique<TestGmbVideoFramePoolContextProvider>(); + capturer_ = std::make_unique<FrameSinkVideoCapturerImpl>( - &frame_sink_manager_, nullptr, mojo::NullReceiver(), std::move(oracle), - false); + &frame_sink_manager_, gmb_context_provider_.get(), mojo::NullReceiver(), + std::move(oracle), false); } void SetUp() override { @@ -728,6 +887,11 @@ PropagateMojoTasks(); } + bool IsUsingGpuMemoryBuffer() { + return buffer_format_preference_ == + mojom::BufferFormatPreference::kPreferGpuMemoryBuffer; + } + base::TimeTicks GetNextVsync() const { const auto now = task_runner_->NowTicks(); return now + kVsyncInterval - ((now - start_time_) % kVsyncInterval); @@ -802,7 +966,10 @@ base::TimeTicks start_time_; MockFrameSinkManager frame_sink_manager_; FakeCapturableFrameSink frame_sink_; + + std::unique_ptr<TestGmbVideoFramePoolContextProvider> gmb_context_provider_; std::unique_ptr<FrameSinkVideoCapturerImpl> capturer_; + raw_ptr<InstrumentedVideoCaptureOracle> oracle_; mojom::BufferFormatPreference buffer_format_preference_; media::VideoPixelFormat pixel_format_; @@ -1929,6 +2096,11 @@ } TEST_P(FrameSinkVideoCapturerTest, ProperlyHandlesCaptureSizeForOverlay) { + // Skip this test for GMB, as it is not rendered by us. + if (IsUsingGpuMemoryBuffer()) { + return; + } + SwitchToSizeSet(kSizeSets[4]); constexpr gfx::Rect kValidCropBounds{1, 2, 638, 476}; const auto kCropId = RegionCaptureCropId::CreateRandom(); @@ -1997,6 +2169,11 @@ } TEST_P(FrameSinkVideoCapturerTest, ProperlyHandlesSubtreeSizeForOverlay) { + // Skip this test for GMB, as it is not rendered by us. + if (IsUsingGpuMemoryBuffer()) { + return; + } + SwitchToSizeSet(kSizeSets[4]); constexpr gfx::Rect kCaptureBounds{0, 0, 640, 478}; constexpr SubtreeCaptureId kCaptureId(base::Token(0u, 1234567u)); @@ -2067,9 +2244,12 @@ INSTANTIATE_TEST_SUITE_P( All, FrameSinkVideoCapturerTest, - testing::Values(std::tuple(mojom::BufferFormatPreference::kDefault, - media::PIXEL_FORMAT_I420), - std::tuple(mojom::BufferFormatPreference::kDefault, - media::PIXEL_FORMAT_ARGB))); + testing::Values( + std::tuple(mojom::BufferFormatPreference::kDefault, + media::PIXEL_FORMAT_I420), + std::tuple(mojom::BufferFormatPreference::kDefault, + media::PIXEL_FORMAT_ARGB), + std::tuple(mojom::BufferFormatPreference::kPreferGpuMemoryBuffer, + media::PIXEL_FORMAT_NV12))); } // namespace viz
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index 79e2564..dfaaffe 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -2669,7 +2669,10 @@ "BrowserEngineKit.framework", "IOSurface.framework", ] - deps += [ "//ui/accelerated_widget_mac" ] + deps += [ + "//build:ios_buildflags", + "//ui/accelerated_widget_mac", + ] } else { # Not Mac. deps += [ "//sandbox" ]
diff --git a/content/browser/attribution_reporting/attribution_interop_runner.cc b/content/browser/attribution_reporting/attribution_interop_runner.cc index 2a7589a2..ac11213 100644 --- a/content/browser/attribution_reporting/attribution_interop_runner.cc +++ b/content/browser/attribution_reporting/attribution_interop_runner.cc
@@ -398,6 +398,27 @@ BrowserTaskEnvironment task_environment( base::test::TaskEnvironment::TimeSource::MOCK_TIME); TestBrowserContext browser_context; + + // Ensure that `time_origin` has a whole number of seconds to make + // `AdjustEventLevelBody()` time calculations robust against + // sub-second-precision report times, which otherwise cannot be recovered + // because the `scheduled_report_time` field has second precision. + { + const base::Time with_millis = base::Time::Now(); + + base::Time::Exploded exploded; + with_millis.UTCExplode(&exploded); + DCHECK(exploded.HasValidValues()); + exploded.millisecond = 0; + + base::Time without_millis; + bool ok = base::Time::FromUTCExploded(exploded, &without_millis); + DCHECK(ok); + + task_environment.FastForwardBy((without_millis + base::Seconds(1)) - + with_millis); + } + const base::Time time_origin = base::Time::Now(); ASSIGN_OR_RETURN(AttributionSimulationEvents events,
diff --git a/content/browser/devtools/protocol/network_handler.cc b/content/browser/devtools/protocol/network_handler.cc index 6c9a93f..3047b26 100644 --- a/content/browser/devtools/protocol/network_handler.cc +++ b/content/browser/devtools/protocol/network_handler.cc
@@ -15,6 +15,7 @@ #include "base/command_line.h" #include "base/containers/contains.h" #include "base/containers/queue.h" +#include "base/containers/span.h" #include "base/feature_list.h" #include "base/functional/bind.h" #include "base/i18n/i18n_constants.h" @@ -1856,9 +1857,7 @@ ssl_info.cert->GetSubjectAltName(&san_dns, &san_ip); auto san_list = std::make_unique<protocol::Array<String>>(std::move(san_dns)); for (const std::string& san : san_ip) { - san_list->emplace_back( - net::IPAddress(reinterpret_cast<const uint8_t*>(san.data()), san.size()) - .ToString()); + san_list->emplace_back(net::IPAddress(base::as_byte_span(san)).ToString()); } const char* protocol = "";
diff --git a/content/browser/media/media_devices_permission_checker.cc b/content/browser/media/media_devices_permission_checker.cc index 6aba16a8..4f3a312d 100644 --- a/content/browser/media/media_devices_permission_checker.cc +++ b/content/browser/media/media_devices_permission_checker.cc
@@ -43,29 +43,37 @@ RenderFrameHostDelegate* delegate = frame_host->delegate(); url::Origin origin = frame_host->GetLastCommittedOrigin(); - bool audio_permission = delegate->CheckMediaAccessPermission( + bool microphone_permission = delegate->CheckMediaAccessPermission( frame_host, origin, blink::mojom::MediaStreamType::DEVICE_AUDIO_CAPTURE); - bool mic_permissions_policy = true; - bool camera_permissions_policy = true; - mic_permissions_policy = frame_host->IsFeatureEnabled( + + bool speaker_selection_permission = + frame_host->GetBrowserContext() + ->GetPermissionController() + ->GetPermissionStatusForCurrentDocument( + blink::PermissionType::SPEAKER_SELECTION, frame_host) == + blink::mojom::PermissionStatus::GRANTED; + + bool mic_permissions_policy = frame_host->IsFeatureEnabled( blink::mojom::PermissionsPolicyFeature::kMicrophone); - camera_permissions_policy = frame_host->IsFeatureEnabled( + bool camera_permissions_policy = frame_host->IsFeatureEnabled( blink::mojom::PermissionsPolicyFeature::kCamera); + bool speaker_selection_permissions_policy = frame_host->IsFeatureEnabled( + blink::mojom::PermissionsPolicyFeature::kSpeakerSelection); MediaDevicesManager::BoolDeviceTypes result; // Speakers. - // TODO(guidou): use specific permission for audio output when it becomes - // available. See http://crbug.com/556542. + result[static_cast<size_t>(MediaDeviceType::kMediaAudioOuput)] = requested_device_types[static_cast<size_t>( MediaDeviceType::kMediaAudioOuput)] && - audio_permission; + (microphone_permission || speaker_selection_permission) && + speaker_selection_permissions_policy; // Mic. result[static_cast<size_t>(MediaDeviceType::kMediaAudioInput)] = requested_device_types[static_cast<size_t>( MediaDeviceType::kMediaAudioInput)] && - audio_permission && mic_permissions_policy; + microphone_permission && mic_permissions_policy; // Camera. result[static_cast<size_t>(MediaDeviceType::kMediaVideoInput)] =
diff --git a/docs/linux/profiling.md b/docs/linux/profiling.md index 029fb974..4c6d6b2 100644 --- a/docs/linux/profiling.md +++ b/docs/linux/profiling.md
@@ -35,6 +35,10 @@ perf record -f -g -a # captures the whole system ``` +> ⚠️ Note: on virtualized systems, e.g. cloudtops, the PMU counters may not +be available or may be broken. Use `-e cpu-clock` as a workaround. +Googlers, see [b/313526654](https://b.corp.google.com/issues/313526654). + Some versions of the perf command can be confused by process renames. Affected versions will be unable to resolve Chromium's symbols if it was started through perf, as in the first example above. It should work correctly if you attach to
diff --git a/infra/config/generated/testing/variants.pyl b/infra/config/generated/testing/variants.pyl index 3e3be86..9f466c5 100644 --- a/infra/config/generated/testing/variants.pyl +++ b/infra/config/generated/testing/variants.pyl
@@ -307,16 +307,16 @@ }, 'LACROS_VERSION_SKEW_CANARY': { 'identifier': 'Lacros version skew testing ash canary', - 'description': 'Run with ash-chrome version 124.0.6331.0', + 'description': 'Run with ash-chrome version 124.0.6333.0', 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6331.0/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6333.0/test_ash_chrome', ], 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v124.0.6331.0', - 'revision': 'version:124.0.6331.0', + 'location': 'lacros_version_skew_tests_v124.0.6333.0', + 'revision': 'version:124.0.6333.0', }, ], },
diff --git a/infra/config/targets/lacros-version-skew-variants.json b/infra/config/targets/lacros-version-skew-variants.json index f16c01c..df90d1ea 100644 --- a/infra/config/targets/lacros-version-skew-variants.json +++ b/infra/config/targets/lacros-version-skew-variants.json
@@ -1,16 +1,16 @@ { "LACROS_VERSION_SKEW_CANARY": { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6331.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6333.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 124.0.6331.0", + "description": "Run with ash-chrome version 124.0.6333.0", "identifier": "Lacros version skew testing ash canary", "swarming": { "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6331.0", - "revision": "version:124.0.6331.0" + "location": "lacros_version_skew_tests_v124.0.6333.0", + "revision": "version:124.0.6333.0" } ] }
diff --git a/media/renderers/video_resource_updater.cc b/media/renderers/video_resource_updater.cc index 64bdfb5..2cff6e6 100644 --- a/media/renderers/video_resource_updater.cc +++ b/media/renderers/video_resource_updater.cc
@@ -489,8 +489,12 @@ #endif } -bool UseMultiplanarSoftwarePixelUpload() { - return CanUseRasterInterface() && IsWritePixelsYUVEnabled(); +bool UseMultiplanarSoftwarePixelUpload(const gfx::ColorSpace& cs) { + // Multiplanar upload requires a valid SkYUVColorSpace -- which doesn't exist + // for all possible color space combinations. + SkYUVColorSpace unused; + return (!cs.IsValid() || cs.ToSkYUVColorSpace(&unused)) && + CanUseRasterInterface() && IsWritePixelsYUVEnabled(); } class CopyingSyncTokenClient : public VideoFrame::SyncTokenClient { @@ -1299,6 +1303,7 @@ viz::SharedImageFormat VideoResourceUpdater::GetSoftwareOutputFormat( VideoPixelFormat input_frame_format, int bits_per_channel, + const gfx::ColorSpace& input_frame_color_space, bool& texture_needs_rgb_conversion_out) { viz::SharedImageFormat output_si_format; if (IsFrameFormat32BitRGB(input_frame_format)) { @@ -1335,7 +1340,7 @@ // If it is multiplanar with RasterInterface support and does not need RGB // conversion, go through RasterDecoder WritePixelsYUV path. - if (UseMultiplanarSoftwarePixelUpload() && + if (UseMultiplanarSoftwarePixelUpload(input_frame_color_space) && !texture_needs_rgb_conversion_out) { // Get the supported channel format for the `output_si_format`'s first // plane. @@ -1366,8 +1371,9 @@ std::optional<viz::SharedImageFormat> VideoResourceUpdater::GetSoftwareSubplaneFormat( VideoPixelFormat input_frame_format, + const gfx::ColorSpace& input_frame_color_space, viz::SharedImageFormat output_si_format) { - if (UseMultiplanarSoftwarePixelUpload()) { + if (UseMultiplanarSoftwarePixelUpload(input_frame_color_space)) { // Subplane format is not needed for multiplanar SI. return std::nullopt; } @@ -1766,9 +1772,13 @@ SkYUVAInfo::Subsampling subsampling = ToSkYUVASubsampling(yuv_si_format); // TODO(crbug.com/828599): This should really default to rec709. - SkYUVColorSpace color_space = kRec601_SkYUVColorSpace; - video_frame->ColorSpace().ToSkYUVColorSpace(video_frame->BitDepth(), - &color_space); + SkYUVColorSpace color_space = kIdentity_SkYUVColorSpace; + if (video_frame->ColorSpace().IsValid()) { + // This feature is disabled for valid but unsupported color spaces, so we + // should always get a valid SkYUVColorSpace out by this point. + CHECK(video_frame->ColorSpace().ToSkYUVColorSpace(video_frame->BitDepth(), + &color_space)); + } SkYUVAInfo info = SkYUVAInfo(video_size, plane_config, subsampling, color_space); SkYUVAPixmaps yuv_pixmap = SkYUVAPixmaps::FromExternalPixmaps(info, pixmaps); @@ -1788,9 +1798,11 @@ bool texture_needs_rgb_conversion = false; viz::SharedImageFormat output_si_format = GetSoftwareOutputFormat( - input_frame_format, bits_per_channel, texture_needs_rgb_conversion); + input_frame_format, bits_per_channel, video_frame->ColorSpace(), + texture_needs_rgb_conversion); std::optional<viz::SharedImageFormat> subplane_si_format = - GetSoftwareSubplaneFormat(input_frame_format, output_si_format); + GetSoftwareSubplaneFormat(input_frame_format, video_frame->ColorSpace(), + output_si_format); gfx::ColorSpace output_color_space = video_frame->ColorSpace(); size_t output_resource_count = VideoFrame::NumPlanes(input_frame_format); @@ -1919,7 +1931,7 @@ } const auto yuv_si_format = output_si_format; - if (UseMultiplanarSoftwarePixelUpload()) { + if (UseMultiplanarSoftwarePixelUpload(video_frame->ColorSpace())) { CHECK_EQ(plane_resources.size(), 1u); HardwarePlaneResource* resource = plane_resources[0]->AsHardware(); CHECK_EQ(resource->si_format(), yuv_si_format); @@ -1979,7 +1991,7 @@ plane_resource->plane_resource_id())); } - if (UseMultiplanarSoftwarePixelUpload()) { + if (UseMultiplanarSoftwarePixelUpload(video_frame->ColorSpace())) { // With multiplanar shared images, a TextureDrawQuad is created instead of a // YUVDrawQuad. external_resources.type = VideoFrameResourceType::RGB;
diff --git a/media/renderers/video_resource_updater.h b/media/renderers/video_resource_updater.h index f5249e15f..0056439 100644 --- a/media/renderers/video_resource_updater.h +++ b/media/renderers/video_resource_updater.h
@@ -188,12 +188,14 @@ viz::SharedImageFormat GetSoftwareOutputFormat( VideoPixelFormat input_frame_format, int bits_per_channel, + const gfx::ColorSpace& input_frame_color_space, bool& texture_needs_rgb_conversion_out); // Get the subplane shared image format used for creating // SoftwarePlaneResource per plane for multiplanar formats. std::optional<viz::SharedImageFormat> GetSoftwareSubplaneFormat( VideoPixelFormat input_frame_format, + const gfx::ColorSpace& input_frame_color_space, viz::SharedImageFormat output_si_format); // Transfer RGB pixels from the video frame to software resource through
diff --git a/media/renderers/video_resource_updater_unittest.cc b/media/renderers/video_resource_updater_unittest.cc index 22a274d..675ba6b 100644 --- a/media/renderers/video_resource_updater_unittest.cc +++ b/media/renderers/video_resource_updater_unittest.cc
@@ -500,6 +500,27 @@ } } +TEST_F(VideoResourceUpdaterTest, SoftwareFrameYCOCG) { + std::unique_ptr<VideoResourceUpdater> updater = CreateUpdaterForHardware(); + scoped_refptr<VideoFrame> video_frame = CreateTestYUVVideoFrame(); + video_frame->set_color_space(gfx::ColorSpace( + gfx::ColorSpace::PrimaryID::BT709, gfx::ColorSpace::TransferID::BT709, + gfx::ColorSpace::MatrixID::YCOCG, gfx::ColorSpace::RangeID::FULL)); + + // We should always get `VideoFrameResourceType::YUV` since Skia doesn't + // support YCoCg color spaces. + + VideoFrameExternalResources resources = + updater->CreateExternalResourcesFromVideoFrame(video_frame); + EXPECT_EQ(VideoFrameResourceType::YUV, resources.type); + + // Setting to kSharedImageFormat, resources type should not change. + video_frame->set_shared_image_format_type( + SharedImageFormatType::kSharedImageFormat); + resources = updater->CreateExternalResourcesFromVideoFrame(video_frame); + EXPECT_EQ(VideoFrameResourceType::YUV, resources.type); +} + // Ensure the visible data is where it's supposed to be. TEST_F(VideoResourceUpdaterTest, SoftwareFrameRGBNonOrigin) { std::unique_ptr<VideoResourceUpdater> updater = CreateUpdaterForHardware();
diff --git a/media/video/fake_gpu_memory_buffer.cc b/media/video/fake_gpu_memory_buffer.cc index a1d4739..3790f89 100644 --- a/media/video/fake_gpu_memory_buffer.cc +++ b/media/video/fake_gpu_memory_buffer.cc
@@ -15,6 +15,11 @@ #include <sys/types.h> #endif +#if BUILDFLAG(IS_FUCHSIA) +#include <lib/zx/eventpair.h> +#include <lib/zx/object.h> +#endif + namespace media { namespace { @@ -87,6 +92,13 @@ } handle_.native_pixmap_handle.modifier = modifier; #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) + +#if BUILDFLAG(IS_FUCHSIA) + zx::eventpair client_handle, service_handle; + zx::eventpair::create(0, &client_handle, &service_handle); + handle_.native_pixmap_handle.buffer_collection_handle = + std::move(client_handle); +#endif } FakeGpuMemoryBuffer::~FakeGpuMemoryBuffer() = default; @@ -132,7 +144,7 @@ gfx::GpuMemoryBufferHandle handle; handle.type = gfx::NATIVE_PIXMAP; handle.id = handle_.id; -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) handle.native_pixmap_handle = gfx::CloneHandleForIPC(handle_.native_pixmap_handle); #endif
diff --git a/net/android/network_library.cc b/net/android/network_library.cc index d4ae0db..4da19cf 100644 --- a/net/android/network_library.cc +++ b/net/android/network_library.cc
@@ -165,7 +165,7 @@ base::android::JavaArrayOfByteArrayToBytesVector( env, Java_DnsStatus_getDnsServers(env, dns_status), &dns_servers_data); for (const std::vector<uint8_t>& dns_address_data : dns_servers_data) { - IPAddress dns_address(dns_address_data.data(), dns_address_data.size()); + IPAddress dns_address(dns_address_data); IPEndPoint dns_server(dns_address, dns_protocol::kDefaultPort); dns_servers->push_back(dns_server); }
diff --git a/net/base/address_tracker_linux.cc b/net/base/address_tracker_linux.cc index 3884057..7139fa1 100644 --- a/net/base/address_tracker_linux.cc +++ b/net/base/address_tracker_linux.cc
@@ -14,6 +14,8 @@ #include <vector> #include "base/check.h" +#include "base/compiler_specific.h" +#include "base/containers/span.h" #include "base/dcheck_is_on.h" #include "base/files/scoped_file.h" #include "base/functional/bind.h" @@ -124,7 +126,9 @@ address = local; if (!address) return false; - *out = IPAddress(address, address_length); + // SAFETY: `address` is only set above after `RTA_PAYLOAD` is checked against + // `address_length`. + *out = IPAddress(UNSAFE_BUFFERS(base::span(address, address_length))); return true; }
diff --git a/net/base/ip_address.cc b/net/base/ip_address.cc index 6784bfa..ab76657 100644 --- a/net/base/ip_address.cc +++ b/net/base/ip_address.cc
@@ -185,17 +185,17 @@ IPAddressBytes::IPAddressBytes() : size_(0) {} -IPAddressBytes::IPAddressBytes(const uint8_t* data, size_t data_len) { - Assign(data, data_len); +IPAddressBytes::IPAddressBytes(base::span<const uint8_t> data) { + Assign(data); } IPAddressBytes::~IPAddressBytes() = default; IPAddressBytes::IPAddressBytes(IPAddressBytes const& other) = default; -void IPAddressBytes::Assign(const uint8_t* data, size_t data_len) { - size_ = data_len; - CHECK_GE(16u, data_len); - std::copy_n(data, data_len, bytes_.data()); +void IPAddressBytes::Assign(base::span<const uint8_t> data) { + CHECK_GE(16u, data.size()); + size_ = data.size(); + base::span(*this).copy_from(data); } bool IPAddressBytes::operator<(const IPAddressBytes& other) const { @@ -213,15 +213,10 @@ return !(*this == other); } -void IPAddressBytes::Append(const uint8_t* first, const uint8_t* last) { - CHECK_LE(first, last); - const ptrdiff_t bytes_to_append = last - first; - CHECK_LE(bytes_to_append, 16); - // Now we know `bytes_to_append` is between 0 and 16 and `size_` is between 0 - // and 255 so their sum must fit inside a ptrdiff_t type. - CHECK_LE(ptrdiff_t{size_} + bytes_to_append, 16); - std::copy(first, last, bytes_.data() + size_); - size_ += bytes_to_append; +void IPAddressBytes::Append(base::span<const uint8_t> data) { + CHECK_LE(data.size(), static_cast<size_t>(16 - size_)); + size_ += data.size(); + base::span(*this).last(data.size()).copy_from(data); } size_t IPAddressBytes::EstimateMemoryUsage() const { @@ -253,12 +248,12 @@ IPAddress::IPAddress(const IPAddressBytes& address) : ip_address_(address) {} -IPAddress::IPAddress(const uint8_t* address, size_t address_len) - : ip_address_(address, address_len) {} +IPAddress::IPAddress(base::span<const uint8_t> address) + : ip_address_(address) {} IPAddress::IPAddress(uint8_t b0, uint8_t b1, uint8_t b2, uint8_t b3) { const uint8_t bytes[] = {b0, b1, b2, b3}; - ip_address_.Assign(bytes, std::size(bytes)); + ip_address_.Assign(bytes); } IPAddress::IPAddress(uint8_t b0, @@ -279,7 +274,7 @@ uint8_t b15) { const uint8_t bytes[] = {b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15}; - ip_address_.Assign(bytes, std::size(bytes)); + ip_address_.Assign(bytes); } IPAddress::~IPAddress() = default; @@ -475,8 +470,8 @@ // IPv4-mapped addresses are formed by: // <80 bits of zeros> + <16 bits of ones> + <32-bit IPv4 address>. IPAddressBytes bytes; - bytes.Append(std::begin(kIPv4MappedPrefix), std::end(kIPv4MappedPrefix)); - bytes.Append(address.bytes().begin(), address.bytes().end()); + bytes.Append(kIPv4MappedPrefix); + bytes.Append(address.bytes()); return IPAddress(bytes); } @@ -484,8 +479,8 @@ DCHECK(address.IsIPv4MappedIPv6()); IPAddressBytes bytes; - bytes.Append(address.bytes().begin() + std::size(kIPv4MappedPrefix), - address.bytes().end()); + bytes.Append( + base::span(address.bytes()).subspan(std::size(kIPv4MappedPrefix))); return IPAddress(bytes); } @@ -584,68 +579,43 @@ DCHECK(address.IsIPv6()); IPAddress ipv4onlyarpa0(192, 0, 0, 170); IPAddress ipv4onlyarpa1(192, 0, 0, 171); - if (std::equal(ipv4onlyarpa0.bytes().begin(), ipv4onlyarpa0.bytes().end(), - address.bytes().begin() + 12u) || - std::equal(ipv4onlyarpa1.bytes().begin(), ipv4onlyarpa1.bytes().end(), - address.bytes().begin() + 12u)) { + auto span = base::span(address.bytes()); + + if (base::ranges::equal(ipv4onlyarpa0.bytes(), span.subspan(12u)) || + base::ranges::equal(ipv4onlyarpa1.bytes(), span.subspan(12u))) { return Dns64PrefixLength::k96bit; - } else if (std::equal(ipv4onlyarpa0.bytes().begin(), - ipv4onlyarpa0.bytes().end(), - address.bytes().begin() + 9u) || - std::equal(ipv4onlyarpa1.bytes().begin(), - ipv4onlyarpa1.bytes().end(), - address.bytes().begin() + 9u)) { - return Dns64PrefixLength::k64bit; - } else if ((std::equal(ipv4onlyarpa0.bytes().begin(), - ipv4onlyarpa0.bytes().begin() + 1u, - address.bytes().begin() + 7u) && - std::equal(ipv4onlyarpa0.bytes().begin() + 1u, - ipv4onlyarpa0.bytes().end(), - address.bytes().begin() + 9u)) || - (std::equal(ipv4onlyarpa1.bytes().begin(), - ipv4onlyarpa1.bytes().begin() + 1u, - address.bytes().begin() + 7u) && - std::equal(ipv4onlyarpa1.bytes().begin() + 1u, - ipv4onlyarpa1.bytes().end(), - address.bytes().begin() + 9u))) { - return Dns64PrefixLength::k56bit; - } else if ((std::equal(ipv4onlyarpa0.bytes().begin(), - ipv4onlyarpa0.bytes().begin() + 2u, - address.bytes().begin() + 6u) && - std::equal(ipv4onlyarpa0.bytes().begin() + 2u, - ipv4onlyarpa0.bytes().end(), - address.bytes().begin() + 9u)) || - ((std::equal(ipv4onlyarpa1.bytes().begin(), - ipv4onlyarpa1.bytes().begin() + 2u, - address.bytes().begin() + 6u) && - std::equal(ipv4onlyarpa1.bytes().begin() + 2u, - ipv4onlyarpa1.bytes().end(), - address.bytes().begin() + 9u)))) { - return Dns64PrefixLength::k48bit; - } else if ((std::equal(ipv4onlyarpa0.bytes().begin(), - ipv4onlyarpa0.bytes().begin() + 3u, - address.bytes().begin() + 5u) && - std::equal(ipv4onlyarpa0.bytes().begin() + 3u, - ipv4onlyarpa0.bytes().end(), - address.bytes().begin() + 9u)) || - (std::equal(ipv4onlyarpa1.bytes().begin(), - ipv4onlyarpa1.bytes().begin() + 3u, - address.bytes().begin() + 5u) && - std::equal(ipv4onlyarpa1.bytes().begin() + 3u, - ipv4onlyarpa1.bytes().end(), - address.bytes().begin() + 9u))) { - return Dns64PrefixLength::k40bit; - } else if (std::equal(ipv4onlyarpa0.bytes().begin(), - ipv4onlyarpa0.bytes().end(), - address.bytes().begin() + 4u) || - std::equal(ipv4onlyarpa1.bytes().begin(), - ipv4onlyarpa1.bytes().end(), - address.bytes().begin() + 4u)) { - return Dns64PrefixLength::k32bit; - } else { - // if ipv4onlyarpa address is not found return 0 - return Dns64PrefixLength::kInvalid; } + if (base::ranges::equal(ipv4onlyarpa0.bytes(), span.subspan(9u, 4u)) || + base::ranges::equal(ipv4onlyarpa1.bytes(), span.subspan(9u, 4u))) { + return Dns64PrefixLength::k64bit; + } + IPAddressBytes ipv4; + ipv4.Append(span.subspan(7u, 1u)); + ipv4.Append(span.subspan(9u, 3u)); + if (base::ranges::equal(ipv4onlyarpa0.bytes(), ipv4) || + base::ranges::equal(ipv4onlyarpa1.bytes(), ipv4)) { + return Dns64PrefixLength::k56bit; + } + ipv4 = IPAddressBytes(); + ipv4.Append(span.subspan(6u, 2u)); + ipv4.Append(span.subspan(9u, 2u)); + if (base::ranges::equal(ipv4onlyarpa0.bytes(), ipv4) || + base::ranges::equal(ipv4onlyarpa1.bytes(), ipv4)) { + return Dns64PrefixLength::k48bit; + } + ipv4 = IPAddressBytes(); + ipv4.Append(span.subspan(5u, 3u)); + ipv4.Append(span.subspan(9u, 1u)); + if (base::ranges::equal(ipv4onlyarpa0.bytes(), ipv4) || + base::ranges::equal(ipv4onlyarpa1.bytes(), ipv4)) { + return Dns64PrefixLength::k40bit; + } + if (base::ranges::equal(ipv4onlyarpa0.bytes(), span.subspan(4u, 4u)) || + base::ranges::equal(ipv4onlyarpa1.bytes(), span.subspan(4u, 4u))) { + return Dns64PrefixLength::k32bit; + } + // if ipv4onlyarpa address is not found return 0 + return Dns64PrefixLength::kInvalid; } IPAddress ConvertIPv4ToIPv4EmbeddedIPv6(const IPAddress& ipv4_address, @@ -661,52 +631,46 @@ switch (prefix_length) { case Dns64PrefixLength::k96bit: - bytes.Append(ipv6_address.bytes().begin(), - ipv6_address.bytes().begin() + 12u); - bytes.Append(ipv4_address.bytes().begin(), ipv4_address.bytes().end()); + bytes.Append(base::span(ipv6_address.bytes()).first(12u)); + bytes.Append(ipv4_address.bytes()); return IPAddress(bytes); case Dns64PrefixLength::k64bit: - bytes.Append(ipv6_address.bytes().begin(), - ipv6_address.bytes().begin() + 8u); - bytes.Append(std::begin(kZeroBits), std::begin(kZeroBits) + 1u); - bytes.Append(ipv4_address.bytes().begin(), ipv4_address.bytes().end()); - bytes.Append(std::begin(kZeroBits), std::begin(kZeroBits) + 3u); + bytes.Append(base::span(ipv6_address.bytes()).first(8u)); + bytes.Append(base::span(kZeroBits).first(1u)); + bytes.Append(ipv4_address.bytes()); + bytes.Append(base::span(kZeroBits).first(3u)); return IPAddress(bytes); - case Dns64PrefixLength::k56bit: - bytes.Append(ipv6_address.bytes().begin(), - ipv6_address.bytes().begin() + 7u); - bytes.Append(ipv4_address.bytes().begin(), - ipv4_address.bytes().begin() + 1u); - bytes.Append(std::begin(kZeroBits), std::begin(kZeroBits) + 1u); - bytes.Append(ipv4_address.bytes().begin() + 1u, - ipv4_address.bytes().end()); - bytes.Append(std::begin(kZeroBits), std::begin(kZeroBits) + 4u); + case Dns64PrefixLength::k56bit: { + bytes.Append(base::span(ipv6_address.bytes()).first(7u)); + auto [first, second] = base::span(ipv4_address.bytes()).split_at(1u); + bytes.Append(first); + bytes.Append(base::span(kZeroBits).first(1u)); + bytes.Append(second); + bytes.Append(base::span(kZeroBits).first(4u)); return IPAddress(bytes); - case Dns64PrefixLength::k48bit: - bytes.Append(ipv6_address.bytes().begin(), - ipv6_address.bytes().begin() + 6u); - bytes.Append(ipv4_address.bytes().begin(), - ipv4_address.bytes().begin() + 2u); - bytes.Append(std::begin(kZeroBits), std::begin(kZeroBits) + 1u); - bytes.Append(ipv4_address.bytes().begin() + 2u, - ipv4_address.bytes().end()); - bytes.Append(std::begin(kZeroBits), std::begin(kZeroBits) + 5u); + } + case Dns64PrefixLength::k48bit: { + bytes.Append(base::span(ipv6_address.bytes()).first(6u)); + auto [first, second] = base::span(ipv4_address.bytes()).split_at(2u); + bytes.Append(first); + bytes.Append(base::span(kZeroBits).first(1u)); + bytes.Append(second); + bytes.Append(base::span(kZeroBits).first(5u)); return IPAddress(bytes); - case Dns64PrefixLength::k40bit: - bytes.Append(ipv6_address.bytes().begin(), - ipv6_address.bytes().begin() + 5u); - bytes.Append(ipv4_address.bytes().begin(), - ipv4_address.bytes().begin() + 3u); - bytes.Append(std::begin(kZeroBits), std::begin(kZeroBits) + 1u); - bytes.Append(ipv4_address.bytes().begin() + 3u, - ipv4_address.bytes().end()); - bytes.Append(std::begin(kZeroBits), std::begin(kZeroBits) + 6u); + } + case Dns64PrefixLength::k40bit: { + bytes.Append(base::span(ipv6_address.bytes()).first(5u)); + auto [first, second] = base::span(ipv4_address.bytes()).split_at(3u); + bytes.Append(first); + bytes.Append(base::span(kZeroBits).first(1u)); + bytes.Append(second); + bytes.Append(base::span(kZeroBits).first(6u)); return IPAddress(bytes); + } case Dns64PrefixLength::k32bit: - bytes.Append(ipv6_address.bytes().begin(), - ipv6_address.bytes().begin() + 4u); - bytes.Append(ipv4_address.bytes().begin(), ipv4_address.bytes().end()); - bytes.Append(std::begin(kZeroBits), std::begin(kZeroBits) + 8u); + bytes.Append(base::span(ipv6_address.bytes()).first(4u)); + bytes.Append(ipv4_address.bytes()); + bytes.Append(base::span(kZeroBits).first(8u)); return IPAddress(bytes); case Dns64PrefixLength::kInvalid: return ipv4_address;
diff --git a/net/base/ip_address.h b/net/base/ip_address.h index cbd34af..9bf75f48 100644 --- a/net/base/ip_address.h +++ b/net/base/ip_address.h
@@ -28,12 +28,12 @@ class NET_EXPORT IPAddressBytes { public: IPAddressBytes(); - IPAddressBytes(const uint8_t* data, size_t data_len); + explicit IPAddressBytes(base::span<const uint8_t> data); IPAddressBytes(const IPAddressBytes& other); ~IPAddressBytes(); - // Copies |data_len| elements from |data| into this object. - void Assign(const uint8_t* data, size_t data_len); + // Copies elements from |data| into this object. + void Assign(base::span<const uint8_t> data); // Returns the number of elements in the underlying array. size_t size() const { return size_; } @@ -76,8 +76,8 @@ bytes_[size_++] = val; } - // Appends the range [`first`, `last`) to the end and increments the size. - void Append(const uint8_t* first, const uint8_t* last); + // Appends `data` to the end and increments the size. + void Append(base::span<const uint8_t> data); // Returns a reference to the byte at index |pos|. uint8_t& operator[](size_t pos) { @@ -125,12 +125,7 @@ // Copies the input address to |ip_address_|. The input is expected to be in // network byte order. - explicit IPAddress(base::span<const uint8_t> address) - : IPAddress(address.data(), address.size()) {} - - // Copies the input address to |ip_address_| taking an additional length - // parameter. The input is expected to be in network byte order. - IPAddress(const uint8_t* address, size_t address_len); + explicit IPAddress(base::span<const uint8_t> address); // Initializes |ip_address_| from the 4 bX bytes to form an IPv4 address. // The bytes are expected to be in network byte order.
diff --git a/net/base/ip_address_unittest.cc b/net/base/ip_address_unittest.cc index 9bb5c4d7..cb71eb8 100644 --- a/net/base/ip_address_unittest.cc +++ b/net/base/ip_address_unittest.cc
@@ -37,7 +37,7 @@ TEST(IPAddressBytesTest, ConstructIPv4) { uint8_t data[] = {192, 168, 1, 1}; - IPAddressBytes bytes(data, std::size(data)); + IPAddressBytes bytes(data); ASSERT_EQ(std::size(data), bytes.size()); size_t i = 0; for (uint8_t byte : bytes) @@ -47,7 +47,7 @@ TEST(IPAddressBytesTest, ConstructIPv6) { uint8_t data[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - IPAddressBytes bytes(data, std::size(data)); + IPAddressBytes bytes(data); ASSERT_EQ(std::size(data), bytes.size()); size_t i = 0; for (uint8_t byte : bytes) @@ -58,8 +58,8 @@ TEST(IPAddressBytesTest, Assign) { uint8_t data[] = {192, 168, 1, 1}; IPAddressBytes copy; - copy.Assign(data, std::size(data)); - EXPECT_EQ(IPAddressBytes(data, std::size(data)), copy); + copy.Assign(data); + EXPECT_EQ(IPAddressBytes(data), copy); } TEST(IPAddressTest, ConstructIPv4) {
diff --git a/net/base/ip_endpoint.cc b/net/base/ip_endpoint.cc index d9e41d1..57e0263 100644 --- a/net/base/ip_endpoint.cc +++ b/net/base/ip_endpoint.cc
@@ -13,6 +13,7 @@ #include "base/check.h" #include "base/check_op.h" +#include "base/containers/span.h" #include "base/notreached.h" #include "base/numerics/safe_conversions.h" #include "base/strings/string_number_conversions.h" @@ -155,8 +156,8 @@ const struct sockaddr_in* addr = reinterpret_cast<const struct sockaddr_in*>(sock_addr); *this = IPEndPoint( - IPAddress(reinterpret_cast<const uint8_t*>(&addr->sin_addr), - IPAddress::kIPv4AddressSize), + // `s_addr` is a `uint32_t`, but it is already in network byte order. + IPAddress(base::as_bytes(base::span_from_ref(addr->sin_addr.s_addr))), base::NetToHost16(addr->sin_port)); return true; } @@ -165,10 +166,8 @@ return false; const struct sockaddr_in6* addr = reinterpret_cast<const struct sockaddr_in6*>(sock_addr); - *this = IPEndPoint( - IPAddress(reinterpret_cast<const uint8_t*>(&addr->sin6_addr), - IPAddress::kIPv6AddressSize), - base::NetToHost16(addr->sin6_port)); + *this = IPEndPoint(IPAddress(addr->sin6_addr.s6_addr), + base::NetToHost16(addr->sin6_port)); return true; } #if BUILDFLAG(IS_WIN) @@ -178,8 +177,10 @@ const SOCKADDR_BTH* addr = reinterpret_cast<const SOCKADDR_BTH*>(sock_addr); *this = IPEndPoint(); - address_ = IPAddress(reinterpret_cast<const uint8_t*>(&addr->btAddr), - kBluetoothAddressSize); + // A bluetooth address is 6 bytes, but btAddr is a ULONGLONG, so we take a + // prefix of it. + address_ = IPAddress(base::as_bytes(base::span_from_ref(addr->btAddr)) + .first(kBluetoothAddressSize)); // Intentionally ignoring Bluetooth port. It is a ULONG, but // `IPEndPoint::port_` is a uint16_t. See https://crbug.com/1231273. return true;
diff --git a/net/base/network_interfaces_fuchsia.cc b/net/base/network_interfaces_fuchsia.cc index c70a9cd2..b1f3134 100644 --- a/net/base/network_interfaces_fuchsia.cc +++ b/net/base/network_interfaces_fuchsia.cc
@@ -24,9 +24,9 @@ IPAddress FuchsiaIpAddressToIPAddress(const fuchsia::net::IpAddress& address) { switch (address.Which()) { case fuchsia::net::IpAddress::kIpv4: - return IPAddress(address.ipv4().addr.data(), address.ipv4().addr.size()); + return IPAddress(address.ipv4().addr); case fuchsia::net::IpAddress::kIpv6: - return IPAddress(address.ipv6().addr.data(), address.ipv6().addr.size()); + return IPAddress(address.ipv6().addr); default: return IPAddress(); }
diff --git a/net/dns/record_rdata.cc b/net/dns/record_rdata.cc index 5d98b23..e5256a0a6 100644 --- a/net/dns/record_rdata.cc +++ b/net/dns/record_rdata.cc
@@ -9,6 +9,7 @@ #include <utility> #include "base/big_endian.h" +#include "base/containers/span.h" #include "base/logging.h" #include "base/memory/ptr_util.h" #include "base/rand_util.h" @@ -99,8 +100,7 @@ return nullptr; auto rdata = base::WrapUnique(new ARecordRdata()); - rdata->address_ = - IPAddress(reinterpret_cast<const uint8_t*>(data.data()), data.length()); + rdata->address_ = IPAddress(base::as_byte_span(data)); return rdata; } @@ -126,8 +126,7 @@ return nullptr; auto rdata = base::WrapUnique(new AAAARecordRdata()); - rdata->address_ = - IPAddress(reinterpret_cast<const uint8_t*>(data.data()), data.length()); + rdata->address_ = IPAddress(base::as_byte_span(data)); return rdata; }
diff --git a/net/http/transport_security_state_static.pins b/net/http/transport_security_state_static.pins index 605f1176..47a5357 100644 --- a/net/http/transport_security_state_static.pins +++ b/net/http/transport_security_state_static.pins
@@ -43,9 +43,9 @@ # hash function for preloaded entries again (we have already done so once). # -# Last updated: 2024-03-01 12:56 UTC +# Last updated: 2024-03-02 12:55 UTC PinsListTimestamp -1709297771 +1709384104 TestSPKI sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
diff --git a/net/http/transport_security_state_static_pins.json b/net/http/transport_security_state_static_pins.json index 43155e2..fb087e1 100644 --- a/net/http/transport_security_state_static_pins.json +++ b/net/http/transport_security_state_static_pins.json
@@ -31,7 +31,7 @@ // the 'static_spki_hashes' and 'bad_static_spki_hashes' fields in 'pinsets' // refer to, and the timestamp at which the pins list was last updated. // -// Last updated: 2024-03-01 12:56 UTC +// Last updated: 2024-03-02 12:55 UTC // { "pinsets": [
diff --git a/net/quic/address_utils.h b/net/quic/address_utils.h index ec2de5d..585d93c 100644 --- a/net/quic/address_utils.h +++ b/net/quic/address_utils.h
@@ -7,6 +7,7 @@ #include <string.h> +#include "base/containers/span.h" #include "net/base/ip_address.h" #include "net/base/ip_endpoint.h" #include "net/third_party/quiche/src/quiche/common/quiche_ip_address.h" @@ -36,13 +37,12 @@ switch (address.address_family()) { case quiche::IpAddressFamily::IP_V4: { in_addr raw_address = address.GetIPv4(); - return IPAddress(reinterpret_cast<const uint8_t*>(&raw_address), - sizeof(raw_address)); + // `s_addr` is a `uint32_t`, but it is already in network byte order. + return IPAddress(base::byte_span_from_ref(raw_address.s_addr)); } case quiche::IpAddressFamily::IP_V6: { in6_addr raw_address = address.GetIPv6(); - return IPAddress(reinterpret_cast<const uint8_t*>(&raw_address), - sizeof(raw_address)); + return IPAddress(raw_address.s6_addr); } default: DCHECK_EQ(address.address_family(), quiche::IpAddressFamily::IP_UNSPEC);
diff --git a/ppapi/shared_impl/private/net_address_private_impl.cc b/ppapi/shared_impl/private/net_address_private_impl.cc index b212726..925a6cd4 100644 --- a/ppapi/shared_impl/private/net_address_private_impl.cc +++ b/ppapi/shared_impl/private/net_address_private_impl.cc
@@ -10,6 +10,9 @@ #include <string> #include "base/check.h" +#include "base/compiler_specific.h" +#include "base/containers/span.h" +#include "base/ranges/algorithm.h" #include "base/strings/stringprintf.h" #include "build/build_config.h" #include "components/nacl/common/buildflags.h" @@ -90,14 +93,15 @@ sizeof(NetAddress), "PP_NetAddress_Private data too small"); -size_t GetAddressSize(const NetAddress* net_addr) { - return net_addr->is_ipv6 ? kIPv6AddressSize : kIPv4AddressSize; +base::span<const uint8_t> GetAddressBytes(const NetAddress* net_addr) { + size_t address_size = net_addr->is_ipv6 ? kIPv6AddressSize : kIPv4AddressSize; + return base::span(net_addr->address).first(address_size); } // Convert to embedded struct if it has been initialized. NetAddress* ToNetAddress(PP_NetAddress_Private* addr) { if (!addr || addr->size != sizeof(NetAddress)) - return NULL; + return nullptr; return reinterpret_cast<NetAddress*>(addr->data); } @@ -140,11 +144,16 @@ const NetAddress* net_addr = ToNetAddress(addr); if (!IsValid(net_addr)) return PP_FALSE; - size_t net_addr_size = GetAddressSize(net_addr); + // SAFETY: The caller of this PPAPI interface is required to pass a valid, + // writable span in `address` and `address_size`. + auto dest = + UNSAFE_BUFFERS(base::span(static_cast<uint8_t*>(address), address_size)); + base::span<const uint8_t> src = GetAddressBytes(net_addr); // address_size must be big enough. - if (net_addr_size > address_size) + if (src.size() > dest.size()) { return PP_FALSE; - memcpy(address, net_addr->address, net_addr_size); + } + dest.first(src.size()).copy_from(src); return PP_TRUE; } @@ -164,13 +173,10 @@ if ((net_addr1->is_ipv6 != net_addr2->is_ipv6) || (net_addr1->flow_info != net_addr2->flow_info) || - (net_addr1->scope_id != net_addr2->scope_id)) + (net_addr1->scope_id != net_addr2->scope_id) || + !base::ranges::equal(GetAddressBytes(net_addr1), + GetAddressBytes(net_addr2))) { return PP_FALSE; - - size_t net_addr_size = GetAddressSize(net_addr1); - for (size_t i = 0; i < net_addr_size; i++) { - if (net_addr1->address[i] != net_addr2->address[i]) - return PP_FALSE; } return PP_TRUE; @@ -479,8 +485,7 @@ return false; *port = net_addr->port; - size_t address_size = GetAddressSize(net_addr); - address->Assign(net_addr->address, address_size); + address->Assign(GetAddressBytes(net_addr)); return true; } #endif // !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_MINIMAL_TOOLCHAIN)
diff --git a/services/network/public/cpp/ip_address_mojom_traits.cc b/services/network/public/cpp/ip_address_mojom_traits.cc index 58284f3..c001bca 100644 --- a/services/network/public/cpp/ip_address_mojom_traits.cc +++ b/services/network/public/cpp/ip_address_mojom_traits.cc
@@ -19,7 +19,7 @@ return false; } - *out = net::IPAddress(bytes.data(), bytes.size()); + *out = net::IPAddress(bytes); return true; }
diff --git a/services/network/public/cpp/net_ipc_param_traits.cc b/services/network/public/cpp/net_ipc_param_traits.cc index 27d4172e..78306ed 100644 --- a/services/network/public/cpp/net_ipc_param_traits.cc +++ b/services/network/public/cpp/net_ipc_param_traits.cc
@@ -123,7 +123,7 @@ if (bytes.size() > 16) { return false; } - *p = net::IPAddress(bytes.data(), bytes.size()); + *p = net::IPAddress(bytes); return true; }
diff --git a/services/network/udp_socket_unittest.cc b/services/network/udp_socket_unittest.cc index fb1664bb..d3e6542 100644 --- a/services/network/udp_socket_unittest.cc +++ b/services/network/udp_socket_unittest.cc
@@ -631,7 +631,7 @@ std::vector<uint8_t> test_msg{1}; std::vector<uint8_t> invalid_ip_addr{127, 0, 0, 0, 1}; - net::IPAddress ip_address(invalid_ip_addr.data(), invalid_ip_addr.size()); + net::IPAddress ip_address(invalid_ip_addr); EXPECT_FALSE(ip_address.IsValid()); net::IPEndPoint invalid_addr(ip_address, 53); server_socket->SendTo(
diff --git a/services/screen_ai/public/test/fake_screen_ai_annotator.cc b/services/screen_ai/public/test/fake_screen_ai_annotator.cc index 7d689b3..9db56321 100644 --- a/services/screen_ai/public/test/fake_screen_ai_annotator.cc +++ b/services/screen_ai/public/test/fake_screen_ai_annotator.cc
@@ -9,6 +9,7 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/accessibility/ax_tree_update.h" +#include "ui/gfx/geometry/rect_f.h" namespace screen_ai::test { @@ -31,6 +32,7 @@ node.id = next_node_id_; node.role = ax::mojom::Role::kStaticText; node.SetNameChecked("Testing"); + node.relative_bounds.bounds = gfx::RectF(1.0f, 2.0f, 1.0f, 2.0f); update.nodes = {node}; --next_node_id_; }
diff --git a/skia/config/SkUserConfig.h b/skia/config/SkUserConfig.h index cc88e68..8598a51 100644 --- a/skia/config/SkUserConfig.h +++ b/skia/config/SkUserConfig.h
@@ -229,6 +229,8 @@ #define SK_USE_LEGACY_MIPMAP_BUILDER +#define SK_LEGACY_EDGE_AA_ROUNDING + #define SK_SUPPORT_LEGACY_CONIC_CHOP #define SK_ENABLE_SKSL_IN_RASTER_PIPELINE
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index 65c7eaf..2ac5105 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -5377,9 +5377,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6331.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6333.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 124.0.6331.0", + "description": "Run with ash-chrome version 124.0.6333.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5389,8 +5389,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6331.0", - "revision": "version:124.0.6331.0" + "location": "lacros_version_skew_tests_v124.0.6333.0", + "revision": "version:124.0.6333.0" } ], "dimensions": { @@ -5533,9 +5533,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6331.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6333.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 124.0.6331.0", + "description": "Run with ash-chrome version 124.0.6333.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5545,8 +5545,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6331.0", - "revision": "version:124.0.6331.0" + "location": "lacros_version_skew_tests_v124.0.6333.0", + "revision": "version:124.0.6333.0" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.coverage.json b/testing/buildbot/chromium.coverage.json index d0039ba..4d589910 100644 --- a/testing/buildbot/chromium.coverage.json +++ b/testing/buildbot/chromium.coverage.json
@@ -20313,9 +20313,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6331.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6333.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 124.0.6331.0", + "description": "Run with ash-chrome version 124.0.6333.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -20325,8 +20325,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6331.0", - "revision": "version:124.0.6331.0" + "location": "lacros_version_skew_tests_v124.0.6333.0", + "revision": "version:124.0.6333.0" } ], "dimensions": { @@ -20463,9 +20463,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6331.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6333.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 124.0.6331.0", + "description": "Run with ash-chrome version 124.0.6333.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -20475,8 +20475,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6331.0", - "revision": "version:124.0.6331.0" + "location": "lacros_version_skew_tests_v124.0.6333.0", + "revision": "version:124.0.6333.0" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index a8d0d16..8395f8f 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -39981,9 +39981,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6331.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6333.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 124.0.6331.0", + "description": "Run with ash-chrome version 124.0.6333.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -39992,8 +39992,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6331.0", - "revision": "version:124.0.6331.0" + "location": "lacros_version_skew_tests_v124.0.6333.0", + "revision": "version:124.0.6333.0" } ], "dimensions": { @@ -40131,9 +40131,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6331.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6333.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 124.0.6331.0", + "description": "Run with ash-chrome version 124.0.6333.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -40142,8 +40142,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6331.0", - "revision": "version:124.0.6331.0" + "location": "lacros_version_skew_tests_v124.0.6333.0", + "revision": "version:124.0.6333.0" } ], "dimensions": { @@ -41480,9 +41480,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6331.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6333.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 124.0.6331.0", + "description": "Run with ash-chrome version 124.0.6333.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -41492,8 +41492,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6331.0", - "revision": "version:124.0.6331.0" + "location": "lacros_version_skew_tests_v124.0.6333.0", + "revision": "version:124.0.6333.0" } ], "dimensions": { @@ -41636,9 +41636,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6331.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6333.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 124.0.6331.0", + "description": "Run with ash-chrome version 124.0.6333.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -41648,8 +41648,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6331.0", - "revision": "version:124.0.6331.0" + "location": "lacros_version_skew_tests_v124.0.6333.0", + "revision": "version:124.0.6333.0" } ], "dimensions": { @@ -42961,9 +42961,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6331.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6333.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 124.0.6331.0", + "description": "Run with ash-chrome version 124.0.6333.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -42972,8 +42972,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6331.0", - "revision": "version:124.0.6331.0" + "location": "lacros_version_skew_tests_v124.0.6333.0", + "revision": "version:124.0.6333.0" } ], "dimensions": { @@ -43111,9 +43111,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6331.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6333.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 124.0.6331.0", + "description": "Run with ash-chrome version 124.0.6333.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -43122,8 +43122,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6331.0", - "revision": "version:124.0.6331.0" + "location": "lacros_version_skew_tests_v124.0.6333.0", + "revision": "version:124.0.6333.0" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.memory.json b/testing/buildbot/chromium.memory.json index 058d856..d5ffb54 100644 --- a/testing/buildbot/chromium.memory.json +++ b/testing/buildbot/chromium.memory.json
@@ -16343,12 +16343,12 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6331.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6333.0/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 124.0.6331.0", + "description": "Run with ash-chrome version 124.0.6333.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -16358,8 +16358,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6331.0", - "revision": "version:124.0.6331.0" + "location": "lacros_version_skew_tests_v124.0.6333.0", + "revision": "version:124.0.6333.0" } ], "dimensions": { @@ -16519,12 +16519,12 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6331.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6333.0/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 124.0.6331.0", + "description": "Run with ash-chrome version 124.0.6333.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -16534,8 +16534,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v124.0.6331.0", - "revision": "version:124.0.6331.0" + "location": "lacros_version_skew_tests_v124.0.6333.0", + "revision": "version:124.0.6333.0" } ], "dimensions": {
diff --git a/testing/buildbot/variants.pyl b/testing/buildbot/variants.pyl index 3e3be86..9f466c5 100644 --- a/testing/buildbot/variants.pyl +++ b/testing/buildbot/variants.pyl
@@ -307,16 +307,16 @@ }, 'LACROS_VERSION_SKEW_CANARY': { 'identifier': 'Lacros version skew testing ash canary', - 'description': 'Run with ash-chrome version 124.0.6331.0', + 'description': 'Run with ash-chrome version 124.0.6333.0', 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6331.0/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v124.0.6333.0/test_ash_chrome', ], 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v124.0.6331.0', - 'revision': 'version:124.0.6331.0', + 'location': 'lacros_version_skew_tests_v124.0.6333.0', + 'revision': 'version:124.0.6333.0', }, ], },
diff --git a/third_party/angle b/third_party/angle index 21381f5..0ed0de4 160000 --- a/third_party/angle +++ b/third_party/angle
@@ -1 +1 @@ -Subproject commit 21381f5e1c4dffe6ce43121e8cd55803647896ca +Subproject commit 0ed0de4f0b7f5a81fbe35b28e6a68a739f365556
diff --git a/third_party/blink/public/web/web_form_control_element.h b/third_party/blink/public/web/web_form_control_element.h index 05f339f2..11b7a67 100644 --- a/third_party/blink/public/web/web_form_control_element.h +++ b/third_party/blink/public/web/web_form_control_element.h
@@ -67,8 +67,6 @@ bool IsAutofilled() const; bool IsPreviewed() const; void SetAutofillState(enum WebAutofillState); - void SetPreventHighlightingOfAutofilledFields(bool prevent_highlighting); - bool PreventHighlightingOfAutofilledFields() const; bool UserHasEditedTheField() const; void SetUserHasEditedTheField(bool value);
diff --git a/third_party/blink/renderer/build/scripts/core/css/properties/templates/css_properties.h.tmpl b/third_party/blink/renderer/build/scripts/core/css/properties/templates/css_properties.h.tmpl index 7d047db..41e29aa5 100644 --- a/third_party/blink/renderer/build/scripts/core/css/properties/templates/css_properties.h.tmpl +++ b/third_party/blink/renderer/build/scripts/core/css/properties/templates/css_properties.h.tmpl
@@ -54,6 +54,7 @@ (property.valid_for_formatted_text_run and 'kValidForFormattedTextRun' or ''), (property.valid_for_keyframe and 'kValidForKeyframe' or ''), (property.valid_for_position_fallback and 'kValidForPositionFallback' or ''), + (property.valid_for_permission_element and 'kValidForPermissionElement' or ''), (is_surrogate and 'kSurrogate' or ''), (property.font and 'kAffectsFont' or ''), (property.is_background and 'kBackground' or ''),
diff --git a/third_party/blink/renderer/core/css/css_properties.json5 b/third_party/blink/renderer/core/css/css_properties.json5 index cba24adf..84c97522 100644 --- a/third_party/blink/renderer/core/css/css_properties.json5 +++ b/third_party/blink/renderer/core/css/css_properties.json5
@@ -736,6 +736,13 @@ valid_type: "bool", }, + // Whether the property can be applied to <permission> elements. + // See https://github.com/WICG/PEPC/blob/main/explainer.md#locking-the-pepc-style + valid_for_permission_element: { + default: false, + valid_type: "bool", + }, + // - valid_for_position_fallback: true // // Whether the property can be used in a @try rule of @position-fallback @@ -1135,6 +1142,7 @@ valid_for_formatted_text_run: true, is_highlight_colors: true, supports_incremental_style: true, + valid_for_permission_element: true, }, { name: "direction", @@ -1191,6 +1199,7 @@ valid_for_formatted_text_run: true, // See comment on font. supports_incremental_style: false, + valid_for_permission_element: true, }, { name: "font-optical-sizing", @@ -1208,6 +1217,7 @@ valid_for_marker: true, // See comment on font. supports_incremental_style: false, + valid_for_permission_element: true, }, { name: "font-palette", @@ -1246,6 +1256,7 @@ valid_for_formatted_text_run: true, // See comment on font. supports_incremental_style: false, + valid_for_permission_element: true, }, { name: "font-size-adjust", @@ -1288,6 +1299,7 @@ valid_for_formatted_text_run: true, // See comment on font. supports_incremental_style: false, + valid_for_permission_element: true, }, { name: "font-style", @@ -1309,6 +1321,7 @@ valid_for_formatted_text_run: true, // See comment on font. supports_incremental_style: false, + valid_for_permission_element: true, }, { name: "font-variant-ligatures", @@ -1439,6 +1452,7 @@ valid_for_formatted_text_run: true, // See comment on font. supports_incremental_style: false, + valid_for_permission_element: true, }, { name: "font-synthesis-weight", @@ -1455,6 +1469,7 @@ valid_for_marker: true, // See comment on font. supports_incremental_style: false, + valid_for_permission_element: true, }, { name: "font-synthesis-style", @@ -1471,6 +1486,7 @@ valid_for_marker: true, // See comment on font. supports_incremental_style: false, + valid_for_permission_element: true, }, { name: "font-synthesis-small-caps", @@ -1487,6 +1503,7 @@ valid_for_marker: true, // See comment on font. supports_incremental_style: false, + valid_for_permission_element: true, }, { name: "font-feature-settings", @@ -1507,6 +1524,7 @@ valid_for_formatted_text_run: true, // See comment on font. supports_incremental_style: false, + valid_for_permission_element: true, }, { name: "font-variation-settings", @@ -1555,6 +1573,7 @@ priority: 1, valid_for_first_letter: true, valid_for_first_line: true, + valid_for_permission_element: true, }, { name: "forced-color-adjust", @@ -1571,6 +1590,7 @@ default_value: "auto", valid_for_highlight_legacy: true, computable: false, + valid_for_permission_element: true, }, { name: "field-sizing", @@ -1661,6 +1681,7 @@ keywords: ["auto", "optimizespeed", "optimizelegibility", "geometricprecision"], typedom_types: ["Keyword"], priority: 1, + valid_for_permission_element: true, }, { name: "zoom", @@ -1674,6 +1695,7 @@ // Setting zoom affects the _EffectiveZoom_, which in turns affects every px value // stored on ComputedStyle; see CSSToLengthConversionData::ZoomedComputedPixels. supports_incremental_style: false, + valid_for_permission_element: true, }, { name: "accent-color", @@ -1734,6 +1756,7 @@ type_name: "StyleSelfAlignmentData", converter: "ConvertSelfOrDefaultAlignmentData", valid_for_position_fallback: true, + valid_for_permission_element: true, }, { name: "anchor-default", @@ -1748,6 +1771,7 @@ keywords: ["none"], typedom_types: ["Keyword"], runtime_flag: "CSSAnchorPositioning", + valid_for_permission_element: true, }, { name: "anchor-name", @@ -1762,6 +1786,7 @@ keywords: ["none"], typedom_types: ["Keyword"], runtime_flag: "CSSAnchorPositioning", + valid_for_permission_element: true, }, { name: "aspect-ratio", @@ -1775,6 +1800,7 @@ converter: "ConvertAspectRatio", include_paths: ["third_party/blink/renderer/core/style/style_aspect_ratio.h"], computable: false, + valid_for_permission_element: true, }, { name: "backdrop-filter", @@ -1878,6 +1904,7 @@ is_background: true, is_highlight_colors: true, supports_incremental_style: true, + valid_for_permission_element: true, }, { name: "background-image", @@ -2014,6 +2041,7 @@ resolver: "bottom", }, supports_incremental_style: true, + valid_for_permission_element: true, }, { name: "border-bottom-left-radius", @@ -2033,6 +2061,7 @@ name: "border-radius", resolver: "bottom-left", }, + valid_for_permission_element: true, }, { name: "border-bottom-right-radius", @@ -2052,6 +2081,7 @@ name: "border-radius", resolver: "bottom-right", }, + valid_for_permission_element: true, }, { name: "border-bottom-style", @@ -2071,6 +2101,7 @@ name: "border-style", resolver: "bottom", }, + valid_for_permission_element: true, }, { name: "border-bottom-width", @@ -2093,6 +2124,7 @@ }, // Overlaps with -webkit-border-image. overlapping: true, + valid_for_permission_element: true, }, { name: "border-collapse", @@ -2194,6 +2226,7 @@ resolver: "left", }, supports_incremental_style: true, + valid_for_permission_element: true, }, { name: "border-left-style", @@ -2213,6 +2246,7 @@ name: "border-style", resolver: "left", }, + valid_for_permission_element: true, }, { name: "border-left-width", @@ -2235,6 +2269,7 @@ }, // Overlaps with -webkit-border-image. overlapping: true, + valid_for_permission_element: true, }, { name: "border-right-color", @@ -2257,6 +2292,7 @@ resolver: "right", }, supports_incremental_style: true, + valid_for_permission_element: true, }, { name: "border-right-style", @@ -2276,6 +2312,7 @@ name: "border-style", resolver: "right", }, + valid_for_permission_element: true, }, { name: "border-right-width", @@ -2298,6 +2335,7 @@ }, // Overlaps with -webkit-border-image. overlapping: true, + valid_for_permission_element: true, }, { name: "border-top-color", @@ -2320,6 +2358,7 @@ resolver: "top", }, supports_incremental_style: true, + valid_for_permission_element: true, }, { name: "border-top-left-radius", @@ -2339,6 +2378,7 @@ name: "border-radius", resolver: "top-left", }, + valid_for_permission_element: true, }, { name: "border-top-right-radius", @@ -2358,6 +2398,7 @@ name: "border-radius", resolver: "top-right", }, + valid_for_permission_element: true, }, { name: "border-top-style", @@ -2378,6 +2419,7 @@ resolver: "top", }, supports_incremental_style: true, + valid_for_permission_element: true, }, { name: "border-top-width", @@ -2400,6 +2442,7 @@ }, // Overlaps with -webkit-border-image. overlapping: true, + valid_for_permission_element: true, }, { name: "bottom", @@ -2419,6 +2462,7 @@ }, supports_incremental_style: true, valid_for_position_fallback: true, + valid_for_permission_element: true, }, { name: "box-shadow", @@ -2445,6 +2489,7 @@ keywords: ["content-box", "border-box"], typedom_types: ["Keyword"], default_value: "content-box", + valid_for_permission_element: true, }, { name: "break-after", @@ -2526,6 +2571,7 @@ keywords: ["none", "left", "right", "both", "inline-start", "inline-end"], typedom_types: ["Keyword"], default_value: "none", + valid_for_permission_element: true, }, { name: "clip", @@ -2619,6 +2665,7 @@ // Affects the computed value of 'color', hence needs to happen before // high-priority properties. priority: 2, + valid_for_permission_element: true, }, { name: "column-fill", @@ -2644,6 +2691,7 @@ keywords: ["none", "strict", "content", "size", "layout", "style", "paint", "inline-size", "block-size"], typedom_types: ["Keyword"], computable: false, + valid_for_permission_element: true, }, { name: "contain-intrinsic-width", @@ -2656,6 +2704,7 @@ default_value: "StyleIntrinsicLength()", type_name: "StyleIntrinsicLength", converter: "ConvertIntrinsicDimension", + valid_for_permission_element: true, }, { name: "contain-intrinsic-height", @@ -2668,6 +2717,7 @@ default_value: "StyleIntrinsicLength()", type_name: "StyleIntrinsicLength", converter: "ConvertIntrinsicDimension", + valid_for_permission_element: true, }, { name: "container-name", @@ -2680,6 +2730,7 @@ converter: "ConvertContainerName", keywords: ["none"], typedom_types: ["Keyword"], + valid_for_permission_element: true, }, { name: "container-type", @@ -2692,6 +2743,7 @@ type_name: "unsigned", converter: "ConvertFlags<EContainerType, CSSValueID::kNormal>", typedom_types: ["Keyword"], + valid_for_permission_element: true, }, { name: "content", @@ -2718,6 +2770,7 @@ keywords: ["none"], typedom_types: ["Keyword"], computable: false, + valid_for_permission_element: true, }, { name: "counter-reset", @@ -2729,6 +2782,7 @@ keywords: ["none"], typedom_types: ["Keyword"], computable: false, + valid_for_permission_element: true, }, { name: "counter-set", @@ -2740,6 +2794,7 @@ keywords: ["none"], typedom_types: ["Keyword"], computable: false, + valid_for_permission_element: true, }, { name: "cursor", @@ -2814,6 +2869,7 @@ // (e.g. OriginalDisplay is based on display, and setting float can cause blockification), // so we turn off incremental style for all them all. supports_incremental_style: false, + valid_for_permission_element: true, }, { name: "dominant-baseline", @@ -2907,6 +2963,7 @@ converter: "ConvertLengthSizing", typedom_types: ["Keyword", "Length", "Percentage"], keywords: ["auto", "fit-content", "min-content", "max-content", "content"], + valid_for_permission_element: true, }, { name: "flex-direction", @@ -2916,6 +2973,7 @@ typedom_types: ["Keyword"], keywords: ["row", "row-reverse", "column", "column-reverse"], default_value: "row", + valid_for_permission_element: true, }, { name: "flex-grow", @@ -2926,6 +2984,7 @@ default_value: "0.0f", type_name: "float", typedom_types: ["Number"], + valid_for_permission_element: true, }, { name: "flex-shrink", @@ -2936,6 +2995,7 @@ default_value: "1.0f", type_name: "float", typedom_types: ["Number"], + valid_for_permission_element: true, }, { name: "flex-wrap", @@ -2945,6 +3005,7 @@ typedom_types: ["Keyword"], keywords: ["nowrap", "wrap", "wrap-reverse"], default_value: "nowrap", + valid_for_permission_element: true, }, { name: "float", @@ -2959,6 +3020,7 @@ valid_for_first_letter: true, // See comment on display. supports_incremental_style: false, + valid_for_permission_element: true, }, { name: "flood-color", @@ -3144,6 +3206,7 @@ supports_incremental_style: true, valid_for_formatted_text: true, valid_for_position_fallback: true, + valid_for_permission_element: true, }, { name: "hyphenate-limit-chars", @@ -3258,6 +3321,7 @@ keywords: ["auto", "isolate"], typedom_types: ["Keyword"], default_value: "auto", + valid_for_permission_element: true, }, { name: "justify-content", @@ -3291,6 +3355,7 @@ type_name: "StyleSelfAlignmentData", converter: "ConvertSelfOrDefaultAlignmentData", valid_for_position_fallback: true, + valid_for_permission_element: true, }, { name: "left", @@ -3310,6 +3375,7 @@ }, supports_incremental_style: true, valid_for_position_fallback: true, + valid_for_permission_element: true, }, { name: "letter-spacing", @@ -3322,6 +3388,7 @@ valid_for_first_letter: true, valid_for_first_line: true, valid_for_marker: true, + valid_for_permission_element: true, }, { name: "lighting-color", @@ -3420,6 +3487,7 @@ resolver: "bottom", }, supports_incremental_style: true, + valid_for_permission_element: true, }, { name: "margin-left", @@ -3440,6 +3508,7 @@ resolver: "left", }, supports_incremental_style: true, + valid_for_permission_element: true, }, { name: "margin-right", @@ -3460,6 +3529,7 @@ resolver: "right", }, supports_incremental_style: true, + valid_for_permission_element: true, }, { name: "margin-top", @@ -3480,6 +3550,7 @@ resolver: "top", }, supports_incremental_style: true, + valid_for_permission_element: true, }, { name: "marker-end", @@ -3585,6 +3656,7 @@ }, supports_incremental_style: true, valid_for_position_fallback: true, + valid_for_permission_element: true, }, { name: "max-width", @@ -3603,6 +3675,7 @@ }, supports_incremental_style: true, valid_for_position_fallback: true, + valid_for_permission_element: true, }, { name: "min-height", @@ -3620,6 +3693,7 @@ }, supports_incremental_style: true, valid_for_position_fallback: true, + valid_for_permission_element: true, }, { name: "min-width", @@ -3637,6 +3711,7 @@ }, supports_incremental_style: true, valid_for_position_fallback: true, + valid_for_permission_element: true, }, { name: "mix-blend-mode", @@ -3781,6 +3856,7 @@ default_value: "0", type_name: "int", typedom_types: ["Number"], + valid_for_permission_element: true, }, { // This property is used for testing with origin trial intergration only. @@ -3805,6 +3881,7 @@ default_value: "2", type_name: "short", typedom_types: ["Number"], + valid_for_permission_element: true, }, { name: "outline-color", @@ -3821,6 +3898,7 @@ converter: "ConvertStyleColor", style_builder_template: "color", valid_for_cue: true, + valid_for_permission_element: true, }, { name: "outline-offset", @@ -3834,6 +3912,7 @@ converter: "ConvertLayoutUnit", typedom_types: ["Length"], valid_for_cue: true, + valid_for_permission_element: true, }, { name: "outline-style", @@ -3849,6 +3928,7 @@ type_name: "EBorderStyle", style_builder_custom_functions: ["initial", "inherit", "value"], valid_for_cue: true, + valid_for_permission_element: true, }, { name: "outline-width", @@ -3864,6 +3944,7 @@ keywords: ["thin", "medium", "thick"], typedom_types: ["Keyword", "Length"], valid_for_cue: true, + valid_for_permission_element: true, }, { name: "overflow-anchor", @@ -3875,6 +3956,7 @@ ], typedom_types: ["Keyword"], default_value: "auto", + valid_for_permission_element: true, }, { name: "overflow-wrap", @@ -3983,6 +4065,7 @@ name: "overscroll-behavior", resolver: "inline", }, + valid_for_permission_element: true, }, { name: "overscroll-behavior-block", @@ -3990,6 +4073,7 @@ name: "overscroll-behavior", resolver: "block", }, + valid_for_permission_element: true, }, { name: "overscroll-behavior-x", @@ -4005,6 +4089,7 @@ resolver: "horizontal", }, computable: false, + valid_for_permission_element: true, }, { name: "overscroll-behavior-y", @@ -4020,6 +4105,7 @@ resolver: "vertical", }, computable: false, + valid_for_permission_element: true, }, { name: "padding-bottom", @@ -4104,6 +4190,7 @@ keywords: ["auto"], typedom_types: ["Keyword"], computable: false, + valid_for_permission_element: true, }, { name: "page-orientation", @@ -4187,6 +4274,7 @@ // from @try blocks can be applied conditionally based on whether or not // we're out-of-flow positioned. priority: 1, + valid_for_permission_element: true, }, { name: "position-fallback", @@ -4263,6 +4351,7 @@ default_value: "visible", typedom_types: ["Keyword"], computable: false, + valid_for_permission_element: true, }, { name: "reading-order-items", @@ -4303,6 +4392,7 @@ }, supports_incremental_style: true, valid_for_position_fallback: true, + valid_for_permission_element: true, }, { name: "r", @@ -4400,6 +4490,7 @@ resolver: "block-end", }, typedom_types: ["Keyword", "Length"], + valid_for_permission_element: true, }, { name: "scroll-margin-block-start", @@ -4409,6 +4500,7 @@ resolver: "block-start", }, typedom_types: ["Keyword", "Length"], + valid_for_permission_element: true, }, { name: "scroll-margin-bottom", @@ -4424,6 +4516,7 @@ resolver: "bottom", }, computable: false, + valid_for_permission_element: true, }, { name: "scroll-margin-inline-end", @@ -4433,6 +4526,7 @@ resolver: "inline-end", }, typedom_types: ["Keyword", "Length"], + valid_for_permission_element: true, }, { name: "scroll-margin-inline-start", @@ -4442,6 +4536,7 @@ resolver: "inline-start", }, typedom_types: ["Keyword", "Length"], + valid_for_permission_element: true, }, { name: "scroll-margin-left", @@ -4457,6 +4552,7 @@ resolver: "left", }, computable: false, + valid_for_permission_element: true, }, { name: "scroll-margin-right", @@ -4472,6 +4568,7 @@ resolver: "right", }, computable: false, + valid_for_permission_element: true, }, { name: "scroll-margin-top", @@ -4487,6 +4584,7 @@ resolver: "top", }, computable: false, + valid_for_permission_element: true, }, { name: "scroll-padding-block-end", @@ -4500,6 +4598,7 @@ name: "scroll-padding", resolver: "block-end", }, + valid_for_permission_element: true, }, { name: "scroll-padding-block-start", @@ -4513,6 +4612,7 @@ name: "scroll-padding", resolver: "block-start", }, + valid_for_permission_element: true, }, { name: "scroll-padding-bottom", @@ -4528,6 +4628,7 @@ resolver: "bottom", }, computable: false, + valid_for_permission_element: true, }, { name: "scroll-padding-inline-end", @@ -4541,6 +4642,7 @@ name: "scroll-padding", resolver: "inline-end", }, + valid_for_permission_element: true, }, { name: "scroll-padding-inline-start", @@ -4554,6 +4656,7 @@ name: "scroll-padding", resolver: "inline-start", }, + valid_for_permission_element: true, }, { name: "scroll-padding-left", @@ -4569,6 +4672,7 @@ resolver: "left", }, computable: false, + valid_for_permission_element: true, }, { name: "scroll-padding-right", @@ -4584,6 +4688,7 @@ resolver: "right", }, computable: false, + valid_for_permission_element: true, }, { name: "scroll-padding-top", @@ -4599,6 +4704,7 @@ resolver: "top", }, computable: false, + valid_for_permission_element: true, }, { name: "scroll-snap-align", @@ -5031,6 +5137,7 @@ getter: "GetTextAlign", style_builder_custom_functions: ["value"], valid_for_formatted_text: true, + valid_for_permission_element: true, }, { name: "text-align-last", @@ -5041,6 +5148,7 @@ keywords: ["auto", "start", "end", "left", "right", "center", "justify"], default_value: "auto", typedom_types: ["Keyword"], + valid_for_permission_element: true, }, { name: "text-anchor", @@ -5270,6 +5378,7 @@ default_value: "TextSpacingTrim::kInitial", typedom_types: ["Keyword"], runtime_flag: "CSSTextSpacingTrim", + valid_for_permission_element: true, }, { name: "text-transform", @@ -5353,6 +5462,7 @@ }, supports_incremental_style: true, valid_for_position_fallback: true, + valid_for_permission_element: true, }, { name: "overlay", @@ -5505,6 +5615,7 @@ keywords: ["baseline", "sub", "super", "text-top", "text-bottom", "middle"], valid_for_first_letter: true, valid_for_first_line: true, + valid_for_permission_element: true, }, { name: "view-timeline-axis", @@ -5577,6 +5688,7 @@ valid_for_first_letter: true, valid_for_first_line: true, valid_for_cue: true, + valid_for_permission_element: true, }, { name: "x", @@ -5588,6 +5700,7 @@ typedom_types: ["Length", "Percentage"], converter: "ConvertLength", supports_incremental_style: true, + valid_for_permission_element: true, }, { name: "y", @@ -5599,6 +5712,7 @@ typedom_types: ["Length", "Percentage"], converter: "ConvertLength", supports_incremental_style: true, + valid_for_permission_element: true, }, { name: "appearance", @@ -5674,6 +5788,7 @@ keywords: ["stretch", "start", "center", "end", "baseline"], default_value: "stretch", type_name: "EBoxAlignment", + valid_for_permission_element: true, }, { name: "-webkit-box-decoration-break", @@ -5708,6 +5823,7 @@ default_value: "1", type_name: "unsigned", computed_style_custom_functions: ["setter"], + valid_for_permission_element: true, }, { name: "-webkit-box-orient", @@ -6133,6 +6249,7 @@ field_template: "keyword", keywords: ["economy", "exact"], default_value: "economy", + valid_for_permission_element: true, }, { name: "-webkit-rtl-ordering", @@ -6157,6 +6274,7 @@ type_name: "RubyPosition", converter: "ConvertRubyPosition", computable: false, + valid_for_permission_element: true, }, { name: "ruby-position", @@ -6165,6 +6283,7 @@ type_name: "RubyPosition", converter: "ConvertRubyPosition", surrogate_for: "-webkit-ruby-position", + valid_for_permission_element: true, }, { name: "-webkit-tap-highlight-color", @@ -6314,6 +6433,7 @@ field_template: "keyword", keywords: ["auto", "none", "element"], default_value: "auto", + valid_for_permission_element: true, }, { name: "-webkit-user-modify", @@ -6336,6 +6456,7 @@ keywords: ["auto", "none", "text", "all", "contain"], typedom_types: ["Keyword"], default_value: "auto", + valid_for_permission_element: true, }, { name: "white-space", @@ -6404,6 +6525,7 @@ valid_for_formatted_text: true, valid_for_position_fallback: true, affected_by_zoom: true, + valid_for_permission_element: true, }, { name: "will-change", @@ -6411,6 +6533,7 @@ style_builder_custom_functions: ["initial", "inherit", "value"], keywords: ["auto"], typedom_types: ["Keyword"], + valid_for_permission_element: true, }, { name: "word-break", @@ -6436,6 +6559,7 @@ valid_for_first_letter: true, valid_for_first_line: true, valid_for_marker: true, + valid_for_permission_element: true, }, { name: "z-index", @@ -6450,6 +6574,7 @@ converter: "ConvertInteger", keywords: ["auto"], typedom_types: ["Keyword", "Number"], + valid_for_permission_element: true, }, // CSS logical props @@ -6464,6 +6589,7 @@ keywords: ["auto"], typedom_types: ["Keyword", "Length", "Percentage"], valid_for_position_fallback: true, + valid_for_permission_element: true, }, { name: "block-size", @@ -6476,6 +6602,7 @@ keywords: ["auto"], typedom_types: ["Keyword", "Length", "Percentage"], valid_for_position_fallback: true, + valid_for_permission_element: true, }, { name: "min-inline-size", @@ -6496,6 +6623,7 @@ }, typedom_types: ["Length", "Percentage"], valid_for_position_fallback: true, + valid_for_permission_element: true, }, { name: "max-inline-size", @@ -6507,6 +6635,7 @@ keywords: ["none"], typedom_types: ["Keyword", "Length", "Percentage"], valid_for_position_fallback: true, + valid_for_permission_element: true, }, { name: "max-block-size", @@ -6518,6 +6647,7 @@ keywords: ["none"], typedom_types: ["Keyword", "Length", "Percentage"], valid_for_position_fallback: true, + valid_for_permission_element: true, }, { name: "margin-inline-start", @@ -6531,6 +6661,7 @@ keywords: ["auto"], valid_for_first_letter: true, valid_for_position_fallback: true, + valid_for_permission_element: true, }, { name: "margin-inline-end", @@ -6544,6 +6675,7 @@ keywords: ["auto"], valid_for_first_letter: true, valid_for_position_fallback: true, + valid_for_permission_element: true, }, { name: "margin-block-start", @@ -6557,6 +6689,7 @@ keywords: ["auto"], valid_for_first_letter: true, valid_for_position_fallback: true, + valid_for_permission_element: true, }, { name: "margin-block-end", @@ -6570,6 +6703,7 @@ keywords: ["auto"], valid_for_first_letter: true, valid_for_position_fallback: true, + valid_for_permission_element: true, }, { name: "padding-inline-start", @@ -6619,6 +6753,7 @@ resolver: "inline-start", }, valid_for_first_letter: true, + valid_for_permission_element: true, }, { name: "border-inline-start-style", @@ -6627,6 +6762,7 @@ resolver: "inline-start", }, valid_for_first_letter: true, + valid_for_permission_element: true, }, { name: "border-inline-start-color", @@ -6636,6 +6772,7 @@ resolver: "inline-start", }, valid_for_first_letter: true, + valid_for_permission_element: true, }, { name: "border-inline-end-width", @@ -6645,6 +6782,7 @@ resolver: "inline-end", }, valid_for_first_letter: true, + valid_for_permission_element: true, }, { name: "border-inline-end-style", @@ -6653,6 +6791,7 @@ resolver: "inline-end", }, valid_for_first_letter: true, + valid_for_permission_element: true, }, { name: "border-inline-end-color", @@ -6662,6 +6801,7 @@ resolver: "inline-end", }, valid_for_first_letter: true, + valid_for_permission_element: true, }, { name: "border-block-start-width", @@ -6671,6 +6811,7 @@ resolver: "block-start", }, valid_for_first_letter: true, + valid_for_permission_element: true, }, { name: "border-block-start-style", @@ -6679,6 +6820,7 @@ resolver: "block-start", }, valid_for_first_letter: true, + valid_for_permission_element: true, }, { name: "border-block-start-color", @@ -6688,6 +6830,7 @@ resolver: "block-start", }, valid_for_first_letter: true, + valid_for_permission_element: true, }, { name: "border-block-end-width", @@ -6697,6 +6840,7 @@ resolver: "block-end", }, valid_for_first_letter: true, + valid_for_permission_element: true, }, { name: "border-block-end-style", @@ -6705,6 +6849,7 @@ resolver: "block-end", }, valid_for_first_letter: true, + valid_for_permission_element: true, }, { name: "border-block-end-color", @@ -6714,6 +6859,7 @@ resolver: "block-end", }, valid_for_first_letter: true, + valid_for_permission_element: true, }, { name: "inset-inline-start", @@ -6725,6 +6871,7 @@ typedom_types: ["Length", "Percentage"], valid_for_position_fallback: true, layout_dependent: true, + valid_for_permission_element: true, }, { name: "inset-inline-end", @@ -6736,6 +6883,7 @@ typedom_types: ["Length", "Percentage"], valid_for_position_fallback: true, layout_dependent: true, + valid_for_permission_element: true, }, { name: "inset-block-start", @@ -6747,6 +6895,7 @@ typedom_types: ["Length", "Percentage"], valid_for_position_fallback: true, layout_dependent: true, + valid_for_permission_element: true, }, { name: "inset-block-end", @@ -6758,6 +6907,7 @@ typedom_types: ["Length", "Percentage"], valid_for_position_fallback: true, layout_dependent: true, + valid_for_permission_element: true, }, { name: "border-start-start-radius", @@ -6768,6 +6918,7 @@ }, typedom_types: ["Length", "Percentage"], valid_for_first_letter: true, + valid_for_permission_element: true, }, { name: "border-start-end-radius", @@ -6778,6 +6929,7 @@ }, typedom_types: ["Length", "Percentage"], valid_for_first_letter: true, + valid_for_permission_element: true, }, { name: "border-end-start-radius", @@ -6788,6 +6940,7 @@ }, typedom_types: ["Length", "Percentage"], valid_for_first_letter: true, + valid_for_permission_element: true, }, { name: "border-end-end-radius", @@ -6798,6 +6951,7 @@ }, typedom_types: ["Length", "Percentage"], valid_for_first_letter: true, + valid_for_permission_element: true, }, // Non-standard direction aware properties @@ -7035,6 +7189,7 @@ name: "base-palette", is_descriptor: true, is_property: false, + valid_for_permission_element: true, }, { name: "override-colors", @@ -7063,6 +7218,7 @@ typedom_types: ["Keyword"], valid_for_position_fallback: true, runtime_flag: "CSSAnchorPositioning", + valid_for_permission_element: true, }, // Shorthands @@ -7290,6 +7446,7 @@ "border-bottom-right-radius", "border-bottom-left-radius" ], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], + valid_for_permission_element: true, }, { name: "border-right", @@ -7343,6 +7500,7 @@ resolver: "inline", }, typedom_types: ["Keyword", "Length"], + valid_for_permission_element: true, }, { name: "contain-intrinsic-block-size", @@ -7352,6 +7510,7 @@ resolver: "block", }, typedom_types: ["Keyword", "Length"], + valid_for_permission_element: true, }, { name: "contain-intrinsic-size", @@ -7360,6 +7519,7 @@ ], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], computable: true, + valid_for_permission_element: true, }, { name: "container", @@ -7513,6 +7673,7 @@ property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], layout_dependent: true, valid_for_position_fallback: true, + valid_for_permission_element: true, }, { name: "margin-block",
diff --git a/third_party/blink/renderer/core/css/parser/css_parser_token.h b/third_party/blink/renderer/core/css/parser/css_parser_token.h index 3193db7..128b32a 100644 --- a/third_party/blink/renderer/core/css/parser/css_parser_token.h +++ b/third_party/blink/renderer/core/css/parser/css_parser_token.h
@@ -228,6 +228,10 @@ } } + // Bitfields are all declared as type `unsigned` based on observation that + // on Windows, adjacent bitfields of differing types do not get packed + // together, for binary compatibility with code generated by MSVC. + unsigned type_ : 6; // CSSParserTokenType unsigned block_type_ : 2; // BlockType unsigned numeric_value_type_ : 1; // NumericValueType @@ -242,11 +246,11 @@ // contents (saving RAM and a little time). If so, value_is_inline_ // is set to mark that the buffer contains the string itself instead of // a pointer to the string. It also guarantees value_is_8bit_ == true. - bool value_is_inline_ : 1; + unsigned value_is_inline_ : 1; // value_... is an unpacked StringView so that we can pack it // tightly with the rest of this object for a smaller object size. - bool value_is_8bit_ : 1; + unsigned value_is_8bit_ : 1; // These are free bits. You may take from them if you need. unsigned padding_ : 12; @@ -276,6 +280,9 @@ }; }; +// If this assert fails, check the comment above about bitfields. +static_assert(sizeof(CSSParserToken) == 24); + } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_CORE_CSS_PARSER_CSS_PARSER_TOKEN_H_
diff --git a/third_party/blink/renderer/core/css/properties/computed_style_utils.cc b/third_party/blink/renderer/core/css/properties/computed_style_utils.cc index 90b3b17..34c2ed9 100644 --- a/third_party/blink/renderer/core/css/properties/computed_style_utils.cc +++ b/third_party/blink/renderer/core/css/properties/computed_style_utils.cc
@@ -4219,81 +4219,8 @@ const CSSProperty& property, const ComputedStyle& style, const LayoutObject* layout_object) { - switch (property.PropertyID()) { - case CSSPropertyID::kAnimationDuration: - return ComputedStyleUtils::ValueForAnimationDurationList( - style.Animations(), CSSValuePhase::kComputedValue); - // Computed value is usually relative so that multiple fonts in child - // elements work properly, but resolved value is always a pixel length. - case CSSPropertyID::kLineHeight: - return ComputedStyleUtils::ComputedValueForLineHeight(style); - - // Returns a transform list instead of converting to a (resolved) matrix. - case CSSPropertyID::kTransform: - return ComputedStyleUtils::ComputedTransformList(style, layout_object); - - // For the following properties, the resolved value is the used value, which - // is not what we want. Obtain the computed value instead. - case CSSPropertyID::kBackgroundColor: - return ComputedStyleUtils::CurrentColorOrValidColor( - style, style.BackgroundColor(), CSSValuePhase::kComputedValue); - case CSSPropertyID::kBorderBlockEndColor: - case CSSPropertyID::kBorderBlockStartColor: - case CSSPropertyID::kBorderInlineEndColor: - case CSSPropertyID::kBorderInlineStartColor: - return ComputedStyleUtils::ComputedPropertyValue( - property.ResolveDirectionAwareProperty(style.Direction(), - style.GetWritingMode()), - style, layout_object); - case CSSPropertyID::kBorderBottomColor: - return ComputedStyleUtils::CurrentColorOrValidColor( - style, style.BorderBottomColor(), CSSValuePhase::kComputedValue); - case CSSPropertyID::kBorderLeftColor: - return ComputedStyleUtils::CurrentColorOrValidColor( - style, style.BorderLeftColor(), CSSValuePhase::kComputedValue); - case CSSPropertyID::kBorderRightColor: - return ComputedStyleUtils::CurrentColorOrValidColor( - style, style.BorderRightColor(), CSSValuePhase::kComputedValue); - case CSSPropertyID::kBorderTopColor: - return ComputedStyleUtils::CurrentColorOrValidColor( - style, style.BorderTopColor(), CSSValuePhase::kComputedValue); - case CSSPropertyID::kBoxShadow: - return ComputedStyleUtils::ValueForShadowList( - style.BoxShadow(), style, true, CSSValuePhase::kComputedValue); - case CSSPropertyID::kCaretColor: - return ComputedStyleUtils::ValueForStyleAutoColor( - style, style.CaretColor(), CSSValuePhase::kComputedValue); - case CSSPropertyID::kColor: - return ComputedStyleUtils::CurrentColorOrValidColor( - style, style.Color(), CSSValuePhase::kComputedValue); - case CSSPropertyID::kMinHeight: { - if (style.MinHeight().IsAuto()) { - return CSSIdentifierValue::Create(CSSValueID::kAuto); - } - return property.CSSValueFromComputedStyle( - style, /*layout_object=*/nullptr, false, - CSSValuePhase::kComputedValue); - } - case CSSPropertyID::kMinWidth: { - if (style.MinWidth().IsAuto()) { - return CSSIdentifierValue::Create(CSSValueID::kAuto); - } - return property.CSSValueFromComputedStyle( - style, /*layout_object=*/nullptr, false, - CSSValuePhase::kComputedValue); - } - case CSSPropertyID::kOutlineColor: - return ComputedStyleUtils::CurrentColorOrValidColor( - style, style.OutlineColor(), CSSValuePhase::kComputedValue); - - // For all other properties, the resolved value is either always the same - // as the computed value (most properties), or the same as the computed - // value when there is no layout box ('width' and friends). - default: - return property.CSSValueFromComputedStyle( - style, /*layout_object=*/nullptr, false, - CSSValuePhase::kComputedValue); - } + return property.CSSValueFromComputedStyle(style, layout_object, false, + CSSValuePhase::kComputedValue); } } // namespace blink
diff --git a/third_party/blink/renderer/core/css/properties/css_property.h b/third_party/blink/renderer/core/css/properties/css_property.h index 3123315..e9d850f 100644 --- a/third_party/blink/renderer/core/css/properties/css_property.h +++ b/third_party/blink/renderer/core/css/properties/css_property.h
@@ -265,6 +265,8 @@ kValidForHighlight = 1ull << 31, // See accepts_numeric_literal in css_properties.json5. kAcceptsNumericLiteral = 1ull << 32, + // See valid_for_permission_element in css_properties.json5 + kValidForPermissionElement = 1ull << 33, }; constexpr CSSProperty(CSSPropertyID property_id,
diff --git a/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc b/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc index 8af1d6d7..1039563 100644 --- a/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc +++ b/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc
@@ -815,7 +815,8 @@ } StyleColor background_color = style.BackgroundColor(); - if (style.ShouldForceColor(background_color)) { + if (value_phase == CSSValuePhase::kResolvedValue && + style.ShouldForceColor(background_color)) { return GetCSSPropertyInternalForcedBackgroundColor() .CSSValueFromComputedStyle(style, nullptr, allow_visited_style, value_phase); @@ -1081,7 +1082,8 @@ bool allow_visited_style, CSSValuePhase value_phase) const { StyleColor border_bottom_color = style.BorderBottomColor(); - if (style.ShouldForceColor(border_bottom_color)) { + if (value_phase == CSSValuePhase::kResolvedValue && + style.ShouldForceColor(border_bottom_color)) { return GetCSSPropertyInternalForcedBorderColor().CSSValueFromComputedStyle( style, nullptr, allow_visited_style, value_phase); } @@ -1356,7 +1358,8 @@ bool allow_visited_style, CSSValuePhase value_phase) const { StyleColor border_left_color = style.BorderLeftColor(); - if (style.ShouldForceColor(border_left_color)) { + if (value_phase == CSSValuePhase::kResolvedValue && + style.ShouldForceColor(border_left_color)) { return GetCSSPropertyInternalForcedBorderColor().CSSValueFromComputedStyle( style, nullptr, allow_visited_style, value_phase); } @@ -1418,7 +1421,8 @@ bool allow_visited_style, CSSValuePhase value_phase) const { StyleColor border_right_color = style.BorderRightColor(); - if (style.ShouldForceColor(border_right_color)) { + if (value_phase == CSSValuePhase::kResolvedValue && + style.ShouldForceColor(border_right_color)) { return GetCSSPropertyInternalForcedBorderColor().CSSValueFromComputedStyle( style, nullptr, allow_visited_style, value_phase); } @@ -1494,7 +1498,8 @@ bool allow_visited_style, CSSValuePhase value_phase) const { StyleColor border_top_color = style.BorderTopColor(); - if (style.ShouldForceColor(border_top_color)) { + if (value_phase == CSSValuePhase::kResolvedValue && + style.ShouldForceColor(border_top_color)) { return GetCSSPropertyInternalForcedBorderColor().CSSValueFromComputedStyle( style, nullptr, allow_visited_style, value_phase); } @@ -1691,7 +1696,8 @@ // the background to ensure good visibility and contrast. StyleColor result = auto_color.IsAutoColor() ? StyleColor::CurrentColor() : auto_color.ToStyleColor(); - if (style.ShouldForceColor(result)) { + if (value_phase == CSSValuePhase::kResolvedValue && + style.ShouldForceColor(result)) { return cssvalue::CSSColor::Create(style.GetInternalForcedCurrentColor()); } @@ -1873,7 +1879,8 @@ const LayoutObject*, bool allow_visited_style, CSSValuePhase value_phase) const { - if (style.ShouldForceColor(style.Color())) { + if (value_phase == CSSValuePhase::kResolvedValue && + style.ShouldForceColor(style.Color())) { return GetCSSPropertyInternalForcedColor().CSSValueFromComputedStyle( style, nullptr, allow_visited_style, value_phase); } @@ -4293,7 +4300,8 @@ const LayoutObject* layout_object, bool allow_visited_style, CSSValuePhase value_phase) const { - if (ComputedStyleUtils::WidthOrHeightShouldReturnUsedValue(layout_object)) { + if (value_phase == CSSValuePhase::kResolvedValue && + ComputedStyleUtils::WidthOrHeightShouldReturnUsedValue(layout_object)) { return ZoomAdjustedPixelValue( ComputedStyleUtils::UsedBoxSize(*layout_object).height(), style); } @@ -5470,6 +5478,9 @@ const LayoutObject*, bool allow_visited_style, CSSValuePhase value_phase) const { + if (value_phase == CSSValuePhase::kComputedValue) { + return ComputedStyleUtils::ComputedValueForLineHeight(style); + } return ComputedStyleUtils::ValueForLineHeight(style); } @@ -5941,6 +5952,9 @@ bool allow_visited_style, CSSValuePhase value_phase) const { if (style.MinHeight().IsAuto()) { + if (value_phase == CSSValuePhase::kComputedValue) { + return CSSIdentifierValue::Create(CSSValueID::kAuto); + } return ComputedStyleUtils::MinWidthOrMinHeightAuto(style); } return ComputedStyleUtils::ZoomAdjustedPixelValueForLength(style.MinHeight(), @@ -5967,6 +5981,9 @@ bool allow_visited_style, CSSValuePhase value_phase) const { if (style.MinWidth().IsAuto()) { + if (value_phase == CSSValuePhase::kComputedValue) { + return CSSIdentifierValue::Create(CSSValueID::kAuto); + } return ComputedStyleUtils::MinWidthOrMinHeightAuto(style); } return ComputedStyleUtils::ZoomAdjustedPixelValueForLength(style.MinWidth(), @@ -6285,7 +6302,8 @@ bool allow_visited_style, CSSValuePhase value_phase) const { StyleColor outline_color = style.OutlineColor(); - if (style.ShouldForceColor(outline_color)) { + if (value_phase == CSSValuePhase::kResolvedValue && + style.ShouldForceColor(outline_color)) { return GetCSSPropertyInternalForcedOutlineColor().CSSValueFromComputedStyle( style, nullptr, allow_visited_style, value_phase); } @@ -9029,6 +9047,9 @@ const LayoutObject* layout_object, bool allow_visited_style, CSSValuePhase value_phase) const { + if (value_phase == CSSValuePhase::kComputedValue) { + return ComputedStyleUtils::ComputedTransformList(style, layout_object); + } return ComputedStyleUtils::ResolvedTransform(layout_object, style); } @@ -10882,7 +10903,8 @@ const LayoutObject* layout_object, bool allow_visited_style, CSSValuePhase value_phase) const { - if (ComputedStyleUtils::WidthOrHeightShouldReturnUsedValue(layout_object)) { + if (value_phase == CSSValuePhase::kResolvedValue && + ComputedStyleUtils::WidthOrHeightShouldReturnUsedValue(layout_object)) { return ZoomAdjustedPixelValue( ComputedStyleUtils::UsedBoxSize(*layout_object).width(), style); }
diff --git a/third_party/blink/renderer/core/css/resolver/cascade_filter.h b/third_party/blink/renderer/core/css/resolver/cascade_filter.h index e78ee52..163765f 100644 --- a/third_party/blink/renderer/core/css/resolver/cascade_filter.h +++ b/third_party/blink/renderer/core/css/resolver/cascade_filter.h
@@ -32,7 +32,7 @@ // This is equivalent to: // // CascadeFilter filter; - // filter.Add(flag, v); + // filter = filter.Add(flag, v); // CascadeFilter(CSSProperty::Flag flag, bool v) : mask_(flag), flags_(v ? flag : 0) {}
diff --git a/third_party/blink/renderer/core/css/resolver/style_resolver.cc b/third_party/blink/renderer/core/css/resolver/style_resolver.cc index 3f8760b..b0198367 100644 --- a/third_party/blink/renderer/core/css/resolver/style_resolver.cc +++ b/third_party/blink/renderer/core/css/resolver/style_resolver.cc
@@ -65,6 +65,7 @@ #include "third_party/blink/renderer/core/css/properties/css_property.h" #include "third_party/blink/renderer/core/css/properties/css_property_ref.h" #include "third_party/blink/renderer/core/css/properties/longhands.h" +#include "third_party/blink/renderer/core/css/resolver/cascade_filter.h" #include "third_party/blink/renderer/core/css/resolver/match_result.h" #include "third_party/blink/renderer/core/css/resolver/scoped_style_resolver.h" #include "third_party/blink/renderer/core/css/resolver/selector_filter_parent_scope.h" @@ -2030,7 +2031,7 @@ cascade.AddInterpolations(&animations, CascadeOrigin::kAnimation); cascade.AddInterpolations(&transitions, CascadeOrigin::kTransition); - CascadeFilter filter; + CascadeFilter filter = state.GetElement().GetCascadeFilter(); if (state.StyleBuilder().StyleType() == kPseudoIdMarker) { filter = filter.Add(CSSProperty::kValidForMarker, false); } @@ -2530,17 +2531,19 @@ old_style = state.StyleBuilder().CloneStyle(); } + CascadeFilter filter = state.GetElement().GetCascadeFilter(); + // In order to use-count whether or not legacy overlapping properties // made a real difference to the ComputedStyle, we first apply the cascade // while filtering out such properties. If the filter did reject // any legacy overlapping properties, we apply all overlapping properties // again to get the correct result. - apply(CascadeFilter(CSSProperty::kLegacyOverlapping, true)); + apply(filter.Add(CSSProperty::kLegacyOverlapping, true)); if (state.RejectedLegacyOverlapping()) { const ComputedStyle* non_legacy_style = state.StyleBuilder().CloneStyle(); // Re-apply all overlapping properties (both legacy and non-legacy). - apply(CascadeFilter(CSSProperty::kOverlapping, false)); + apply(filter.Add(CSSProperty::kOverlapping, false)); UseCountLegacyOverlapping(GetDocument(), *non_legacy_style, state.StyleBuilder()); }
diff --git a/third_party/blink/renderer/core/css/selector_checker.cc b/third_party/blink/renderer/core/css/selector_checker.cc index 7f0921e0..b385221 100644 --- a/third_party/blink/renderer/core/css/selector_checker.cc +++ b/third_party/blink/renderer/core/css/selector_checker.cc
@@ -2069,7 +2069,7 @@ return form_control_element->GetAutofillState() == WebAutofillState::kPreviewed; case CSSSelector::kPseudoAutofillSelected: - return form_control_element->HighlightAutofilled(); + return form_control_element->IsAutofilled(); default: NOTREACHED(); }
diff --git a/third_party/blink/renderer/core/css/style_engine_test.cc b/third_party/blink/renderer/core/css/style_engine_test.cc index 306be41c..0460690 100644 --- a/third_party/blink/renderer/core/css/style_engine_test.cc +++ b/third_party/blink/renderer/core/css/style_engine_test.cc
@@ -108,7 +108,7 @@ return ref.GetProperty().CSSValueFromComputedStyle( element->ComputedStyleRef(), /* layout_object */ nullptr, - /* allow_visited_style */ false, CSSValuePhase::kComputedValue); + /* allow_visited_style */ false, CSSValuePhase::kResolvedValue); } void InjectSheet(String key, WebCssOrigin origin, String text) {
diff --git a/third_party/blink/renderer/core/dom/element.h b/third_party/blink/renderer/core/dom/element.h index c511c85..cb804cad 100644 --- a/third_party/blink/renderer/core/dom/element.h +++ b/third_party/blink/renderer/core/dom/element.h
@@ -38,6 +38,7 @@ #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/css/css_primitive_value.h" #include "third_party/blink/renderer/core/css/css_selector.h" +#include "third_party/blink/renderer/core/css/resolver/cascade_filter.h" #include "third_party/blink/renderer/core/css/style_recalc_change.h" #include "third_party/blink/renderer/core/dom/container_node.h" #include "third_party/blink/renderer/core/dom/dom_high_res_time_stamp.h" @@ -1373,6 +1374,10 @@ void SetTargetedSnapAreaIdsForSnapContainers(); void ClearTargetedSnapAreaIdsForSnapContainers(); + // Subclasses can override this method to specify a CascadeFilter to + // filter out any unwanted CSS properties. + virtual CascadeFilter GetCascadeFilter() const { return CascadeFilter(); } + protected: bool HasElementData() const { return static_cast<bool>(element_data_); } const ElementData* GetElementData() const { return element_data_.Get(); }
diff --git a/third_party/blink/renderer/core/exported/web_form_control_element.cc b/third_party/blink/renderer/core/exported/web_form_control_element.cc index 190e981..644a35e 100644 --- a/third_party/blink/renderer/core/exported/web_form_control_element.cc +++ b/third_party/blink/renderer/core/exported/web_form_control_element.cc
@@ -113,17 +113,6 @@ Unwrap<HTMLFormControlElement>()->SetAutofillState(autofill_state); } -void WebFormControlElement::SetPreventHighlightingOfAutofilledFields( - bool prevent_highlighting) { - Unwrap<HTMLFormControlElement>()->SetPreventHighlightingOfAutofilledFields( - prevent_highlighting); -} - -bool WebFormControlElement::PreventHighlightingOfAutofilledFields() const { - return ConstUnwrap<HTMLFormControlElement>() - ->PreventHighlightingOfAutofilledFields(); -} - WebString WebFormControlElement::AutofillSection() const { return ConstUnwrap<HTMLFormControlElement>()->AutofillSection(); }
diff --git a/third_party/blink/renderer/core/html/forms/html_form_control_element.cc b/third_party/blink/renderer/core/html/forms/html_form_control_element.cc index d45816a..9c37a20 100644 --- a/third_party/blink/renderer/core/html/forms/html_form_control_element.cc +++ b/third_party/blink/renderer/core/html/forms/html_form_control_element.cc
@@ -214,18 +214,6 @@ PseudoStateChanged(CSSSelector::kPseudoAutofillPreviewed); } -void HTMLFormControlElement::SetPreventHighlightingOfAutofilledFields( - bool prevent_highlighting) { - if (prevent_highlighting == prevent_highlighting_of_autofilled_fields_) - return; - - prevent_highlighting_of_autofilled_fields_ = prevent_highlighting; - PseudoStateChanged(CSSSelector::kPseudoAutofill); - PseudoStateChanged(CSSSelector::kPseudoWebKitAutofill); - PseudoStateChanged(CSSSelector::kPseudoAutofillSelected); - PseudoStateChanged(CSSSelector::kPseudoAutofillPreviewed); -} - void HTMLFormControlElement::SetAutofillSection(const WebString& section) { autofill_section_ = section; }
diff --git a/third_party/blink/renderer/core/html/forms/html_form_control_element.h b/third_party/blink/renderer/core/html/forms/html_form_control_element.h index 7a56d90..1326933 100644 --- a/third_party/blink/renderer/core/html/forms/html_form_control_element.h +++ b/third_party/blink/renderer/core/html/forms/html_form_control_element.h
@@ -150,14 +150,7 @@ bool IsPreviewed() const { return autofill_state_ == WebAutofillState::kPreviewed; } - bool HighlightAutofilled() const { - return IsAutofilled() && !PreventHighlightingOfAutofilledFields(); - } void SetAutofillState(WebAutofillState = WebAutofillState::kAutofilled); - void SetPreventHighlightingOfAutofilledFields(bool prevent_highlighting); - bool PreventHighlightingOfAutofilledFields() const { - return prevent_highlighting_of_autofilled_fields_; - } // The autofill section to which this element belongs (e.g. billing address, // shipping address, .. .) @@ -217,7 +210,6 @@ WebString autofill_section_; enum WebAutofillState autofill_state_; - bool prevent_highlighting_of_autofilled_fields_ : 1; bool blocks_form_submission_ : 1; };
diff --git a/third_party/blink/renderer/core/html/html_permission_element.cc b/third_party/blink/renderer/core/html/html_permission_element.cc index 4e2b057..7768e073 100644 --- a/third_party/blink/renderer/core/html/html_permission_element.cc +++ b/third_party/blink/renderer/core/html/html_permission_element.cc
@@ -23,6 +23,7 @@ #include "third_party/blink/renderer/core/inspector/console_message.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" +#include "third_party/blink/renderer/platform/runtime_enabled_features.h" #include "third_party/blink/renderer/platform/text/platform_locale.h" namespace blink { @@ -176,6 +177,7 @@ embedded_permission_control_receiver_(this, document.GetExecutionContext()) { DCHECK(RuntimeEnabledFeatures::PermissionElementEnabled()); + SetHasCustomStyleCallbacks(); EnsureUserAgentShadowRoot(); } @@ -278,6 +280,51 @@ shadow_element_->AppendChild(permission_text_span_); } +void HTMLPermissionElement::AdjustStyle(ComputedStyleBuilder& builder) { + Element::AdjustStyle(builder); + + builder.SetOutlineOffset(builder.OutlineOffset().ClampNegativeToZero()); + + // TODO(crbug.com/1462930): Handle calculated Lengths. + if (!builder.MarginLeft().IsCalculated() && + builder.MarginLeft().Value() < 0) { + builder.ResetMarginLeft(); + } + if (!builder.MarginRight().IsCalculated() && + builder.MarginRight().Value() < 0) { + builder.ResetMarginRight(); + } + if (!builder.MarginTop().IsCalculated() && builder.MarginTop().Value() < 0) { + builder.ResetMarginTop(); + } + if (!builder.MarginBottom().IsCalculated() && + builder.MarginBottom().Value() < 0) { + builder.ResetMarginBottom(); + } + + // TODO(crbug.com/1462930): Validate here that the 'background-color' and + // 'color' properties pass accessibility checks (and are at 100% alpha). + + // TODO(crbug.com/1462930): Add here checks to force the min/max-width/height. + + // TODO(crbug.com/1462930): Validate here the `letter-spacing` property, and + // that it's not too big. + + // TODO(crbug.com/1462930): Clamp font weight to at least 200. + + // TODO(crbug.com/1462930): Remove <angle> from font-style: 'oblique'. + + // TODO(crbug.com/1462930): Set text direction (ltr\rtl) based on language. + + // TODO(crbug.com/1462930): Set word-spacing so it's at most 5px. + + // TODO(crbug.com/1462930): Ensure font-size at least as large as the + // equivalent of 'small'. + + // TODO(crbug.com/1462930): Ensure any value of display other than 'none' is + // converted to 'inline-block'. +} + void HTMLPermissionElement::DefaultEventHandler(Event& event) { if (event.type() == event_type_names::kDOMActivate) { event.SetDefaultHandled(); @@ -391,6 +438,12 @@ return false; } + // Do not check click-disabling reasons if the PEPC validation feature is + // disabled. This should only occur in testing scenarios. + if (RuntimeEnabledFeatures::DisablePEPCSecurityForTestingEnabled()) { + return true; + } + // Remove expired reasons. If a non-expired reason is found, then clicking is // disabled. base::TimeTicks now = base::TimeTicks::Now();
diff --git a/third_party/blink/renderer/core/html/html_permission_element.h b/third_party/blink/renderer/core/html/html_permission_element.h index 1dedf87..fece4af 100644 --- a/third_party/blink/renderer/core/html/html_permission_element.h +++ b/third_party/blink/renderer/core/html/html_permission_element.h
@@ -11,6 +11,8 @@ #include "base/time/time.h" #include "third_party/blink/public/mojom/permissions/permission.mojom-blink.h" #include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/core/css/properties/css_property.h" +#include "third_party/blink/renderer/core/css/resolver/cascade_filter.h" #include "third_party/blink/renderer/core/dom/events/event_target.h" #include "third_party/blink/renderer/core/html/html_element.h" #include "third_party/blink/renderer/core/html/shadow/permission_shadow_element.h" @@ -55,6 +57,11 @@ return permission_text_span_; } + CascadeFilter GetCascadeFilter() const override { + // Reject all properties for which 'kValidForPermissionElement' is false. + return CascadeFilter(CSSProperty::kValidForPermissionElement, false); + } + private: enum class DisableReason { kRecentlyAttachedToDOM, @@ -67,6 +74,7 @@ // blink::Element implements void AttributeChanged(const AttributeModificationParams& params) override; void DidAddUserAgentShadowRoot(ShadowRoot&) override; + void AdjustStyle(ComputedStyleBuilder& builder) override; // blink::Node override. void DefaultEventHandler(Event&) override;
diff --git a/third_party/blink/renderer/core/html/resources/permission.css b/third_party/blink/renderer/core/html/resources/permission.css index 0af1bdb..95a76f5 100644 --- a/third_party/blink/renderer/core/html/resources/permission.css +++ b/third_party/blink/renderer/core/html/resources/permission.css
@@ -15,7 +15,6 @@ color: #000000; display: inline-block; height: 1.2em; - opacity: 1 !important; outline: solid 1px #767676; width: 188px; } @@ -26,16 +25,17 @@ permission::-internal-permission-text { display: inherit; - font-family: Arial, Helvetica, sans-serif; + font-family: Arial, Helvetica, sans-serif !important; font-size: inherit; font-style: normal; font-weight: 400; height: 100%; + hyphenate-character: auto !important; line-height: inherit; - opacity: 1 !important; outline: none; user-select:none !important; vertical-align: inherit; white-space:nowrap !important; + word-wrap: normal !important; width: 100%; }
diff --git a/third_party/blink/renderer/core/inspector/inspector_network_agent.cc b/third_party/blink/renderer/core/inspector/inspector_network_agent.cc index 45b0e31b..ef9a82f 100644 --- a/third_party/blink/renderer/core/inspector/inspector_network_agent.cc +++ b/third_party/blink/renderer/core/inspector/inspector_network_agent.cc
@@ -877,7 +877,7 @@ san_list->push_back(StringFromASCII(san)); } for (const std::string& san : san_ip) { - net::IPAddress ip(reinterpret_cast<const uint8_t*>(san.data()), san.size()); + net::IPAddress ip(base::as_byte_span(san)); san_list->push_back(StringFromASCII(ip.ToString())); }
diff --git a/third_party/blink/renderer/core/paint/theme_painter_default.cc b/third_party/blink/renderer/core/paint/theme_painter_default.cc index 698b9e29..15ad201 100644 --- a/third_party/blink/renderer/core/paint/theme_painter_default.cc +++ b/third_party/blink/renderer/core/paint/theme_painter_default.cc
@@ -406,9 +406,8 @@ style.VisitedDependentColor(GetCSSPropertyBackgroundColor()); text_field.background_color = background_color.Rgb(); text_field.auto_complete_active = - DynamicTo<HTMLFormControlElement>(element)->HighlightAutofilled() || - DynamicTo<HTMLFormControlElement>(element)->GetAutofillState() == - WebAutofillState::kPreviewed; + DynamicTo<HTMLFormControlElement>(element)->IsAutofilled() || + DynamicTo<HTMLFormControlElement>(element)->IsPreviewed(); WebThemeEngine::ExtraParams extra_params(text_field); mojom::blink::ColorScheme color_scheme = style.UsedColorScheme();
diff --git a/third_party/blink/renderer/modules/webgpu/gpu.cc b/third_party/blink/renderer/modules/webgpu/gpu.cc index 7bc83239..3976ff38 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu.cc +++ b/third_party/blink/renderer/modules/webgpu/gpu.cc
@@ -199,6 +199,7 @@ case WGPURequestAdapterStatus_Unavailable: case WGPURequestAdapterStatus_Error: case WGPURequestAdapterStatus_Unknown: + case WGPURequestAdapterStatus_InstanceDropped: break; default:
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index 51cf1e5..08985c9 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -1307,6 +1307,13 @@ base_feature: "none", }, { + // Bypasses the enforcement of the Page Embedded Permission Control + // security checks. This flag is disabled by default and should only be + // enabled in automated tests in order to allow them to avoid needing to + // wait until the PEPC is validated and also to use JS-initiated clicks. + name: "DisablePEPCSecurityForTesting", + }, + { name: "DisableSelectAllForEmptyText", status: "stable", }, @@ -3503,7 +3510,7 @@ }, { name: "SpeakerSelection", - status: "test", + status: "experimental", }, { name: "SpeculationRulesDocumentRules",
diff --git a/third_party/blink/web_tests/FlagExpectations/enable-skia-graphite b/third_party/blink/web_tests/FlagExpectations/enable-skia-graphite index 9d5eef91..ca612674 100644 --- a/third_party/blink/web_tests/FlagExpectations/enable-skia-graphite +++ b/third_party/blink/web_tests/FlagExpectations/enable-skia-graphite
@@ -31,6 +31,9 @@ crbug.com/1518086 external/wpt/html/semantics/embedded-content/media-elements/ready-states/autoplay-hidden.optional.html [ Failure ] # ====== New tests from wpt-importer added here ====== +crbug.com/626703 virtual/view-transition-wide-gamut/external/wpt/css/css-view-transitions/pseudo-with-classes-entry.html [ Failure ] +crbug.com/626703 virtual/view-transition/external/wpt/css/css-view-transitions/hit-test-unpainted-element.html [ Failure ] +crbug.com/626703 virtual/view-transition-mpa-serialization/external/wpt/css/css-view-transitions/new-and-old-sizes-match.html [ Failure ] crbug.com/626703 virtual/view-transition-wide-gamut/external/wpt/css/css-view-transitions/fractional-box-new.html [ Failure ] crbug.com/626703 virtual/view-transition-wide-gamut/external/wpt/css/css-view-transitions/pseudo-with-classes-match-multiple.html [ Failure ] crbug.com/626703 virtual/view-transition-mpa-serialization/external/wpt/css/css-view-transitions/massive-element-on-top-of-viewport-partially-onscreen-old.html [ Failure ]
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 61665e4122..1054638 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -2632,6 +2632,9 @@ crbug.com/626703 external/wpt/uievents/mouse/mouse_boundary_events_after_removing_last_over_element.html [ Failure ] # ====== New tests from wpt-importer added here ====== +crbug.com/626703 external/wpt/css/css-text/letter-spacing/letter-spacing-percent-001.html [ Failure ] +crbug.com/626703 external/wpt/css/css-text/word-spacing/word-spacing-002.html [ Failure ] +crbug.com/626703 external/wpt/css/css-text/word-spacing/word-spacing-percent-001.html [ Failure ] crbug.com/626703 external/wpt/css/css-text-decor/text-shadow/svg-stroke.html [ Failure ] crbug.com/626703 [ Win11-arm64 ] virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gpu/batch_normalization.https.any.html [ Crash Timeout ] crbug.com/626703 [ Win11-arm64 ] virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/gpu/batch_normalization.https.any.worker.html [ Crash Timeout ]
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json index d5e0e38..f673876 100644 --- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json +++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json
@@ -7587,6 +7587,15 @@ ] } }, + "notifications": { + "global-teardown-crash.html": [ + "27db2ca3b60d65aaa95077755fc333909fcb9459", + [ + null, + {} + ] + ] + }, "print": { "crashtests": { "reload-crash.html": [ @@ -183507,6 +183516,19 @@ ], {} ] + ], + "letter-spacing-percent-001.html": [ + "522320de580652becea6fee125a170f940958827", + [ + null, + [ + [ + "/css/css-text/letter-spacing/reference/letter-spacing-percent-001-ref.html", + "==" + ] + ], + {} + ] ] }, "line-break": { @@ -198408,6 +198430,19 @@ {} ] ], + "word-spacing-002.html": [ + "0def7e01790a885e52fc685231fbcf38df12d8bf", + [ + null, + [ + [ + "/css/css-text/word-spacing/word-spacing-001-ref.html", + "==" + ] + ], + {} + ] + ], "word-spacing-negative-value-001.html": [ "6e5df950c0b55a8b55e6d8c836ca166f0957849c", [ @@ -198420,6 +198455,19 @@ ], {} ] + ], + "word-spacing-percent-001.html": [ + "65f9972040e3b5ccc96d45f1ad668ac55991751b", + [ + null, + [ + [ + "/css/css-text/word-spacing/reference/word-spacing-percent-001-ref.html", + "==" + ] + ], + {} + ] ] }, "writing-system": { @@ -286943,6 +286991,10 @@ "d0481ae3ee7116e47fc4308988d2276e64084c03", [] ], + "selectAudioOutput-permissions-policy.https.sub-expected.txt": [ + "5db2dd69d9a0b52853bd8e262bd045851d6753b2", + [] + ], "selectAudioOutput-sans-user-activation.https-expected.txt": [ "ead3876f462e9f7cfd11810d2a7fe737daa4d3dc", [] @@ -327757,6 +327809,10 @@ "letter-spacing-nesting-003-ref.xht": [ "996f2a1e30435038e1e02ff7b78bd361c06efc17", [] + ], + "letter-spacing-percent-001-ref.html": [ + "1025ecb67cda6ffbb108566279dbc9ba7311eb72", + [] ] }, "support": { @@ -328329,6 +328385,14 @@ "da6ecb32455878c26d4bcd307bf3c651c3d5b065", [] ], + "letter-spacing-computed-expected.txt": [ + "6c45f23b1c3b1904f2ea0d83a4742f26e6a49d03", + [] + ], + "letter-spacing-valid-expected.txt": [ + "9decd1a95edf2debf45fcb504fc7d39127a5ade7", + [] + ], "text-align-all-valid-expected.txt": [ "eed49d7a26f16f94b0320cd9ee431ffdf2d4fc01", [] @@ -328440,6 +328504,14 @@ "word-space-transform-valid-expected.txt": [ "a62737d545b509d0175fc41937ebac799189d48b", [] + ], + "word-spacing-computed-expected.txt": [ + "9045a13d63617d22ffca2707c88ed3ee911e54b9", + [] + ], + "word-spacing-valid-expected.txt": [ + "77e20da66a1af65c8bde82422205413e505b6ff4", + [] ] }, "shaping": { @@ -330563,6 +330635,10 @@ "ref-filled-green-100px-square.xht": [ "05a13794482a94f6c10bd9d4c98704e63ef60331", [] + ], + "word-spacing-percent-001-ref.html": [ + "02bd2f64f45f1ea1e33a0e2f528414c7cb6c7b0c", + [] ] }, "support": { @@ -333390,6 +333466,10 @@ "07301e286d4573309d66c3ca4323f6d736c2ddb2", [] ], + "letter-spacing-expected.txt": [ + "5d4fa8be30384b0b2d3ca29cafa98871e8777136", + [] + ], "list-style-type-expected.txt": [ "a88dfe45f1e20e09391d0643e07dbf635169a996", [] @@ -335022,6 +335102,10 @@ "34df7a6d227c760e19d4d6110e3fb3ac9835021f", [] ], + "calc-letter-spacing-expected.txt": [ + "4446bc0ab25d5af5c1d71ad94371386bb5ceecf2", + [] + ], "calc-linear-radial-conic-gradient-001-expected.txt": [ "faed530112822a605af26c6b73ec2b8068b7be11", [] @@ -365409,14 +365493,6 @@ "3d58e4ca095c228f05a5f6a0e4cc99aac54fd407", [] ], - "popover-light-dismiss-flat-tree-expected.txt": [ - "37a9b3001c645ea6e686b10c21a75fd3677b89a6", - [] - ], - "popover-light-dismiss-flat-tree-nested-expected.txt": [ - "d29b7bf3da17ebf4a3f231503c153afdb8c09719", - [] - ], "popover-open-display-ref.html": [ "144b81e6457614d4aceb4b7e71f91f77505f828a", [] @@ -365447,7 +365523,7 @@ [] ], "popover-utils.js": [ - "bfc1f89ec1003bfaeca1a7aea115140858a85717", + "96ac7e03f0e7fc6bdd3c44ef400b243dba8b735d", [] ] } @@ -400776,36 +400852,87 @@ {} ] ], - "idbindex_count.htm": [ - "5b45b5223bdaccd24a0974dfcb7ebc7f73a177ac", + "idbindex_count.any.js": [ + "25d743e422f93cf5f069e2d27252d9f6afa8e959", [ - null, - {} - ] - ], - "idbindex_count2.htm": [ - "2a68770df91ceb777fb1bb2417649bec9cc7b1d2", + "IndexedDB/idbindex_count.any.html", + { + "script_metadata": [ + [ + "global", + "window,worker" + ], + [ + "title", + "IDBIndex.count()" + ], + [ + "script", + "resources/support.js" + ] + ] + } + ], [ - null, - {} - ] - ], - "idbindex_count3.htm": [ - "a94e8985546101a374fbd79102294a418a626408", + "IndexedDB/idbindex_count.any.serviceworker.html", + { + "script_metadata": [ + [ + "global", + "window,worker" + ], + [ + "title", + "IDBIndex.count()" + ], + [ + "script", + "resources/support.js" + ] + ] + } + ], [ - null, - {} - ] - ], - "idbindex_count4.htm": [ - "ce19968bf16652484d3e3361580ee12ae44dd610", + "IndexedDB/idbindex_count.any.sharedworker.html", + { + "script_metadata": [ + [ + "global", + "window,worker" + ], + [ + "title", + "IDBIndex.count()" + ], + [ + "script", + "resources/support.js" + ] + ] + } + ], [ - null, - {} + "IndexedDB/idbindex_count.any.worker.html", + { + "script_metadata": [ + [ + "global", + "window,worker" + ], + [ + "title", + "IDBIndex.count()" + ], + [ + "script", + "resources/support.js" + ] + ] + } ] ], "idbindex_get.any.js": [ - "601d41d8d164b917e2b5305ce36f9d2467d9bb35", + "0da228f73825e50c5a19cbf9b7504a946ae7b7df", [ "IndexedDB/idbindex_get.any.html", { @@ -400816,7 +400943,7 @@ ], [ "title", - "IDBIndex.get() - returns the record" + "IDBIndex.get()" ], [ "script", @@ -400835,7 +400962,7 @@ ], [ "title", - "IDBIndex.get() - returns the record" + "IDBIndex.get()" ], [ "script", @@ -400854,7 +400981,7 @@ ], [ "title", - "IDBIndex.get() - returns the record" + "IDBIndex.get()" ], [ "script", @@ -400873,7 +401000,7 @@ ], [ "title", - "IDBIndex.get() - returns the record" + "IDBIndex.get()" ], [ "script", @@ -400883,10 +401010,10 @@ } ] ], - "idbindex_get2.any.js": [ - "6790a604d932a1c918817ac26dbef27d05dbfc52", + "idbindex_getAll.any.js": [ + "36b4c0239a524a3f5ae7f64629646f479239cc2f", [ - "IndexedDB/idbindex_get2.any.html", + "IndexedDB/idbindex_getAll.any.html", { "script_metadata": [ [ @@ -400895,7 +401022,7 @@ ], [ "title", - "IDBIndex.get() - returns the record where the index contains duplicate values" + "IndexedDB: Test IDBIndex.getAll" ], [ "script", @@ -400905,7 +401032,7 @@ } ], [ - "IndexedDB/idbindex_get2.any.serviceworker.html", + "IndexedDB/idbindex_getAll.any.serviceworker.html", { "script_metadata": [ [ @@ -400914,7 +401041,7 @@ ], [ "title", - "IDBIndex.get() - returns the record where the index contains duplicate values" + "IndexedDB: Test IDBIndex.getAll" ], [ "script", @@ -400924,7 +401051,7 @@ } ], [ - "IndexedDB/idbindex_get2.any.sharedworker.html", + "IndexedDB/idbindex_getAll.any.sharedworker.html", { "script_metadata": [ [ @@ -400933,7 +401060,7 @@ ], [ "title", - "IDBIndex.get() - returns the record where the index contains duplicate values" + "IndexedDB: Test IDBIndex.getAll" ], [ "script", @@ -400943,7 +401070,7 @@ } ], [ - "IndexedDB/idbindex_get2.any.worker.html", + "IndexedDB/idbindex_getAll.any.worker.html", { "script_metadata": [ [ @@ -400952,7 +401079,7 @@ ], [ "title", - "IDBIndex.get() - returns the record where the index contains duplicate values" + "IndexedDB: Test IDBIndex.getAll" ], [ "script", @@ -400962,10 +401089,10 @@ } ] ], - "idbindex_get3.any.js": [ - "673621b94933cf3f647ab65b5a0caf8734e6b8e9", + "idbindex_getAllKeys.any.js": [ + "92f3cc126984b084617c14db5c4daceeaf38ac4a", [ - "IndexedDB/idbindex_get3.any.html", + "IndexedDB/idbindex_getAllKeys.any.html", { "script_metadata": [ [ @@ -400974,7 +401101,7 @@ ], [ "title", - "IDBIndex.get() - attempt to retrieve a record that doesn't exist" + "IndexedDB: Test IDBIndex.getAllKeys." ], [ "script", @@ -400984,7 +401111,7 @@ } ], [ - "IndexedDB/idbindex_get3.any.serviceworker.html", + "IndexedDB/idbindex_getAllKeys.any.serviceworker.html", { "script_metadata": [ [ @@ -400993,7 +401120,7 @@ ], [ "title", - "IDBIndex.get() - attempt to retrieve a record that doesn't exist" + "IndexedDB: Test IDBIndex.getAllKeys." ], [ "script", @@ -401003,7 +401130,7 @@ } ], [ - "IndexedDB/idbindex_get3.any.sharedworker.html", + "IndexedDB/idbindex_getAllKeys.any.sharedworker.html", { "script_metadata": [ [ @@ -401012,7 +401139,7 @@ ], [ "title", - "IDBIndex.get() - attempt to retrieve a record that doesn't exist" + "IndexedDB: Test IDBIndex.getAllKeys." ], [ "script", @@ -401022,7 +401149,7 @@ } ], [ - "IndexedDB/idbindex_get3.any.worker.html", + "IndexedDB/idbindex_getAllKeys.any.worker.html", { "script_metadata": [ [ @@ -401031,7 +401158,7 @@ ], [ "title", - "IDBIndex.get() - attempt to retrieve a record that doesn't exist" + "IndexedDB: Test IDBIndex.getAllKeys." ], [ "script", @@ -401041,10 +401168,10 @@ } ] ], - "idbindex_get4.any.js": [ - "096a29e0202edbd1e142bef67ec877dc2cf1b548", + "idbindex_getKey.any.js": [ + "677a70e7cb43e4ad2675a8f03413bd55d8e7aa58", [ - "IndexedDB/idbindex_get4.any.html", + "IndexedDB/idbindex_getKey.any.html", { "script_metadata": [ [ @@ -401053,7 +401180,7 @@ ], [ "title", - "IDBIndex.get() - returns the record with the first key in the range" + "IDBIndex.getKey()" ], [ "script", @@ -401063,7 +401190,7 @@ } ], [ - "IndexedDB/idbindex_get4.any.serviceworker.html", + "IndexedDB/idbindex_getKey.any.serviceworker.html", { "script_metadata": [ [ @@ -401072,7 +401199,7 @@ ], [ "title", - "IDBIndex.get() - returns the record with the first key in the range" + "IDBIndex.getKey()" ], [ "script", @@ -401082,7 +401209,7 @@ } ], [ - "IndexedDB/idbindex_get4.any.sharedworker.html", + "IndexedDB/idbindex_getKey.any.sharedworker.html", { "script_metadata": [ [ @@ -401091,7 +401218,7 @@ ], [ "title", - "IDBIndex.get() - returns the record with the first key in the range" + "IDBIndex.getKey()" ], [ "script", @@ -401101,7 +401228,7 @@ } ], [ - "IndexedDB/idbindex_get4.any.worker.html", + "IndexedDB/idbindex_getKey.any.worker.html", { "script_metadata": [ [ @@ -401110,7 +401237,7 @@ ], [ "title", - "IDBIndex.get() - returns the record with the first key in the range" + "IDBIndex.getKey()" ], [ "script", @@ -401120,392 +401247,6 @@ } ] ], - "idbindex_get5.any.js": [ - "d99dfdc3bf0fc4e9f6b55e77b0ecb4beb87b3b38", - [ - "IndexedDB/idbindex_get5.any.html", - { - "script_metadata": [ - [ - "global", - "window,worker" - ], - [ - "title", - "IDBIndex.get() - throw DataError when using invalid key" - ], - [ - "script", - "resources/support.js" - ] - ] - } - ], - [ - "IndexedDB/idbindex_get5.any.serviceworker.html", - { - "script_metadata": [ - [ - "global", - "window,worker" - ], - [ - "title", - "IDBIndex.get() - throw DataError when using invalid key" - ], - [ - "script", - "resources/support.js" - ] - ] - } - ], - [ - "IndexedDB/idbindex_get5.any.sharedworker.html", - { - "script_metadata": [ - [ - "global", - "window,worker" - ], - [ - "title", - "IDBIndex.get() - throw DataError when using invalid key" - ], - [ - "script", - "resources/support.js" - ] - ] - } - ], - [ - "IndexedDB/idbindex_get5.any.worker.html", - { - "script_metadata": [ - [ - "global", - "window,worker" - ], - [ - "title", - "IDBIndex.get() - throw DataError when using invalid key" - ], - [ - "script", - "resources/support.js" - ] - ] - } - ] - ], - "idbindex_get6.any.js": [ - "8cbbe160883db8779ac575150ef02f3fb53877d0", - [ - "IndexedDB/idbindex_get6.any.html", - { - "script_metadata": [ - [ - "global", - "window,worker" - ], - [ - "title", - "IDBIndex.get() - throw InvalidStateError when the index is deleted" - ], - [ - "script", - "resources/support.js" - ] - ] - } - ], - [ - "IndexedDB/idbindex_get6.any.serviceworker.html", - { - "script_metadata": [ - [ - "global", - "window,worker" - ], - [ - "title", - "IDBIndex.get() - throw InvalidStateError when the index is deleted" - ], - [ - "script", - "resources/support.js" - ] - ] - } - ], - [ - "IndexedDB/idbindex_get6.any.sharedworker.html", - { - "script_metadata": [ - [ - "global", - "window,worker" - ], - [ - "title", - "IDBIndex.get() - throw InvalidStateError when the index is deleted" - ], - [ - "script", - "resources/support.js" - ] - ] - } - ], - [ - "IndexedDB/idbindex_get6.any.worker.html", - { - "script_metadata": [ - [ - "global", - "window,worker" - ], - [ - "title", - "IDBIndex.get() - throw InvalidStateError when the index is deleted" - ], - [ - "script", - "resources/support.js" - ] - ] - } - ] - ], - "idbindex_get7.any.js": [ - "35c8cc8045f10ff50dd0a6f18b813e31aeccfad5", - [ - "IndexedDB/idbindex_get7.any.html", - { - "script_metadata": [ - [ - "global", - "window,worker" - ], - [ - "title", - "IDBIndex.get() - throw TransactionInactiveError on aborted transaction" - ], - [ - "script", - "resources/support.js" - ] - ] - } - ], - [ - "IndexedDB/idbindex_get7.any.serviceworker.html", - { - "script_metadata": [ - [ - "global", - "window,worker" - ], - [ - "title", - "IDBIndex.get() - throw TransactionInactiveError on aborted transaction" - ], - [ - "script", - "resources/support.js" - ] - ] - } - ], - [ - "IndexedDB/idbindex_get7.any.sharedworker.html", - { - "script_metadata": [ - [ - "global", - "window,worker" - ], - [ - "title", - "IDBIndex.get() - throw TransactionInactiveError on aborted transaction" - ], - [ - "script", - "resources/support.js" - ] - ] - } - ], - [ - "IndexedDB/idbindex_get7.any.worker.html", - { - "script_metadata": [ - [ - "global", - "window,worker" - ], - [ - "title", - "IDBIndex.get() - throw TransactionInactiveError on aborted transaction" - ], - [ - "script", - "resources/support.js" - ] - ] - } - ] - ], - "idbindex_get8.any.js": [ - "d6183c189af53a1545cc8ce59631fbce5d7966ff", - [ - "IndexedDB/idbindex_get8.any.html", - { - "script_metadata": [ - [ - "global", - "window,worker" - ], - [ - "title", - "IDBIndex.get() - throw InvalidStateError on index deleted by aborted upgrade" - ], - [ - "script", - "resources/support.js" - ] - ] - } - ], - [ - "IndexedDB/idbindex_get8.any.serviceworker.html", - { - "script_metadata": [ - [ - "global", - "window,worker" - ], - [ - "title", - "IDBIndex.get() - throw InvalidStateError on index deleted by aborted upgrade" - ], - [ - "script", - "resources/support.js" - ] - ] - } - ], - [ - "IndexedDB/idbindex_get8.any.sharedworker.html", - { - "script_metadata": [ - [ - "global", - "window,worker" - ], - [ - "title", - "IDBIndex.get() - throw InvalidStateError on index deleted by aborted upgrade" - ], - [ - "script", - "resources/support.js" - ] - ] - } - ], - [ - "IndexedDB/idbindex_get8.any.worker.html", - { - "script_metadata": [ - [ - "global", - "window,worker" - ], - [ - "title", - "IDBIndex.get() - throw InvalidStateError on index deleted by aborted upgrade" - ], - [ - "script", - "resources/support.js" - ] - ] - } - ] - ], - "idbindex_getAll.html": [ - "bd2a021386be57f857fb28de0c27afb966e5ed22", - [ - null, - {} - ] - ], - "idbindex_getAllKeys.html": [ - "5640bfdee7eed532a582f753a358c0879c37bff1", - [ - null, - {} - ] - ], - "idbindex_getKey.htm": [ - "101e8f06b7b0a326cc18b09afa897c6cad02fdf9", - [ - null, - {} - ] - ], - "idbindex_getKey2.htm": [ - "488368d7f4adaa7fa95b5a2d1a1f0ea2ce35c331", - [ - null, - {} - ] - ], - "idbindex_getKey3.htm": [ - "40ed76d17412e91c3a1aabd2911f6607285c856a", - [ - null, - {} - ] - ], - "idbindex_getKey4.htm": [ - "8c81a272ae8944501b0bf1d0caea71ffeb046f7e", - [ - null, - {} - ] - ], - "idbindex_getKey5.htm": [ - "315513139713d94004b65235f331ba4a04763b76", - [ - null, - {} - ] - ], - "idbindex_getKey6.htm": [ - "b71967d4fbde70eccf4a2b51591ed10866cdb163", - [ - null, - {} - ] - ], - "idbindex_getKey7.htm": [ - "6a64df311681021d314f2d048967618589ea284f", - [ - null, - {} - ] - ], - "idbindex_getKey8.htm": [ - "cf0affb2105b31dd238252e1e6b112334d98e6b8", - [ - null, - {} - ] - ], "idbindex_indexNames.htm": [ "7da76021c8c588066cf4b388cdff6de49a065adf", [ @@ -461035,7 +460776,7 @@ } }, "inheritance.html": [ - "2043afe999db7be2b519aeeb9ec03cc75241e4e2", + "f41a5edcaf594a87149fc9f875453c3b87f1805c", [ null, {} @@ -461180,21 +460921,21 @@ ] ], "letter-spacing-computed.html": [ - "45417d1b4a83c3e0cbb6fcead8a38cd19900e64a", + "a7ef1390c1229ce4c11e0a8cb9cc63911bc61564", [ null, {} ] ], "letter-spacing-invalid.html": [ - "e9ad4e56a5bb71188535bdbf4fee96e8918c4dcc", + "e32b98c6d776ad4b3d5c57f2123229d0e1314601", [ null, {} ] ], "letter-spacing-valid.html": [ - "740d1fc39884de8adcf0b29aacd34ff6c4ff2cb3", + "f20fa21de1c67d12a02f42dfbcf2d1030f8bdbf9", [ null, {} @@ -461635,21 +461376,21 @@ ] ], "word-spacing-computed.html": [ - "192dec6f7a71e32dcb5658716150e725b4dfe4bb", + "7c3f989525cc5c04ad2feb778bc8ff45254e6698", [ null, {} ] ], "word-spacing-invalid.html": [ - "3a1c4ca487c43256e2bb04dfae89f623be95783d", + "ae8e121b9d8e9a6c499ee3d408496d1c0f74f8ed", [ null, {} ] ], "word-spacing-valid.html": [ - "217b2488f53128b8475ce4a3f4ca2aa84570b743", + "640f697f7089ff50dca814e8fd952ccfbdea3091", [ null, {} @@ -462029,7 +461770,7 @@ }, "word-spacing": { "word-spacing-computed-001.html": [ - "84d1fcf1e5a8031844de2d7f0027b0aa50b28c86", + "fac211af66c09315869408af86927fdf7e95daf8", [ null, {} @@ -465318,7 +465059,7 @@ ] ], "letter-spacing.html": [ - "9d313c13955a385920a60fc8e836bf8b296c6e95", + "ab78031b2186c0ebc9ed0917a29df2fa4732cf45", [ null, {} @@ -466917,7 +466658,7 @@ ] ], "calc-letter-spacing.html": [ - "444785ba14c21faefe56c22de0c23766ddb26c95", + "4db3b012208452c799244640e09e4677c983122e", [ null, {} @@ -467264,7 +467005,7 @@ ] ], "minmax-length-invalid.html": [ - "1405c3198128530939d9778642aaab2920bb6e60", + "7b8ca88cd26fb2910ca2e2e04cf5c1629d6b9f89", [ null, {} @@ -572648,6 +572389,20 @@ } }, "permission-element": { + "invalid-css-properties.html": [ + "c7186563f0ae6d8c2c2a8ab2b1d2dcd6c5c9283d", + [ + null, + {} + ] + ], + "negative-offset-and-margin.html": [ + "860e637e0a9f540bd786e4fcc1c3c1c3604cbfe0", + [ + null, + {} + ] + ], "no-end-tag-no-contents.html": [ "5fcce1421b6cd2abed01ab95c381aa7d29708e98", [
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_count.any.js b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_count.any.js new file mode 100644 index 0000000..25d743e --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_count.any.js
@@ -0,0 +1,108 @@ +// META: global=window,worker +// META: title=IDBIndex.count() +// META: script=resources/support.js +// @author Microsoft <https://www.microsoft.com> +// @author Odin Hørthe Omdal <mailto:odinho@opera.com> +// @author Intel <http://www.intel.com> + +'use_strict'; + +async_test(t => { + let db; + + const open_rq = createdb(t); + open_rq.onupgradeneeded = function(e) { + db = e.target.result; + const store = db.createObjectStore("store", { autoIncrement: true }); + store.createIndex("index", "indexedProperty"); + for (let i = 0; i < 10; i++) { + store.add({ indexedProperty: "data" + i }); + } + }; + + open_rq.onsuccess = function(e) { + const rq = db.transaction("store", "readonly", { durability: 'relaxed' }) + .objectStore("store") + .index("index") + .count(); + + rq.onsuccess = t.step_func(function(e) { + assert_equals(e.target.result, 10); + t.done(); + }); + }; +}, 'count() returns the number of records in the index'); + +async_test(t => { + let db; + + const open_rq = createdb(t); + open_rq.onupgradeneeded = function(e) { + db = e.target.result; + const store = db.createObjectStore("store", { autoIncrement: true }); + store.createIndex("index", "indexedProperty"); + + for (let i = 0; i < 10; i++) { + store.add({ indexedProperty: "data" + i }); + } + }; + + open_rq.onsuccess = function(e) { + const rq = db.transaction("store", "readonly", { durability: 'relaxed' }) + .objectStore("store") + .index("index") + .count(IDBKeyRange.bound('data0', 'data4')); + + rq.onsuccess = t.step_func(function(e) { + assert_equals(e.target.result, 5); + t.done(); + }); + }; +}, 'count() returns the number of records that have keys within the range'); + +async_test(t => { + let db; + + const open_rq = createdb(t); + open_rq.onupgradeneeded = function(e) { + db = e.target.result; + + const store = db.createObjectStore("store", { autoIncrement: true }); + store.createIndex("myindex", "idx"); + + for (let i = 0; i < 10; i++) + store.add({ idx: "data_" + (i%2) }); + + store.index("myindex").count("data_0").onsuccess = t.step_func(function(e) { + assert_equals(e.target.result, 5, "count(data_0)"); + t.done(); + }); + }; +}, 'count() returns the number of records that have keys with the key'); + +async_test(t => { + let db; + + const open_rq = createdb(t); + open_rq.onupgradeneeded = function(e) { + db = e.target.result; + const store = db.createObjectStore("store", { autoIncrement: true }); + store.createIndex("index", "indexedProperty"); + + for (let i = 0; i < 10; i++) { + store.add({ indexedProperty: "data" + i }); + } + }; + + open_rq.onsuccess = function(e) { + const index = db.transaction("store", "readonly", { durability: 'relaxed' }) + .objectStore("store") + .index("index"); + + assert_throws_dom("DataError", function () { + index.count(NaN); + }); + + t.done(); + }; +}, 'count() throws DataError when using invalid key');
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_count.htm b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_count.htm deleted file mode 100644 index 5b45b52..0000000 --- a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_count.htm +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html> -<meta charset=utf-8> -<title>IDBIndex.count() - returns the number of records in the index </title> -<link rel="author" title="Microsoft" href="http://www.microsoft.com"> -<script src=/resources/testharness.js></script> -<script src=/resources/testharnessreport.js></script> -<script src=resources/support.js></script> - -<script> - var db, t = async_test(); - - var open_rq = createdb(t); - - open_rq.onupgradeneeded = function(e) { - db = e.target.result; - var store = db.createObjectStore("store", { autoIncrement: true }); - store.createIndex("index", "indexedProperty"); - - for(var i = 0; i < 10; i++) { - store.add({ indexedProperty: "data" + i }); - } - } - - open_rq.onsuccess = function(e) { - var rq = db.transaction("store", "readonly", {durability: 'relaxed'}) - .objectStore("store") - .index("index") - .count(); - - rq.onsuccess = t.step_func(function(e) { - assert_equals(e.target.result, 10); - t.done(); - }); - } -</script> - -<div id=log></div>
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_count2.htm b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_count2.htm deleted file mode 100644 index 2a68770..0000000 --- a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_count2.htm +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html> -<meta charset=utf-8> -<title>IDBIndex.count() - returns the number of records that have keys within the range </title> -<link rel="author" title="Microsoft" href="http://www.microsoft.com"> -<script src=/resources/testharness.js></script> -<script src=/resources/testharnessreport.js></script> -<script src=resources/support.js></script> - -<script> - var db, t = async_test(); - - var open_rq = createdb(t); - - open_rq.onupgradeneeded = function(e) { - db = e.target.result; - var store = db.createObjectStore("store", { autoIncrement: true }); - store.createIndex("index", "indexedProperty"); - - for(var i = 0; i < 10; i++) { - store.add({ indexedProperty: "data" + i }); - } - } - - open_rq.onsuccess = function(e) { - var rq = db.transaction("store", "readonly", {durability: 'relaxed'}) - .objectStore("store") - .index("index") - .count(IDBKeyRange.bound('data0', 'data4')); - - rq.onsuccess = t.step_func(function(e) { - assert_equals(e.target.result, 5); - t.done(); - }); - } -</script> - -<div id=log></div>
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_count3.htm b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_count3.htm deleted file mode 100644 index a94e898..0000000 --- a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_count3.htm +++ /dev/null
@@ -1,28 +0,0 @@ -<!DOCTYPE html> -<meta charset=utf-8> -<title>IDBIndex.count() - returns the number of records that have keys with the key</title> -<link rel="author" href="mailto:odinho@opera.com" title="Odin Hørthe Omdal"> -<script src=/resources/testharness.js></script> -<script src=/resources/testharnessreport.js></script> -<script src=resources/support.js></script> - -<script> - var db - - createdb(async_test()).onupgradeneeded = function(e) { - db = e.target.result - - var store = db.createObjectStore("store", { autoIncrement: true }) - store.createIndex("myindex", "idx") - - for (var i = 0; i < 10; i++) - store.add({ idx: "data_" + (i%2) }); - - store.index("myindex").count("data_0").onsuccess = this.step_func(function(e) { - assert_equals(e.target.result, 5, "count(data_0)") - this.done() - }) - } - -</script> -<div id=log></div>
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_count4.htm b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_count4.htm deleted file mode 100644 index ce19968..0000000 --- a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_count4.htm +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>IDBIndex.count() - throw DataError when using invalid key</title> -<link rel="author" title="Intel" href="http://www.intel.com"> -<link rel="help" href="https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#widl-IDBIndex-count-IDBRequest-any-key"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="resources/support.js"></script> -<div id="log"></div> -<script> - var db, t = async_test(); - - var open_rq = createdb(t); - - open_rq.onupgradeneeded = function(e) { - db = e.target.result; - var store = db.createObjectStore("store", { autoIncrement: true }); - store.createIndex("index", "indexedProperty"); - - for(var i = 0; i < 10; i++) { - store.add({ indexedProperty: "data" + i }); - } - } - - open_rq.onsuccess = function(e) { - var index = db.transaction("store", "readonly", {durability: 'relaxed'}) - .objectStore("store") - .index("index"); - - assert_throws_dom("DataError", function() { - index.count(NaN); - }); - - t.done(); - } -</script> -
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get.any.js b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get.any.js index 601d41d..0da228f 100644 --- a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get.any.js +++ b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get.any.js
@@ -1,32 +1,190 @@ // META: global=window,worker -// META: title=IDBIndex.get() - returns the record +// META: title=IDBIndex.get() // META: script=resources/support.js // @author Microsoft <https://www.microsoft.com> +// @author Intel <http://www.intel.com> 'use_strict'; -let db; -let index; -const t = async_test(), - record = { key: 1, indexedProperty: "data" }; +async_test(t => { + let db; + let index; + const record = { key: 1, indexedProperty: "data" }; -const open_rq = createdb(t); -open_rq.onupgradeneeded = function(e) { + const open_rq = createdb(t); + open_rq.onupgradeneeded = function(e) { db = e.target.result; const objStore = db.createObjectStore("store", { keyPath: "key" }); index = objStore.createIndex("index", "indexedProperty"); objStore.add(record); -} + }; -open_rq.onsuccess = function(e) { - const rq = db.transaction("store", "readonly", {durability: 'relaxed'}) - .objectStore("store") - .index("index") - .get(record.indexedProperty); + open_rq.onsuccess = function(e) { + const rq = db.transaction("store", "readonly", { durability: 'relaxed' }) + .objectStore("store") + .index("index") + .get(record.indexedProperty); rq.onsuccess = t.step_func(function(e) { - assert_equals(e.target.result.key, record.key); - t.done(); + assert_equals(e.target.result.key, record.key); + t.done(); }); -} + }; +}, 'get() returns the record'); + +async_test(t => { + let db; + const records = [ + { key: 1, indexedProperty: "data" }, + { key: 2, indexedProperty: "data" }, + { key: 3, indexedProperty: "data" } + ]; + + const open_rq = createdb(t); + open_rq.onupgradeneeded = function(e) { + db = e.target.result; + const objStore = db.createObjectStore("test", { keyPath: "key" }); + objStore.createIndex("index", "indexedProperty"); + + for (let i = 0; i < records.length; i++) + objStore.add(records[i]); + }; + + open_rq.onsuccess = function(e) { + const rq = db.transaction("test", "readonly", { durability: 'relaxed' }) + .objectStore("test") + .index("index") + .get("data"); + + rq.onsuccess = t.step_func(function(e) { + assert_equals(e.target.result.key, records[0].key); + t.done(); + }); + }; +}, 'get() returns the record where the index contains duplicate values'); + +async_test(t => { + let db; + + const open_rq = createdb(t); + open_rq.onupgradeneeded = function(e) { + db = e.target.result; + const rq = db.createObjectStore("test", { keyPath: "key" }) + .createIndex("index", "indexedProperty") + .get(1); + + rq.onsuccess = t.step_func(function(e) { + assert_equals(e.target.result, undefined); + t.done(); + }); + }; +}, 'get() attempts to retrieve a record that does not exist'); + +async_test(t => { + let db; + + const open_rq = createdb(t); + open_rq.onupgradeneeded = function(e) { + db = e.target.result; + const store = db.createObjectStore("store", { keyPath: "key" }); + store.createIndex("index", "indexedProperty"); + + for (let i = 0; i < 10; i++) { + store.add({ key: i, indexedProperty: "data" + i }); + } + }; + + open_rq.onsuccess = function(e) { + const rq = db.transaction("store", "readonly", { durability: 'relaxed' }) + .objectStore("store") + .index("index") + .get(IDBKeyRange.bound('data4', 'data7')); + + rq.onsuccess = t.step_func(function(e) { + assert_equals(e.target.result.key, 4); + assert_equals(e.target.result.indexedProperty, 'data4'); + + step_timeout(function () { t.done(); }, 4); + }); + }; +}, 'get() returns the record with the first key in the range'); + +async_test(t => { + let db; + const open_rq = createdb(t); + + open_rq.onupgradeneeded = function(e) { + db = e.target.result; + + const index = db.createObjectStore("test", { keyPath: "key" }) + .createIndex("index", "indexedProperty"); + + assert_throws_dom("DataError", function () { + index.get(NaN); + }); + t.done(); + }; +}, 'get() throws DataError when using invalid key'); + +async_test(t => { + let db; + const open_rq = createdb(t); + + open_rq.onupgradeneeded = function(e) { + db = e.target.result; + const store = db.createObjectStore("store", { keyPath: "key" }); + const index = store.createIndex("index", "indexedProperty"); + + store.add({ key: 1, indexedProperty: "data" }); + store.deleteIndex("index"); + + assert_throws_dom("InvalidStateError", function () { + index.get("data"); + }); + t.done(); + }; +}, 'get() throws InvalidStateError when the index is deleted'); + +async_test(t => { + let db; + const open_rq = createdb(t); + + open_rq.onupgradeneeded = function(e) { + db = e.target.result; + const store = db.createObjectStore("store", { keyPath: "key" }); + const index = store.createIndex("index", "indexedProperty"); + store.add({ key: 1, indexedProperty: "data" }); + }; + + open_rq.onsuccess = function(e) { + db = e.target.result; + const tx = db.transaction('store', 'readonly', { durability: 'relaxed' }); + const index = tx.objectStore('store').index('index'); + tx.abort(); + + assert_throws_dom("TransactionInactiveError", function () { + index.get("data"); + }); + t.done(); + }; +}, 'get() throws TransactionInactiveError on aborted transaction'); + +async_test(t => { + let db; + const open_rq = createdb(t); + + open_rq.onupgradeneeded = function(e) { + db = e.target.result; + const store = db.createObjectStore("store", { keyPath: "key" }); + const index = store.createIndex("index", "indexedProperty"); + store.add({ key: 1, indexedProperty: "data" }); + + e.target.transaction.abort(); + + assert_throws_dom("InvalidStateError", function () { + index.get("data"); + }); + t.done(); + }; +}, 'get() throws InvalidStateError on index deleted by aborted upgrade');
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get2.any.js b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get2.any.js deleted file mode 100644 index 6790a604..0000000 --- a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get2.any.js +++ /dev/null
@@ -1,34 +0,0 @@ -// META: global=window,worker -// META: title=IDBIndex.get() - returns the record where the index contains duplicate values -// META: script=resources/support.js -// @author Microsoft <https://www.microsoft.com> - -'use_strict'; - -let db; -const t = async_test(); -const records = [ { key:1, indexedProperty:"data" }, - { key:2, indexedProperty:"data" }, - { key:3, indexedProperty:"data" } ]; - -const open_rq = createdb(t); -open_rq.onupgradeneeded = function(e) { - db = e.target.result; - const objStore = db.createObjectStore("test", { keyPath: "key" }); - objStore.createIndex("index", "indexedProperty"); - - for (let i = 0; i < records.length; i++) - objStore.add(records[i]); -}; - -open_rq.onsuccess = function(e) { - const rq = db.transaction("test", "readonly", {durability: 'relaxed'}) - .objectStore("test") - .index("index") - .get("data"); - - rq.onsuccess = t.step_func(function(e) { - assert_equals(e.target.result.key, records[0].key); - t.done(); - }); -};
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get3.any.js b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get3.any.js deleted file mode 100644 index 673621b..0000000 --- a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get3.any.js +++ /dev/null
@@ -1,22 +0,0 @@ -// META: global=window,worker -// META: title=IDBIndex.get() - attempt to retrieve a record that doesn't exist -// META: script=resources/support.js -// @author Microsoft <https://www.microsoft.com> - -'use_strict'; - -let db; -const t = async_test(); - -const open_rq = createdb(t); -open_rq.onupgradeneeded = function(e) { - db = e.target.result; - const rq = db.createObjectStore("test", { keyPath: "key" }) - .createIndex("index", "indexedProperty") - .get(1); - - rq.onsuccess = t.step_func(function(e) { - assert_equals(e.target.result, undefined); - t.done(); - }); -};
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get4.any.js b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get4.any.js deleted file mode 100644 index 096a29e..0000000 --- a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get4.any.js +++ /dev/null
@@ -1,35 +0,0 @@ -// META: global=window,worker -// META: title=IDBIndex.get() - returns the record with the first key in the range -// META: script=resources/support.js -// @author Microsoft <https://www.microsoft.com> - -'use_strict'; - -let db; -const t = async_test(); - -const open_rq = createdb(t); - -open_rq.onupgradeneeded = function(e) { - db = e.target.result; - const store = db.createObjectStore("store", { keyPath: "key" }); - store.createIndex("index", "indexedProperty"); - - for(let i = 0; i < 10; i++) { - store.add({ key: i, indexedProperty: "data" + i }); - } -} - -open_rq.onsuccess = function(e) { - const rq = db.transaction("store", "readonly", {durability: 'relaxed'}) - .objectStore("store") - .index("index") - .get(IDBKeyRange.bound('data4', 'data7')); - - rq.onsuccess = t.step_func(function(e) { - assert_equals(e.target.result.key, 4); - assert_equals(e.target.result.indexedProperty, 'data4'); - - step_timeout(function() { t.done(); }, 4); - }); -}
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get5.any.js b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get5.any.js deleted file mode 100644 index d99dfdc3..0000000 --- a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get5.any.js +++ /dev/null
@@ -1,21 +0,0 @@ -// META: global=window,worker -// META: title=IDBIndex.get() - throw DataError when using invalid key -// META: script=resources/support.js -// @author Intel <http://www.intel.com> - -'use_strict'; - -let db; -const t = async_test(); - -const open_rq = createdb(t); -open_rq.onupgradeneeded = function(e) { - db = e.target.result; - - const index = db.createObjectStore("test", { keyPath: "key" }) - .createIndex("index", "indexedProperty"); - assert_throws_dom("DataError",function(){ - index.get(NaN); - }); - t.done(); -};
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get6.any.js b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get6.any.js deleted file mode 100644 index 8cbbe160..0000000 --- a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get6.any.js +++ /dev/null
@@ -1,24 +0,0 @@ -// META: global=window,worker -// META: title=IDBIndex.get() - throw InvalidStateError when the index is deleted -// META: script=resources/support.js -// @author Intel <http://www.intel.com> - -'use_strict'; - -let db; -const t = async_test(); - -const open_rq = createdb(t); -open_rq.onupgradeneeded = function(e) { - db = e.target.result; - const store = db.createObjectStore("store", { keyPath: "key" }); - const index = store.createIndex("index", "indexedProperty"); - - store.add({ key: 1, indexedProperty: "data" }); - store.deleteIndex("index"); - - assert_throws_dom("InvalidStateError", function(){ - index.get("data"); - }); - t.done(); -}
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get7.any.js b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get7.any.js deleted file mode 100644 index 35c8cc8..0000000 --- a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get7.any.js +++ /dev/null
@@ -1,28 +0,0 @@ -// META: global=window,worker -// META: title=IDBIndex.get() - throw TransactionInactiveError on aborted transaction -// META: script=resources/support.js -// @author Intel <http://www.intel.com> - -'use_strict'; - -let db; -const t = async_test(); - -const open_rq = createdb(t); -open_rq.onupgradeneeded = function(e) { - db = e.target.result; - const store = db.createObjectStore("store", { keyPath: "key" }); - const index = store.createIndex("index", "indexedProperty"); - store.add({ key: 1, indexedProperty: "data" }); -} -open_rq.onsuccess = function(e) { - db = e.target.result; - const tx = db.transaction('store', 'readonly', {durability: 'relaxed'}); - const index = tx.objectStore('store').index('index'); - tx.abort(); - - assert_throws_dom("TransactionInactiveError", function(){ - index.get("data"); - }); - t.done(); -}
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get8.any.js b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get8.any.js deleted file mode 100644 index d6183c1..0000000 --- a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_get8.any.js +++ /dev/null
@@ -1,23 +0,0 @@ -// META: global=window,worker -// META: title=IDBIndex.get() - throw InvalidStateError on index deleted by aborted upgrade -// META: script=resources/support.js - -'use_strict'; - -let db; -const t = async_test(); - -const open_rq = createdb(t); -open_rq.onupgradeneeded = function(e) { - db = e.target.result; - const store = db.createObjectStore("store", { keyPath: "key" }); - const index = store.createIndex("index", "indexedProperty"); - store.add({ key: 1, indexedProperty: "data" }); - - e.target.transaction.abort(); - - assert_throws_dom("InvalidStateError", function(){ - index.get("data"); - }); - t.done(); -}
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getAll.html b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getAll.any.js similarity index 77% rename from third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getAll.html rename to third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getAll.any.js index bd2a021..36b4c02 100644 --- a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getAll.html +++ b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getAll.any.js
@@ -1,18 +1,18 @@ -<!DOCTYPE html> -<title>IndexedDB: Test IDBIndex.getAll.</title> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="resources/support.js"></script> -<script> -var alphabet = 'abcdefghijklmnopqrstuvwxyz'.split(''); -var ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''); +// META: global=window,worker +// META: title=IndexedDB: Test IDBIndex.getAll +// META: script=resources/support.js + +'use_strict'; + +const alphabet = 'abcdefghijklmnopqrstuvwxyz'.split(''); +const ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''); function getall_test(func, name) { indexeddb_test( function(t, connection, tx) { - var store = connection.createObjectStore('generated', + let store = connection.createObjectStore('generated', {autoIncrement: true, keyPath: 'id'}); - var index = store.createIndex('test_idx', 'upper'); + let index = store.createIndex('test_idx', 'upper'); alphabet.forEach(function(letter) { store.put({ch: letter, upper: letter.toUpperCase()}); }); @@ -56,18 +56,18 @@ } function createGetAllRequest(t, storeName, connection, range, maxCount) { - var transaction = connection.transaction(storeName, 'readonly'); - var store = transaction.objectStore(storeName); - var index = store.index('test_idx'); - var req = index.getAll(range, maxCount); + const transaction = connection.transaction(storeName, 'readonly'); + const store = transaction.objectStore(storeName); + const index = store.index('test_idx'); + const req = index.getAll(range, maxCount); req.onerror = t.unreached_func('getAll request should succeed'); return req; } getall_test(function(t, connection) { - var req = createGetAllRequest(t, 'out-of-line', connection, 'C'); + const req = createGetAllRequest(t, 'out-of-line', connection, 'C'); req.onsuccess = t.step_func(function(evt) { - var data = evt.target.result; + const data = evt.target.result; assert_class_string(data, 'Array', 'result should be an array'); assert_array_equals(data.map(function(e) { return e.ch; }), ['c']); assert_array_equals(data.map(function(e) { return e.upper; }), ['C']); @@ -76,7 +76,7 @@ }, 'Single item get'); getall_test(function(t, connection) { - var req = createGetAllRequest(t, 'empty', connection); + const req = createGetAllRequest(t, 'empty', connection); req.onsuccess = t.step_func(function(evt) { assert_array_equals(evt.target.result, [], 'getAll() on empty object store should return an empty array'); @@ -85,9 +85,9 @@ }, 'Empty object store'); getall_test(function(t, connection) { - var req = createGetAllRequest(t, 'out-of-line', connection); + const req = createGetAllRequest(t, 'out-of-line', connection); req.onsuccess = t.step_func(function(evt) { - var data = evt.target.result; + const data = evt.target.result; assert_class_string(data, 'Array', 'result should be an array'); assert_array_equals(data.map(function(e) { return e.ch; }), alphabet); assert_array_equals(data.map(function(e) { return e.upper; }), ALPHABET); @@ -96,10 +96,10 @@ }, 'Get all keys'); getall_test(function(t, connection) { - var req = createGetAllRequest(t, 'out-of-line', connection, undefined, + const req = createGetAllRequest(t, 'out-of-line', connection, undefined, 10); req.onsuccess = t.step_func(function(evt) { - var data = evt.target.result; + const data = evt.target.result; assert_class_string(data, 'Array', 'result should be an array'); assert_array_equals(data.map(function(e) { return e.ch; }), 'abcdefghij'.split('')); assert_array_equals(data.map(function(e) { return e.upper; }), 'ABCDEFGHIJ'.split('')); @@ -108,10 +108,10 @@ }, 'maxCount=10'); getall_test(function(t, connection) { - var req = createGetAllRequest(t, 'out-of-line', connection, + const req = createGetAllRequest(t, 'out-of-line', connection, IDBKeyRange.bound('G', 'M')); req.onsuccess = t.step_func(function(evt) { - var data = evt.target.result; + const data = evt.target.result; assert_array_equals(data.map(function(e) { return e.ch; }), 'ghijklm'.split('')); assert_array_equals(data.map(function(e) { return e.upper; }), 'GHIJKLM'.split('')); t.done(); @@ -119,10 +119,10 @@ }, 'Get bound range'); getall_test(function(t, connection) { - var req = createGetAllRequest(t, 'out-of-line', connection, + const req = createGetAllRequest(t, 'out-of-line', connection, IDBKeyRange.bound('G', 'M'), 3); req.onsuccess = t.step_func(function(evt) { - var data = evt.target.result; + const data = evt.target.result; assert_class_string(data, 'Array', 'result should be an array'); assert_array_equals(data.map(function(e) { return e.ch; }), 'ghi'.split('')); assert_array_equals(data.map(function(e) { return e.upper; }), 'GHI'.split('')); @@ -131,10 +131,10 @@ }, 'Get bound range with maxCount'); getall_test(function(t, connection) { - var req = createGetAllRequest(t, 'out-of-line', connection, + const req = createGetAllRequest(t, 'out-of-line', connection, IDBKeyRange.bound('G', 'K', false, true)); req.onsuccess = t.step_func(function(evt) { - var data = evt.target.result; + const data = evt.target.result; assert_class_string(data, 'Array', 'result should be an array'); assert_array_equals(data.map(function(e) { return e.ch; }), 'ghij'.split('')); assert_array_equals(data.map(function(e) { return e.upper; }), 'GHIJ'.split('')); @@ -143,10 +143,10 @@ }, 'Get upper excluded'); getall_test(function(t, connection) { - var req = createGetAllRequest(t, 'out-of-line', connection, + const req = createGetAllRequest(t, 'out-of-line', connection, IDBKeyRange.bound('G', 'K', true, false)); req.onsuccess = t.step_func(function(evt) { - var data = evt.target.result; + const data = evt.target.result; assert_class_string(data, 'Array', 'result should be an array'); assert_array_equals(data.map(function(e) { return e.ch; }), 'hijk'.split('')); assert_array_equals(data.map(function(e) { return e.upper; }), 'HIJK'.split('')); @@ -155,10 +155,10 @@ }, 'Get lower excluded'); getall_test(function(t, connection) { - var req = createGetAllRequest(t, 'generated', + const req = createGetAllRequest(t, 'generated', connection, IDBKeyRange.bound(4, 15), 3); req.onsuccess = t.step_func(function(evt) { - var data = evt.target.result; + const data = evt.target.result; assert_true(Array.isArray(data)); assert_equals(data.length, 0); t.done(); @@ -166,7 +166,7 @@ }, 'Get bound range (generated) with maxCount'); getall_test(function(t, connection) { - var req = createGetAllRequest(t, 'out-of-line', + const req = createGetAllRequest(t, 'out-of-line', connection, "Doesn't exist"); req.onsuccess = t.step_func(function(evt) { assert_array_equals(evt.target.result, [], @@ -177,10 +177,10 @@ }, 'Non existent key'); getall_test(function(t, connection) { - var req = createGetAllRequest(t, 'out-of-line', connection, + const req = createGetAllRequest(t, 'out-of-line', connection, undefined, 0); req.onsuccess = t.step_func(function(evt) { - var data = evt.target.result; + const data = evt.target.result; assert_class_string(data, 'Array', 'result should be an array'); assert_array_equals(data.map(function(e) { return e.ch; }), alphabet); assert_array_equals(data.map(function(e) { return e.upper; }), ALPHABET); @@ -189,10 +189,10 @@ }, 'maxCount=0'); getall_test(function(t, connection) { - var req = createGetAllRequest(t, 'out-of-line-not-unique', connection, + const req = createGetAllRequest(t, 'out-of-line-not-unique', connection, 'first'); req.onsuccess = t.step_func(function(evt) { - var data = evt.target.result; + const data = evt.target.result; assert_class_string(data, 'Array', 'result should be an array'); assert_array_equals(data.map(function(e) { return e.ch; }), 'abcdefghijklm'.split('')); assert_true(data.every(function(e) { return e.half === 'first'; })); @@ -201,10 +201,10 @@ }, 'Retrieve multiEntry key'); getall_test(function(t, connection) { - var req = createGetAllRequest(t, 'out-of-line-multi', connection, + const req = createGetAllRequest(t, 'out-of-line-multi', connection, 'vowel'); req.onsuccess = t.step_func(function(evt) { - var data = evt.target.result; + const data = evt.target.result; assert_class_string(data, 'Array', 'result should be an array'); assert_array_equals(data.map(function(e) { return e.ch; }), ['a', 'e', 'i', 'o', 'u']); assert_array_equals(data[0].attribs, ['vowel', 'first']); @@ -212,5 +212,3 @@ t.done(); }); }, 'Retrieve one key multiple values'); - -</script>
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getAllKeys.html b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getAllKeys.any.js similarity index 78% rename from third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getAllKeys.html rename to third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getAllKeys.any.js index 5640bfde..92f3cc1 100644 --- a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getAllKeys.html +++ b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getAllKeys.any.js
@@ -1,18 +1,17 @@ -<!DOCTYPE html> -<title>IndexedDB: Test IDBIndex.getAllKeys.</title> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="resources/support.js"></script> -<script> +// META: global=window,worker +// META: title=IndexedDB: Test IDBIndex.getAllKeys. +// META: script=resources/support.js -var alphabet = 'abcdefghijklmnopqrstuvwxyz'.split(''); +'use_strict'; + +const alphabet = 'abcdefghijklmnopqrstuvwxyz'.split(''); function getall_test(func, name) { indexeddb_test( function(t, connection, tx) { - var store = connection.createObjectStore('generated', + let store = connection.createObjectStore('generated', {autoIncrement: true, keyPath: 'id'}); - var index = store.createIndex('test_idx', 'upper'); + let index = store.createIndex('test_idx', 'upper'); alphabet.forEach(function(letter) { store.put({ch: letter, upper: letter.toUpperCase()}); }); @@ -47,25 +46,25 @@ } function createGetAllKeysRequest(t, storeName, connection, range, maxCount) { - var transaction = connection.transaction(storeName, 'readonly'); - var store = transaction.objectStore(storeName); - var index = store.index('test_idx'); - var req = index.getAllKeys(range, maxCount); + const transaction = connection.transaction(storeName, 'readonly'); + const store = transaction.objectStore(storeName); + const index = store.index('test_idx'); + const req = index.getAllKeys(range, maxCount); req.onerror = t.unreached_func('getAllKeys request should succeed'); return req; } getall_test(function(t, connection) { - var req = createGetAllKeysRequest(t, 'out-of-line', connection, 'C'); + const req = createGetAllKeysRequest(t, 'out-of-line', connection, 'C'); req.onsuccess = t.step_func(function(evt) { - var data = evt.target.result; + const data = evt.target.result; assert_array_equals(evt.target.result, ['c']); t.done(); }); }, 'Single item get'); getall_test(function(t, connection) { - var req = createGetAllKeysRequest(t, 'empty', connection); + const req = createGetAllKeysRequest(t, 'empty', connection); req.onsuccess = t.step_func(function(evt) { assert_array_equals(evt.target.result, [], 'getAllKeys() on empty object store should return empty array'); @@ -74,7 +73,7 @@ }, 'Empty object store'); getall_test(function(t, connection) { - var req = createGetAllKeysRequest(t, 'out-of-line', connection); + const req = createGetAllKeysRequest(t, 'out-of-line', connection); req.onsuccess = t.step_func(function(evt) { assert_array_equals(evt.target.result, alphabet, 'getAllKeys() should return a..z'); @@ -83,7 +82,7 @@ }, 'Get all keys'); getall_test(function(t, connection) { - var req = createGetAllKeysRequest(t, 'generated', connection); + const req = createGetAllKeysRequest(t, 'generated', connection); req.onsuccess = t.step_func(function(evt) { assert_array_equals(evt.target.result, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, @@ -94,7 +93,7 @@ }, 'Get all generated keys'); getall_test(function(t, connection) { - var req = createGetAllKeysRequest(t, 'out-of-line', connection, undefined, + const req = createGetAllKeysRequest(t, 'out-of-line', connection, undefined, 10); req.onsuccess = t.step_func(function(evt) { assert_array_equals(evt.target.result, @@ -105,7 +104,7 @@ }, 'maxCount=10'); getall_test(function(t, connection) { - var req = createGetAllKeysRequest(t, 'out-of-line', connection, + const req = createGetAllKeysRequest(t, 'out-of-line', connection, IDBKeyRange.bound('G', 'M')); req.onsuccess = t.step_func(function(evt) { assert_array_equals(evt.target.result, @@ -116,7 +115,7 @@ }, 'Get bound range'); getall_test(function(t, connection) { - var req = createGetAllKeysRequest(t, 'out-of-line', connection, + const req = createGetAllKeysRequest(t, 'out-of-line', connection, IDBKeyRange.bound('G', 'M'), 3); req.onsuccess = t.step_func(function(evt) { assert_array_equals(evt.target.result, @@ -127,7 +126,7 @@ }, 'Get bound range with maxCount'); getall_test(function(t, connection) { - var req = createGetAllKeysRequest(t, 'out-of-line', connection, + const req = createGetAllKeysRequest(t, 'out-of-line', connection, IDBKeyRange.bound('G', 'K', false, true)); req.onsuccess = t.step_func(function(evt) { assert_array_equals(evt.target.result, @@ -138,7 +137,7 @@ }, 'Get upper excluded'); getall_test(function(t, connection) { - var req = createGetAllKeysRequest(t, 'out-of-line', connection, + const req = createGetAllKeysRequest(t, 'out-of-line', connection, IDBKeyRange.bound('G', 'K', true, false)); req.onsuccess = t.step_func(function(evt) { assert_array_equals(evt.target.result, @@ -149,7 +148,7 @@ }, 'Get lower excluded'); getall_test(function(t, connection) { - var req = createGetAllKeysRequest(t, 'generated', + const req = createGetAllKeysRequest(t, 'generated', connection, IDBKeyRange.bound(4, 15), 3); req.onsuccess = t.step_func(function(evt) { assert_array_equals(evt.target.result, [], @@ -159,7 +158,7 @@ }, 'Get bound range (generated) with maxCount'); getall_test(function(t, connection) { - var req = createGetAllKeysRequest(t, 'out-of-line', + const req = createGetAllKeysRequest(t, 'out-of-line', connection, "Doesn't exist"); req.onsuccess = t.step_func(function(evt) { assert_array_equals(evt.target.result, [], @@ -170,7 +169,7 @@ }, 'Non existent key'); getall_test(function(t, connection) { - var req = createGetAllKeysRequest(t, 'out-of-line', connection, + const req = createGetAllKeysRequest(t, 'out-of-line', connection, undefined, 0); req.onsuccess = t.step_func(function(evt) { assert_array_equals(evt.target.result, alphabet, @@ -180,7 +179,7 @@ }, 'maxCount=0'); getall_test(function(t, connection) { - var req = createGetAllKeysRequest(t, 'out-of-line-multi', connection, + const req = createGetAllKeysRequest(t, 'out-of-line-multi', connection, 'vowel'); req.onsuccess = t.step_func(function(evt) { assert_array_equals(evt.target.result, ['A','E','I','O','U']) @@ -188,5 +187,3 @@ }); req.onerror = t.unreached_func('getAllKeys request should succeed'); }, 'Retrieve multiEntry keys'); - -</script>
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey.any.js b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey.any.js new file mode 100644 index 0000000..677a70e7 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey.any.js
@@ -0,0 +1,191 @@ +// META: global=window,worker +// META: title=IDBIndex.getKey() +// META: script=resources/support.js +// @author Microsoft <https://www.microsoft.com> +// @author Intel <http://www.intel.com> + +'use_strict'; + +async_test(t => { + let db; + const record = { key: 1, indexedProperty: "data" }; + + const open_rq = createdb(t); + open_rq.onupgradeneeded = function(e) { + db = e.target.result; + const objStore = db.createObjectStore("test", { keyPath: "key" }); + objStore.createIndex("index", "indexedProperty"); + + objStore.add(record); + }; + + open_rq.onsuccess = function(e) { + let rq = db.transaction("test", "readonly", { durability: 'relaxed' }) + .objectStore("test"); + + rq = rq.index("index"); + + rq = rq.getKey("data"); + + rq.onsuccess = t.step_func(function(e) { + assert_equals(e.target.result, record.key); + t.done(); + }); + }; +}, 'getKey() returns the record\'s primary key'); + +async_test(t => { + let db; + const records = [ + { key: 1, indexedProperty: "data" }, + { key: 2, indexedProperty: "data" }, + { key: 3, indexedProperty: "data" } + ]; + + const open_rq = createdb(t); + open_rq.onupgradeneeded = function(e) { + db = e.target.result; + var objStore = db.createObjectStore("test", { keyPath: "key" }); + objStore.createIndex("index", "indexedProperty"); + + for (let i = 0; i < records.length; i++) + objStore.add(records[i]); + }; + + open_rq.onsuccess = function(e) { + const rq = db.transaction("test", "readonly", { durability: 'relaxed' }) + .objectStore("test") + .index("index") + .getKey("data"); + + rq.onsuccess = t.step_func(function(e) { + assert_equals(e.target.result, records[0].key); + t.done(); + }); + }; +}, 'getKey() returns the record\'s primary key where the index contains duplicate values'); + +async_test(t => { + let db; + const open_rq = createdb(t); + + open_rq.onupgradeneeded = function(e) { + db = e.target.result; + const rq = db.createObjectStore("test", { keyPath: "key" }) + .createIndex("index", "indexedProperty") + .getKey(1); + + rq.onsuccess = t.step_func(function(e) { + assert_equals(e.target.result, undefined); + t.done(); + }); + }; +}, 'getKey() attempt to retrieve the primary key of a record that doesn\'t exist'); + +async_test(t => { + let db; + + const open_rq = createdb(t); + + open_rq.onupgradeneeded = function(e) { + db = e.target.result; + const store = db.createObjectStore("store", { keyPath: "key" }); + store.createIndex("index", "indexedProperty"); + + for (let i = 0; i < 10; i++) { + store.add({ key: i, indexedProperty: "data" + i }); + } + }; + + open_rq.onsuccess = function(e) { + const rq = db.transaction("store", "readonly", { durability: 'relaxed' }) + .objectStore("store") + .index("index") + .getKey(IDBKeyRange.bound('data4', 'data7')); + + rq.onsuccess = t.step_func(function(e) { + assert_equals(e.target.result, 4); + + step_timeout(function () { t.done(); }, 4) + }); + }; +}, 'getKey() returns the key of the first record within the range'); + +async_test(t => { + let db; + const open_rq = createdb(t); + + open_rq.onupgradeneeded = function(e) { + db = e.target.result; + + const index = db.createObjectStore("test", { keyPath: "key" }) + .createIndex("index", "indexedProperty"); + + assert_throws_dom("DataError", function () { + index.getKey(NaN); + }); + t.done(); + }; +}, 'getKey() throws DataError when using invalid key'); + +async_test(t => { + let db; + const open_rq = createdb(t); + + open_rq.onupgradeneeded = function(e) { + db = e.target.result; + const store = db.createObjectStore("store", { keyPath: "key" }); + const index = store.createIndex("index", "indexedProperty"); + + store.add({ key: 1, indexedProperty: "data" }); + store.deleteIndex("index"); + + assert_throws_dom("InvalidStateError", function () { + index.getKey("data"); + }); + t.done(); + }; +}, 'getKey() throws InvalidStateError when the index is deleted'); + +async_test(t => { + let db; + + const open_rq = createdb(t); + open_rq.onupgradeneeded = function(e) { + db = e.target.result; + const store = db.createObjectStore("store", { keyPath: "key" }); + const index = store.createIndex("index", "indexedProperty"); + store.add({ key: 1, indexedProperty: "data" }); + }; + + open_rq.onsuccess = function(e) { + db = e.target.result; + const tx = db.transaction('store', 'readonly', { durability: 'relaxed' }); + const index = tx.objectStore('store').index('index'); + tx.abort(); + + assert_throws_dom("TransactionInactiveError", function () { + index.getKey("data"); + }); + t.done(); + }; +}, 'getKey() throws TransactionInactiveError on aborted transaction'); + +async_test(t => { + let db; + + const open_rq = createdb(t); + open_rq.onupgradeneeded = function(e) { + db = e.target.result; + const store = db.createObjectStore("store", { keyPath: "key" }); + const index = store.createIndex("index", "indexedProperty"); + store.add({ key: 1, indexedProperty: "data" }); + + e.target.transaction.abort(); + + assert_throws_dom("InvalidStateError", function () { + index.getKey("data"); + }); + t.done(); + }; +}, 'getKey() throws InvalidStateError on index deleted by aborted upgrade');
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey.htm b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey.htm deleted file mode 100644 index 101e8f06..0000000 --- a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>IDBIndex.getKey() - returns the record's primary key </title> -<link rel="author" title="Microsoft" href="http://www.microsoft.com"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="resources/support.js"></script> - -<script> - var db, - t = async_test(), - record = { key:1, indexedProperty:"data" }; - - var open_rq = createdb(t); - open_rq.onupgradeneeded = function(e) { - db = e.target.result; - var objStore = db.createObjectStore("test", { keyPath: "key" }); - objStore.createIndex("index", "indexedProperty"); - - objStore.add(record); - }; - - open_rq.onsuccess = function(e) { - var rq = db.transaction("test", "readonly", {durability: 'relaxed'}) - .objectStore("test"); - - rq = rq.index("index"); - - rq = rq.getKey("data"); - - rq.onsuccess = t.step_func(function(e) { - assert_equals(e.target.result, record.key); - t.done(); - }); - }; -</script> - -<div id="log"></div>
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey2.htm b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey2.htm deleted file mode 100644 index 488368d..0000000 --- a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey2.htm +++ /dev/null
@@ -1,39 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>IDBIndex.getKey() - returns the record's primary key where the index contains duplicate values </title> -<link rel="author" title="Microsoft" href="http://www.microsoft.com"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="resources/support.js"></script> - -<script> - var db, - t = async_test(), - records = [ { key:1, indexedProperty:"data" }, - { key:2, indexedProperty:"data" }, - { key:3, indexedProperty:"data" } ]; - - var open_rq = createdb(t); - open_rq.onupgradeneeded = function(e) { - db = e.target.result; - var objStore = db.createObjectStore("test", { keyPath: "key" }); - objStore.createIndex("index", "indexedProperty"); - - for (var i = 0; i < records.length; i++) - objStore.add(records[i]); - }; - - open_rq.onsuccess = function(e) { - var rq = db.transaction("test", "readonly", {durability: 'relaxed'}) - .objectStore("test") - .index("index") - .getKey("data"); - - rq.onsuccess = t.step_func(function(e) { - assert_equals(e.target.result, records[0].key); - t.done(); - }); - }; -</script> - -<div id="log"></div>
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey3.htm b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey3.htm deleted file mode 100644 index 40ed76d..0000000 --- a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey3.htm +++ /dev/null
@@ -1,28 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>IDBIndex.getKey() - attempt to retrieve the primary key of a record that doesn't exist</title> -<link rel="author" title="Microsoft" href="http://www.microsoft.com"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="resources/support.js"></script> - -<script> - var db, - t = async_test(); - - - var open_rq = createdb(t); - open_rq.onupgradeneeded = function(e) { - db = e.target.result; - var rq = db.createObjectStore("test", { keyPath: "key" }) - .createIndex("index", "indexedProperty") - .getKey(1); - - rq.onsuccess = t.step_func(function(e) { - assert_equals(e.target.result, undefined); - t.done(); - }); - }; -</script> - -<div id="log"></div>
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey4.htm b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey4.htm deleted file mode 100644 index 8c81a27..0000000 --- a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey4.htm +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html> -<meta charset=utf-8> -<title>IDBIndex.getKey() - returns the key of the first record within the range </title> -<link rel="author" title="Microsoft" href="http://www.microsoft.com"> -<script src=/resources/testharness.js></script> -<script src=/resources/testharnessreport.js></script> -<script src=resources/support.js></script> - -<script> - var db, t = async_test(); - - var open_rq = createdb(t); - - open_rq.onupgradeneeded = function(e) { - db = e.target.result; - var store = db.createObjectStore("store", { keyPath: "key" }); - store.createIndex("index", "indexedProperty"); - - for(var i = 0; i < 10; i++) { - store.add({ key: i, indexedProperty: "data" + i }); - } - } - - open_rq.onsuccess = function(e) { - var rq = db.transaction("store", "readonly", {durability: 'relaxed'}) - .objectStore("store") - .index("index") - .getKey(IDBKeyRange.bound('data4', 'data7')); - - rq.onsuccess = t.step_func(function(e) { - assert_equals(e.target.result, 4); - - step_timeout(function() { t.done(); }, 4) - }); - } -</script> - -<div id=log></div>
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey5.htm b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey5.htm deleted file mode 100644 index 31551313..0000000 --- a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey5.htm +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>IDBIndex.getKey() - throw DataError when using invalid key </title> -<link rel="author" title="Intel" href="http://www.intel.com"> -<link rel="help" href="https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#widl-IDBIndex-getKey-IDBRequest-any-key"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="resources/support.js"></script> -<div id="log"></div> -<script> - var db, - t = async_test(); - - var open_rq = createdb(t); - open_rq.onupgradeneeded = function(e) { - db = e.target.result; - - var index = db.createObjectStore("test", { keyPath: "key" }) - .createIndex("index", "indexedProperty"); - assert_throws_dom("DataError",function(){ - index.getKey(NaN); - }); - t.done(); - }; -</script> -
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey6.htm b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey6.htm deleted file mode 100644 index b71967d4..0000000 --- a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey6.htm +++ /dev/null
@@ -1,29 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>IDBIndex.getKey() - throw InvalidStateError when the index is deleted</title> -<link rel="author" title="Intel" href="http://www.intel.com"> -<link rel="help" href="https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#widl-IDBIndex-getKey-IDBRequest-any-key"> -<script src=/resources/testharness.js></script> -<script src=/resources/testharnessreport.js></script> -<script src=resources/support.js></script> -<div id="log"></div> -<script> - var db, - t = async_test(); - - var open_rq = createdb(t); - open_rq.onupgradeneeded = function(e) { - db = e.target.result; - var store = db.createObjectStore("store", { keyPath: "key" }); - var index = store.createIndex("index", "indexedProperty"); - - store.add({ key: 1, indexedProperty: "data" }); - store.deleteIndex("index"); - - assert_throws_dom("InvalidStateError", function(){ - index.getKey("data"); - }); - t.done(); - } -</script> -
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey7.htm b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey7.htm deleted file mode 100644 index 6a64df3..0000000 --- a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey7.htm +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>IDBIndex.getKey() - throw TransactionInactiveError on aborted transaction</title> -<link rel="author" title="Intel" href="http://www.intel.com"> -<link rel="help" href="https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#widl-IDBIndex-getKey-IDBRequest-any-key"> -<script src=/resources/testharness.js></script> -<script src=/resources/testharnessreport.js></script> -<script src=resources/support.js></script> -<div id="log"></div> -<script> - var db, - t = async_test(); - - var open_rq = createdb(t); - open_rq.onupgradeneeded = function(e) { - db = e.target.result; - var store = db.createObjectStore("store", { keyPath: "key" }); - var index = store.createIndex("index", "indexedProperty"); - store.add({ key: 1, indexedProperty: "data" }); - } - open_rq.onsuccess = function(e) { - db = e.target.result; - var tx = db.transaction('store', 'readonly', {durability: 'relaxed'}); - var index = tx.objectStore('store').index('index'); - tx.abort(); - - assert_throws_dom("TransactionInactiveError", function(){ - index.getKey("data"); - }); - t.done(); - } -</script>
diff --git a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey8.htm b/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey8.htm deleted file mode 100644 index cf0affb2..0000000 --- a/third_party/blink/web_tests/external/wpt/IndexedDB/idbindex_getKey8.htm +++ /dev/null
@@ -1,27 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>IDBIndex.getKey() - throw InvalidStateError on index deleted by aborted upgrade</title> -<link rel="help" href="https://w3c.github.io/IndexedDB/#dom-idbindex-getkey"> -<script src=/resources/testharness.js></script> -<script src=/resources/testharnessreport.js></script> -<script src=resources/support.js></script> -<div id="log"></div> -<script> - var db, - t = async_test(); - - var open_rq = createdb(t); - open_rq.onupgradeneeded = function(e) { - db = e.target.result; - var store = db.createObjectStore("store", { keyPath: "key" }); - var index = store.createIndex("index", "indexedProperty"); - store.add({ key: 1, indexedProperty: "data" }); - - e.target.transaction.abort(); - - assert_throws_dom("InvalidStateError", function(){ - index.getKey("data"); - }); - t.done(); - } -</script>
diff --git a/third_party/blink/web_tests/external/wpt/audio-output/selectAudioOutput-permissions-policy.https.sub-expected.txt b/third_party/blink/web_tests/external/wpt/audio-output/selectAudioOutput-permissions-policy.https.sub-expected.txt new file mode 100644 index 0000000..5db2dd6 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/audio-output/selectAudioOutput-permissions-policy.https.sub-expected.txt
@@ -0,0 +1,13 @@ +This is a testharness.js-based test. +[FAIL] Default "speaker-selection" permissions policy ["self"] allows the top-level document. + promise_test: Unhandled rejection with value: object "TypeError: navigator.mediaDevices.selectAudioOutput is not a function" +[FAIL] Default "speaker-selection" permissions policy ["self"] allows same-origin iframes. + assert_equals: navigator.mediaDevices.selectAudioOutput is not a function. expected "#OK" but got "TypeError" +[FAIL] Default "speaker-selection" permissions policy ["self"] disallows cross-origin iframes. + assert_equals: navigator.mediaDevices.selectAudioOutput is not a function. expected "NotAllowedError" but got "TypeError" +[FAIL] permissions policy "speaker-selection" can be enabled in cross-origin iframes using "allow" attribute. + assert_equals: navigator.mediaDevices.selectAudioOutput is not a function. expected "#OK" but got "TypeError" +[FAIL] permissions policy "speaker-selection" can be disabled in same-origin iframes using "allow" attribute. + assert_equals: navigator.mediaDevices.selectAudioOutput is not a function. expected "NotAllowedError" but got "TypeError" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/inheritance.html b/third_party/blink/web_tests/external/wpt/css/css-text/inheritance.html index 2043afe9..f41a5ed 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/inheritance.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/inheritance.html
@@ -3,7 +3,7 @@ <head> <meta charset="utf-8"> <title>Inheritance of CSS Text properties</title> -<link rel="help" href="https://drafts.csswg.org/css-text/#property-index"> +<link rel="help" href="https://www.w3.org/TR/css-text/#property-index"> <meta name="assert" content="Properties inherit according to the spec."> <meta name="assert" content="Properties have initial values according to the spec."> <script src="/resources/testharness.js"></script> @@ -17,7 +17,7 @@ <script> assert_inherited('hanging-punctuation', 'none', 'first last'); assert_inherited('hyphens', 'manual', 'none'); -assert_inherited('letter-spacing', 'normal', '10px'); +assert_inherited('letter-spacing', 'normal', '10px', '10%'); assert_inherited('line-break', 'auto', 'strict'); assert_inherited('overflow-wrap', 'normal', 'break-word'); assert_inherited('tab-size', '8', '10px'); @@ -33,7 +33,7 @@ assert_inherited('white-space', 'normal', 'pre-wrap'); assert_inherited('white-space-collapse', 'collapse', 'preserve'); assert_inherited('word-break', 'normal', 'break-all'); -assert_inherited('word-spacing', '0px', '10px'); +assert_inherited('word-spacing', '0px', '10px', '10%'); assert_inherited('word-wrap', 'normal', 'break-word'); </script> </body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/letter-spacing/letter-spacing-percent-001.html b/third_party/blink/web_tests/external/wpt/css/css-text/letter-spacing/letter-spacing-percent-001.html new file mode 100644 index 0000000..522320de --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/letter-spacing/letter-spacing-percent-001.html
@@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html lang="en" > +<meta charset="utf-8"> +<title>letter-spacing as percentages</title> +<link rel='author' title='Elika J. Etemad' href='http://fantasai.inkedblade.net/contact'> +<link rel='help' href='https://www.w3.org/TR/css-text-4/#letter-spacing'> +<link rel='match' href='reference/letter-spacing-percent-001-ref.html'> +<meta name="assert" content="Percentage values of letter-spacing are relative to the current font-size."> +<style type='text/css'> + div { font-size: 20px; line-height: 1; color: blue; } + small { font-size: 50%; } +</style> + +<p>Test passes if the pattern is identical on all four lines. + +<div style="letter-spacing: 0.1em">ABC123().*$いろはx x x፡x་x + <small style="letter-spacing: .1em">ABC123().*$いろはx x x፡x་x</small></div> +<div style="letter-spacing: 10%">ABC123().*$いろはx x x፡x་x + <small>ABC123().*$いろはx x x፡x་x</small></div> +<div style="letter-spacing: calc(0.05em + 5%)">ABC123().*$いろはx x x፡x་x + <small style="letter-spacing: calc(0.05em + 5%)">ABC123().*$いろはx x x፡x་x</small></div> +<div style="letter-spacing: 10%; font-size: 0.1em"><div style="font-size: 20px">ABC123().*$いろはx x x፡x་x + <small>ABC123().*$いろはx x x፡x་x</small></div></div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/letter-spacing/reference/letter-spacing-percent-001-ref.html b/third_party/blink/web_tests/external/wpt/css/css-text/letter-spacing/reference/letter-spacing-percent-001-ref.html new file mode 100644 index 0000000..1025ecb --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/letter-spacing/reference/letter-spacing-percent-001-ref.html
@@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html lang="en" > +<meta charset="utf-8"> +<title>letter-spacing as percentages</title> +<style type='text/css'> + div { font-size: 20px; line-height: 1; color: blue; } + small { font-size: 50%; } +</style> + +<p>Test passes if the pattern is identical on all four lines. + +<div style="letter-spacing: 0.1em">ABC123().*$いろはx x x፡x་x + <small style="letter-spacing: 0.1em">ABC123().*$いろはx x x፡x་x</small></div> +<div style="letter-spacing: 0.1em">ABC123().*$いろはx x x፡x་x + <small style="letter-spacing: 0.1em">ABC123().*$いろはx x x፡x་x</small></div> +<div style="letter-spacing: 0.1em">ABC123().*$いろはx x x፡x་x + <small style="letter-spacing: 0.1em">ABC123().*$いろはx x x፡x་x</small></div> +<div style="letter-spacing: 0.1em">ABC123().*$いろはx x x፡x་x + <small style="letter-spacing: 0.1em">ABC123().*$いろはx x x፡x་x</small></div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/letter-spacing-computed-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/letter-spacing-computed-expected.txt new file mode 100644 index 0000000..6c45f23 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/letter-spacing-computed-expected.txt
@@ -0,0 +1,11 @@ +This is a testharness.js-based test. +[FAIL] Property letter-spacing value '110%' + assert_true: '110%' is a supported value for letter-spacing. expected true got false +[FAIL] Property letter-spacing value '-5%' + assert_true: '-5%' is a supported value for letter-spacing. expected true got false +[FAIL] Property letter-spacing value 'calc(10% - 20%)' + assert_true: 'calc(10% - 20%)' is a supported value for letter-spacing. expected true got false +[FAIL] Property letter-spacing value 'calc(10px - (5% + 10%)' + assert_true: 'calc(10px - (5% + 10%)' is a supported value for letter-spacing. expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/letter-spacing-computed.html b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/letter-spacing-computed.html index 45417d1..a7ef1390 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/letter-spacing-computed.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/letter-spacing-computed.html
@@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>CSS Text: getComputedStyle().letterSpacing</title> <link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-letter-spacing"> -<meta name="assert" content="letter-spacing computed value is an absolute length."> +<meta name="assert" content="letter-spacing computed value is an absolute length and/or percentage."> <meta name="assert" content="'normal' computes to zero, but the resolved value of 0px is 'normal', so that's the value that is observed."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -24,6 +24,10 @@ test_computed_value("letter-spacing", "10px"); test_computed_value("letter-spacing", "-20px"); test_computed_value("letter-spacing", "calc(10px - 0.5em)", "-10px"); +test_computed_value("letter-spacing", "110%"); +test_computed_value("letter-spacing", "-5%"); +test_computed_value("letter-spacing", "calc(10% - 20%)", "-10%"); +test_computed_value("letter-spacing", "calc(10px - (5% + 10%)", "calc(-15% + 10px)"); </script> </body> </html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/letter-spacing-invalid.html b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/letter-spacing-invalid.html index e9ad4e5..e32b98c 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/letter-spacing-invalid.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/letter-spacing-invalid.html
@@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>CSS Text Module Test: parsing letter-spacing with invalid values</title> <link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-letter-spacing"> -<meta name="assert" content="letter-spacing supports only the grammar 'normal | <length>'."> +<meta name="assert" content="letter-spacing supports only the grammar 'normal | <length-percentage>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/css/support/parsing-testcommon.js"></script> @@ -13,10 +13,9 @@ <script> test_invalid_value("letter-spacing", "auto"); test_invalid_value("letter-spacing", "20"); -test_invalid_value("letter-spacing", "30%"); -test_invalid_value("letter-spacing", "calc(40% + 50px)"); test_invalid_value("letter-spacing", "normal 10px"); +test_invalid_value("letter-spacing", "10% 10px"); </script> </body> </html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/letter-spacing-valid-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/letter-spacing-valid-expected.txt new file mode 100644 index 0000000..9decd1a9 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/letter-spacing-valid-expected.txt
@@ -0,0 +1,11 @@ +This is a testharness.js-based test. +[FAIL] e.style['letter-spacing'] = "120%" should set the property value + assert_not_equals: property should be set got disallowed value "" +[FAIL] e.style['letter-spacing'] = "-10%" should set the property value + assert_not_equals: property should be set got disallowed value "" +[FAIL] e.style['letter-spacing'] = "calc(2ch - 30%)" should set the property value + assert_not_equals: property should be set got disallowed value "" +[FAIL] e.style['letter-spacing'] = "calc(40% + 50px)" should set the property value + assert_not_equals: property should be set got disallowed value "" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/letter-spacing-valid.html b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/letter-spacing-valid.html index 740d1fc3..f20fa21 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/letter-spacing-valid.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/letter-spacing-valid.html
@@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>CSS Text Module Test: parsing letter-spacing with valid values</title> <link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-letter-spacing"> -<meta name="assert" content="letter-spacing supports the full grammar 'normal | <length>'."> +<meta name="assert" content="letter-spacing supports the full grammar 'normal | <length-percentage>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/css/support/parsing-testcommon.js"></script> @@ -12,10 +12,17 @@ <body> <script> test_valid_value("letter-spacing", "normal"); - test_valid_value("letter-spacing", "0", "0px"); + test_valid_value("letter-spacing", "-10px"); +test_valid_value("letter-spacing", "20px"); test_valid_value("letter-spacing", "calc(2em + 3ex)"); + +// Level 4 adds percentages +test_valid_value("letter-spacing", "120%"); +test_valid_value("letter-spacing", "-10%"); +test_valid_value("letter-spacing", "calc(2ch - 30%)", "calc(-30% + 2ch)"); +test_valid_value("letter-spacing", "calc(40% + 50px)"); </script> </body> </html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/word-spacing-computed-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/word-spacing-computed-expected.txt new file mode 100644 index 0000000..9045a13 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/word-spacing-computed-expected.txt
@@ -0,0 +1,11 @@ +This is a testharness.js-based test. +[FAIL] Property word-spacing value '110%' + assert_true: '110%' is a supported value for word-spacing. expected true got false +[FAIL] Property word-spacing value '-5%' + assert_true: '-5%' is a supported value for word-spacing. expected true got false +[FAIL] Property word-spacing value 'calc(10% - 20%)' + assert_true: 'calc(10% - 20%)' is a supported value for word-spacing. expected true got false +[FAIL] Property word-spacing value 'calc(10px - (5% + 10%)' + assert_true: 'calc(10px - (5% + 10%)' is a supported value for word-spacing. expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/word-spacing-computed.html b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/word-spacing-computed.html index 192dec6f..7c3f9895 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/word-spacing-computed.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/word-spacing-computed.html
@@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>CSS Text: getComputedStyle().wordSpacing</title> <link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-word-spacing"> -<meta name="assert" content="word-spacing computed value is an absolute length."> +<meta name="assert" content="word-spacing computed value is an absolute length and/or percentage."> <meta name="assert" content="'normal' computes to zero."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -19,10 +19,15 @@ <div id="target"></div> <script> test_computed_value("word-spacing", "normal", "0px"); +test_computed_value("word-spacing", "0", "0px"); test_computed_value("word-spacing", "10px"); test_computed_value("word-spacing", "-20px"); test_computed_value("word-spacing", "calc(10px - 0.5em)", "-10px"); +test_computed_value("word-spacing", "110%"); +test_computed_value("word-spacing", "-5%"); +test_computed_value("word-spacing", "calc(10% - 20%)", "-10%"); +test_computed_value("word-spacing", "calc(10px - (5% + 10%)", "calc(-15% + 10px)"); </script> </body> </html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/word-spacing-invalid.html b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/word-spacing-invalid.html index 3a1c4ca4..ae8e121 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/word-spacing-invalid.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/word-spacing-invalid.html
@@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>CSS Text Module Test: parsing word-spacing with invalid values</title> <link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-word-spacing"> -<meta name="assert" content="word-spacing supports only the grammar 'normal | <length>'."> +<meta name="assert" content="word-spacing supports only the grammar 'normal | <length-percentage>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/css/support/parsing-testcommon.js"></script> @@ -12,9 +12,9 @@ <body> <script> test_invalid_value("word-spacing", "auto"); -test_invalid_value("word-spacing", "20%"); test_invalid_value("word-spacing", "normal 10px"); +test_invalid_value("word-spacing", "10% 10px"); </script> </body> </html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/word-spacing-valid-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/word-spacing-valid-expected.txt new file mode 100644 index 0000000..77e20da --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/word-spacing-valid-expected.txt
@@ -0,0 +1,11 @@ +This is a testharness.js-based test. +[FAIL] e.style['word-spacing'] = "120%" should set the property value + assert_not_equals: property should be set got disallowed value "" +[FAIL] e.style['word-spacing'] = "-10%" should set the property value + assert_not_equals: property should be set got disallowed value "" +[FAIL] e.style['word-spacing'] = "calc(2ch - 30%)" should set the property value + assert_not_equals: property should be set got disallowed value "" +[FAIL] e.style['word-spacing'] = "calc(40% + 50px)" should set the property value + assert_not_equals: property should be set got disallowed value "" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/word-spacing-valid.html b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/word-spacing-valid.html index 217b2488..640f697 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/word-spacing-valid.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/word-spacing-valid.html
@@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>CSS Text Module Test: parsing word-spacing with valid values</title> <link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-word-spacing"> -<meta name="assert" content="word-spacing supports the full grammar 'normal | <length>'."> +<meta name="assert" content="word-spacing supports the full grammar 'normal | <length-percentage>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/css/support/parsing-testcommon.js"></script> @@ -12,11 +12,17 @@ <body> <script> test_valid_value("word-spacing", "normal"); +test_valid_value("word-spacing", "0", "0px"); test_valid_value("word-spacing", "10px"); test_valid_value("word-spacing", "-20px"); test_valid_value("word-spacing", "calc(2em + 3ex)"); -test_valid_value("word-spacing", "0", "0px"); + +// Level 4 adds percentages +test_valid_value("word-spacing", "120%"); +test_valid_value("word-spacing", "-10%"); +test_valid_value("word-spacing", "calc(2ch - 30%)", "calc(-30% + 2ch)"); +test_valid_value("word-spacing", "calc(40% + 50px)"); </script> </body> </html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/word-spacing/reference/word-spacing-percent-001-ref.html b/third_party/blink/web_tests/external/wpt/css/css-text/word-spacing/reference/word-spacing-percent-001-ref.html new file mode 100644 index 0000000..02bd2f64 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/word-spacing/reference/word-spacing-percent-001-ref.html
@@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html lang="en" > +<meta charset="utf-8"> +<title>word-spacing as percentages</title> +<style type='text/css'> + div { font-size: 20px; line-height: 1; color: blue; } + small { font-size: 50%; } +</style> + +<p>Test passes if the pattern is identical on all four lines. + +<div style="word-spacing: 1em">ABC123().*$いろはx x x፡x་x + <small style="word-spacing: 1em">ABC123().*$いろはx x x፡x་x</small></div> +<div style="word-spacing: 1em">ABC123().*$いろはx x x፡x་x + <small style="word-spacing: 1em">ABC123().*$いろはx x x፡x་x</small></div> +<div style="word-spacing: 1em">ABC123().*$いろはx x x፡x་x + <small style="word-spacing: 1em">ABC123().*$いろはx x x፡x་x</small></div> +<div style="word-spacing: 1em">ABC123().*$いろはx x x፡x་x + <small style="word-spacing: 1em">ABC123().*$いろはx x x፡x་x</small></div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/word-spacing/word-spacing-002.html b/third_party/blink/web_tests/external/wpt/css/css-text/word-spacing/word-spacing-002.html new file mode 100644 index 0000000..0def7e0 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/word-spacing/word-spacing-002.html
@@ -0,0 +1,32 @@ +<!DOCTYPE html> +<title>CSS Text Test: Word Spacing</title> +<link rel="author" title="Nicholas Nethercote" href="mailto:nnethercote@mozilla.com"> +<link rel="author" title="Elika Etemad" href="http://fantasai.inkedblade.net/contact"> +<link rel="help" href="http://www.w3.org/TR/css-text-3/#word-spacing"> +<link rel="stylesheet" href="/fonts/ahem.css"> +<link rel="match" href="word-spacing-001-ref.html"> +<meta name="flags" content="ahem"> +<meta name="assert" content="Test checks various length values of word-spacing, including calc()."> +<style> +@font-face { + font-family: Ahem; + src: url(/fonts/Ahem.ttf); +} +/* We use Ahem to avoid very minor differences between the test and the + reference that occur with certain font+platform combinations. */ +div { font-family: Ahem, monospace; font-size: 20px; } +div.ws0 { word-spacing: -1ch; } +div.ws1 { word-spacing: 0; } +div.ws2 { word-spacing: 1ch; } +div.ws3 { word-spacing: calc(1ch + 1ch); } +div.ws4 { word-spacing: calc(0.5*2ch); white-space: pre;} +</style> +<body> + <p>Test passes if the space between the words starts at zero and increases by + an even amount on each subsequent line.</p> + <div class="ws0">A Bc Def Ghij</div> + <div class="ws1">A Bc Def Ghij</div> + <div class="ws2">A Bc Def Ghij</div> + <div class="ws3">A Bc Def Ghij</div> + <div class="ws4">A Bc Def Ghij</div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/word-spacing/word-spacing-computed-001.html b/third_party/blink/web_tests/external/wpt/css/css-text/word-spacing/word-spacing-computed-001.html index 84d1fcf1..fac211af 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/word-spacing/word-spacing-computed-001.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/word-spacing/word-spacing-computed-001.html
@@ -76,7 +76,6 @@ verifyComputedStyle("word-spacing", "3rem", "48px"); verifyComputedStyle("word-spacing", "0ch", "0px"); - } startTesting();
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/word-spacing/word-spacing-percent-001.html b/third_party/blink/web_tests/external/wpt/css/css-text/word-spacing/word-spacing-percent-001.html new file mode 100644 index 0000000..65f99720 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/word-spacing/word-spacing-percent-001.html
@@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html lang="en" > +<meta charset="utf-8"> +<title>word-spacing as percentages</title> +<link rel='author' title='Elika J. Etemad' href='http://fantasai.inkedblade.net/contact'> +<link rel='help' href='https://www.w3.org/TR/css-text-4/#word-spacing'> +<link rel='match' href='reference/word-spacing-percent-001-ref.html'> +<meta name="assert" content="Percentage values of word-spacing are relative to the current font-size."> +<style type='text/css'> + div { font-size: 20px; line-height: 1; color: blue; } + small { font-size: 50%; } +</style> + +<p>Test passes if the pattern is identical on all four lines. + +<div style="word-spacing: 1em">ABC123().*$いろはx x x፡x་x <small style="word-spacing: 1em">ABC123().*$いろはx x x፡x་x</small></div> +<div style="word-spacing: 100%">ABC123().*$いろはx x x፡x་x <small>ABC123().*$いろはx x x፡x་x</small></div> +<div style="word-spacing: calc(0.5em + 50%)">ABC123().*$いろはx x x፡x་x <small style="word-spacing: calc(0.5em + 50%)">ABC123().*$いろはx x x፡x་x</small></div> +<div style="word-spacing: 100%; font-size: 0.1em"><div style="font-size: 20px">ABC123().*$いろはx x x፡x་x <small>ABC123().*$いろはx x x፡x་x</small></div></div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-typed-om/the-stylepropertymap/properties/letter-spacing-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-typed-om/the-stylepropertymap/properties/letter-spacing-expected.txt new file mode 100644 index 0000000..5d4fa8b --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-typed-om/the-stylepropertymap/properties/letter-spacing-expected.txt
@@ -0,0 +1,11 @@ +This is a testharness.js-based test. +[FAIL] Can set 'letter-spacing' to a percent: 0% + Failed to execute 'set' on 'StylePropertyMap': Invalid type for property +[FAIL] Can set 'letter-spacing' to a percent: -3.14% + Failed to execute 'set' on 'StylePropertyMap': Invalid type for property +[FAIL] Can set 'letter-spacing' to a percent: 3.14% + Failed to execute 'set' on 'StylePropertyMap': Invalid type for property +[FAIL] Can set 'letter-spacing' to a percent: calc(0% + 0%) + Failed to execute 'set' on 'StylePropertyMap': Invalid type for property +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/css/css-typed-om/the-stylepropertymap/properties/letter-spacing.html b/third_party/blink/web_tests/external/wpt/css/css-typed-om/the-stylepropertymap/properties/letter-spacing.html index 9d313c13..ab78031b2 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-typed-om/the-stylepropertymap/properties/letter-spacing.html +++ b/third_party/blink/web_tests/external/wpt/css/css-typed-om/the-stylepropertymap/properties/letter-spacing.html
@@ -35,6 +35,7 @@ syntax: '<length>', computed: assert_is_equal_with_zero_special_handling }, + { syntax: '<percentage>' }, ]); </script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-values/calc-letter-spacing-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-values/calc-letter-spacing-expected.txt new file mode 100644 index 0000000..4446bc0a --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-values/calc-letter-spacing-expected.txt
@@ -0,0 +1,5 @@ +This is a testharness.js-based test. +[FAIL] testing letter-spacing: calc(100%) + assert_equals: calc(100%) should compute to 100% expected "100%" but got "20px" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/css/css-values/calc-letter-spacing.html b/third_party/blink/web_tests/external/wpt/css/css-values/calc-letter-spacing.html index 444785ba..4db3b01 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-values/calc-letter-spacing.html +++ b/third_party/blink/web_tests/external/wpt/css/css-values/calc-letter-spacing.html
@@ -39,7 +39,7 @@ elemTarget.style.setProperty(property_name, initial_value); /* - In exactly 5 out of the 6 sub-tests, the initial_value will + In exactly 4 out of the 6 sub-tests, the initial_value will act as a fallback value because the calc() function in the specified value generates an invalid value. Since we are running 6 consecutive tests on the same element, then @@ -60,7 +60,7 @@ verifyComputedStyle("letter-spacing", "20px", "calc(1 + 100%)", "20px", "testing letter-spacing: calc(1 + 100%)"); - verifyComputedStyle("letter-spacing", "20px", "calc(100%)", "20px", "testing letter-spacing: calc(100%)"); + verifyComputedStyle("letter-spacing", "20px", "calc(100%)", "100%", "testing letter-spacing: calc(100%)"); verifyComputedStyle("letter-spacing", "20px", "calc(10px) bla", "20px", "testing letter-spacing: calc(10px) bla");
diff --git a/third_party/blink/web_tests/external/wpt/css/css-values/minmax-length-invalid.html b/third_party/blink/web_tests/external/wpt/css/css-values/minmax-length-invalid.html index 1405c319..7b8ca88c 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-values/minmax-length-invalid.html +++ b/third_party/blink/web_tests/external/wpt/css/css-values/minmax-length-invalid.html
@@ -8,8 +8,8 @@ <script src="../support/parsing-testcommon.js"></script> <script> function test_invalid_length(value) { - // 'letter-spacing' accepts <length> only, not <percentage> or any mixes. - test_invalid_value('letter-spacing', value); + // 'border-width' accepts <length> only, not <percentage> or any mixes. + test_invalid_value('border-left-width', value); } // Syntax checking
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/permission-element/invalid-css-properties.html b/third_party/blink/web_tests/external/wpt/html/semantics/permission-element/invalid-css-properties.html new file mode 100644 index 0000000..c718656 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/semantics/permission-element/invalid-css-properties.html
@@ -0,0 +1,34 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<body> +<!--The permission element does not allow certain CSS properties +--> +<style> + #id1 { + border-image: url('test-url'); + background-image: url('test-url'); + clip-path: circle(10px); + filter: blur(10px); + mask: url('test-url'); + padding-left: 10px; + transform: rotate(10); + } +</style> + +<permission id="id1" type="geolocation"> + +<script> + test(function(){ + var el_with_negatives = document.getElementById("id1"); + assert_equals(getComputedStyle(el_with_negatives).borderImage, "none", "border-image"); + assert_equals(getComputedStyle(el_with_negatives).backgroundImage, "none", "background-image"); + assert_equals(getComputedStyle(el_with_negatives).clipPath, "none", "clip-path"); + assert_equals(getComputedStyle(el_with_negatives).filter, "none", "filter"); + assert_equals(getComputedStyle(el_with_negatives).mask, "none", "mask"); + assert_equals(getComputedStyle(el_with_negatives).paddingLeft, "0px", "padding-left"); + assert_equals(getComputedStyle(el_with_negatives).transform, "none", "transform"); + }, "None of the listed properties should be applied"); +</script> +</body> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/permission-element/negative-offset-and-margin.html b/third_party/blink/web_tests/external/wpt/html/semantics/permission-element/negative-offset-and-margin.html new file mode 100644 index 0000000..860e637 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/semantics/permission-element/negative-offset-and-margin.html
@@ -0,0 +1,48 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<body> +<!--The permission element should not allow setting negative margins or outline-offset +--> +<style> + #id1 { + outline-offset: -50px; + margin-top: -50px; + margin-left: -50px; + margin-bottom: -50px; + margin-right: -50px; + } + #id2 { + outline-offset: 50px; + margin-top: 50px; + margin-left: 50px; + margin-bottom: 50px; + margin-right: 50px; + } +</style> + + +<permission id="id1" type="geolocation"> +<permission id="id2" type="geolocation"> + +<script> + test(function(){ + var el_with_negatives = document.getElementById("id1"); + assert_equals(getComputedStyle(el_with_negatives).outlineOffset, "0px", "outline-offset"); + assert_equals(getComputedStyle(el_with_negatives).marginLeft, "0px", "margin-left"); + assert_equals(getComputedStyle(el_with_negatives).marginRight, "0px", "margin-right"); + assert_equals(getComputedStyle(el_with_negatives).marginTop, "0px", "margin-top"); + assert_equals(getComputedStyle(el_with_negatives).marginBottom, "0px", "margin-bottom"); + }, "Negative margins/offset should be changed to 0px"); + + test(function(){ + var el_with_positives = document.getElementById("id2"); + assert_equals(getComputedStyle(el_with_positives).outlineOffset, "50px", "outline-offset"); + assert_equals(getComputedStyle(el_with_positives).marginLeft, "50px", "margin-left"); + assert_equals(getComputedStyle(el_with_positives).marginRight, "50px", "margin-right"); + assert_equals(getComputedStyle(el_with_positives).marginTop, "50px", "margin-top"); + assert_equals(getComputedStyle(el_with_positives).marginBottom, "50px", "margin-bottom"); + }, "Positive margins/offset are unaffected"); +</script> +</body> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/popovers/popover-light-dismiss-flat-tree-expected.txt b/third_party/blink/web_tests/external/wpt/html/semantics/popovers/popover-light-dismiss-flat-tree-expected.txt deleted file mode 100644 index 37a9b30..0000000 --- a/third_party/blink/web_tests/external/wpt/html/semantics/popovers/popover-light-dismiss-flat-tree-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -This is a testharness.js-based test. -[FAIL] Popover light dismiss uses the flat tree - promise_test: Unhandled rejection with value: object "Error: element in different document or iframe" -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/popovers/popover-light-dismiss-flat-tree-nested-expected.txt b/third_party/blink/web_tests/external/wpt/html/semantics/popovers/popover-light-dismiss-flat-tree-nested-expected.txt deleted file mode 100644 index d29b7bf..0000000 --- a/third_party/blink/web_tests/external/wpt/html/semantics/popovers/popover-light-dismiss-flat-tree-nested-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -This is a testharness.js-based test. -[FAIL] Popover light dismiss uses the flat tree when nested shadow root - promise_test: Unhandled rejection with value: object "Error: element in different document or iframe" -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/popovers/resources/popover-utils.js b/third_party/blink/web_tests/external/wpt/html/semantics/popovers/resources/popover-utils.js index bfc1f89e..96ac7e03 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/popovers/resources/popover-utils.js +++ b/third_party/blink/web_tests/external/wpt/html/semantics/popovers/resources/popover-utils.js
@@ -7,9 +7,13 @@ } async function clickOn(element) { - const actions = new test_driver.Actions(); await waitForRender(); - await actions.pointerMove(0, 0, {origin: element}) + let rect = element.getBoundingClientRect(); + let actions = new test_driver.Actions(); + // FIXME: Switch to pointerMove(0, 0, {origin: element}) once + // https://github.com/web-platform-tests/wpt/issues/41257 is fixed. + await actions + .pointerMove(Math.round(rect.x + rect.width / 2), Math.round(rect.y + rect.height / 2), {}) .pointerDown({button: actions.ButtonType.LEFT}) .pointerUp({button: actions.ButtonType.LEFT}) .send();
diff --git a/third_party/blink/web_tests/external/wpt/notifications/global-teardown-crash.html b/third_party/blink/web_tests/external/wpt/notifications/global-teardown-crash.html new file mode 100644 index 0000000..27db2ca3 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/notifications/global-teardown-crash.html
@@ -0,0 +1,16 @@ +<!DOCTYPE html> +<html class="test-wait"> +<meta charset="utf-8"> +<iframe id="iframe" srcdoc=" + <script> + window.onload = () => { + new Notification('foo'); + if (window.parent.ran) { + window.parent.document.documentElement.classList.remove('test-wait'); + } else { + window.parent.ran = true; + location.reload(); + } + } + </script> +"></iframe>
diff --git a/third_party/chromium-variations b/third_party/chromium-variations index 2c5458c..4dcad64 160000 --- a/third_party/chromium-variations +++ b/third_party/chromium-variations
@@ -1 +1 @@ -Subproject commit 2c5458c1057e9a8d69cfa6c15f42ef6446b1629a +Subproject commit 4dcad64009561689b670e3474feabe23f8f38ef1
diff --git a/third_party/devtools-frontend-internal b/third_party/devtools-frontend-internal index 9c278bd..f1e5383 160000 --- a/third_party/devtools-frontend-internal +++ b/third_party/devtools-frontend-internal
@@ -1 +1 @@ -Subproject commit 9c278bd6f25a7da69b438b262acd0da6d2f78b1a +Subproject commit f1e5383735bc898c30f28de269f82b1ea975cbb1
diff --git a/third_party/pdfium b/third_party/pdfium index ef0eeaa9..09fbd30 160000 --- a/third_party/pdfium +++ b/third_party/pdfium
@@ -1 +1 @@ -Subproject commit ef0eeaa9e423c5aa002180cbc448f784c8e621ae +Subproject commit 09fbd30d50a95a0939f28d5561b7c61ec04533d0
diff --git a/third_party/perfetto b/third_party/perfetto index 98921c2..22d2e54 160000 --- a/third_party/perfetto +++ b/third_party/perfetto
@@ -1 +1 @@ -Subproject commit 98921c2a0c99fa8e97f5e6c369cc3e16473c695e +Subproject commit 22d2e541befaff7d4e62960aa761531c79b2e586
diff --git a/tools/ipc_fuzzer/fuzzer/fuzzer.cc b/tools/ipc_fuzzer/fuzzer/fuzzer.cc index 395529e..f1d6c7a 100644 --- a/tools/ipc_fuzzer/fuzzer/fuzzer.cc +++ b/tools/ipc_fuzzer/fuzzer/fuzzer.cc
@@ -1286,7 +1286,7 @@ std::vector<uint8_t> bytes = p->CopyBytesToVector(); if (!FuzzParam(&bytes, fuzzer)) return false; - net::IPAddress ip_address(bytes.data(), bytes.size()); + net::IPAddress ip_address(bytes); *p = ip_address; return true; }
diff --git a/ui/views/accessibility/view_accessibility.cc b/ui/views/accessibility/view_accessibility.cc index 597398f..391cc0da 100644 --- a/ui/views/accessibility/view_accessibility.cc +++ b/ui/views/accessibility/view_accessibility.cc
@@ -351,7 +351,8 @@ // be focusable, if there is test coverage, such a situation will cause a test // failure. return view_->GetFocusBehavior() != View::FocusBehavior::NEVER && - GetIsEnabled() && view_->IsDrawn() && !GetIsIgnored(); + GetIsEnabled() && view_->IsDrawn() && + !ViewAccessibility::GetIsIgnored(); } bool ViewAccessibility::IsFocusedForTesting() const {
diff --git a/ui/views/accessibility/view_accessibility.h b/ui/views/accessibility/view_accessibility.h index 00e205c..3f1abef 100644 --- a/ui/views/accessibility/view_accessibility.h +++ b/ui/views/accessibility/view_accessibility.h
@@ -165,7 +165,7 @@ // Hides this view from the accessibility APIs. void SetIsIgnored(bool is_ignored); - bool GetIsIgnored() const; + virtual bool GetIsIgnored() const; // Note that `pos_in_set` starts from 1 not 0. void SetPosInSet(int pos_in_set);
diff --git a/ui/views/accessibility/view_accessibility_utils.cc b/ui/views/accessibility/view_accessibility_utils.cc index f294592..0a0725d 100644 --- a/ui/views/accessibility/view_accessibility_utils.cc +++ b/ui/views/accessibility/view_accessibility_utils.cc
@@ -63,6 +63,12 @@ for (const auto& attr : source.stringlist_attributes) { destination.AddStringListAttribute(attr.first, attr.second); } + + // TODO(javiercon): Add checking for all the states, and add DCHECK for them + // as well. Do the same thing for the Restrictions. + if (source.HasState(ax::mojom::State::kIgnored)) { + destination.AddState(ax::mojom::State::kIgnored); + } } #if DCHECK_IS_ON()
diff --git a/ui/views/accessibility/view_ax_platform_node_delegate.cc b/ui/views/accessibility/view_ax_platform_node_delegate.cc index c5b05288..c8afbfdb 100644 --- a/ui/views/accessibility/view_ax_platform_node_delegate.cc +++ b/ui/views/accessibility/view_ax_platform_node_delegate.cc
@@ -213,11 +213,12 @@ } } -bool ViewAXPlatformNodeDelegate::IsIgnored() const { - // TODO(nektar): Make `ViewAccessibility::IsIgnored()` non-virtual and delete - // this method. For this to happen - // `IsViewUnfocusableDescendantOfFocusableAncestor()` needs to be moved to - // `ViewAccessibility`. +bool ViewAXPlatformNodeDelegate::GetIsIgnored() const { + // TODO(accessibility): Make `ViewAccessibility::GetIsIgnored()` non-virtual + // and delete this method. For this to happen the logic relevant to + // `IsViewUnfocusableDescendantOfFocusableAncestor()` needs to be moved to be + // part of a "push" system rather than "pull". + // For more info: https://crbug.com/325137417 return GetData().IsIgnored(); } @@ -385,7 +386,7 @@ size_t view_child_count = 0; for (View* child : view()->children()) { const ViewAccessibility& view_accessibility = child->GetViewAccessibility(); - if (view_accessibility.IsIgnored()) { + if (view_accessibility.GetIsIgnored()) { const auto* child_view_delegate = static_cast<const ViewAXPlatformNodeDelegate*>(&view_accessibility); DCHECK(child_view_delegate); @@ -445,7 +446,7 @@ for (View* child : view()->children()) { ViewAccessibility& view_accessibility = child->GetViewAccessibility(); - if (view_accessibility.IsIgnored()) { + if (view_accessibility.GetIsIgnored()) { auto* child_view_delegate = static_cast<ViewAXPlatformNodeDelegate*>(&view_accessibility); DCHECK(child_view_delegate); @@ -553,8 +554,9 @@ gfx::NativeViewAccessible ViewAXPlatformNodeDelegate::GetParent() const { if (View* parent_view = view()->parent()) { ViewAccessibility& view_accessibility = parent_view->GetViewAccessibility(); - if (!view_accessibility.IsIgnored()) + if (!view_accessibility.GetIsIgnored()) { return parent_view->GetNativeViewAccessible(); + } auto* parent_view_delegate = static_cast<ViewAXPlatformNodeDelegate*>(&view_accessibility); @@ -576,7 +578,7 @@ } bool ViewAXPlatformNodeDelegate::IsInvisibleOrIgnored() const { - return IsIgnored() || GetData().IsInvisible(); + return GetIsIgnored() || GetData().IsInvisible(); } bool ViewAXPlatformNodeDelegate::IsFocused() const {
diff --git a/ui/views/accessibility/view_ax_platform_node_delegate.h b/ui/views/accessibility/view_ax_platform_node_delegate.h index 5a82c8e..5899e31 100644 --- a/ui/views/accessibility/view_ax_platform_node_delegate.h +++ b/ui/views/accessibility/view_ax_platform_node_delegate.h
@@ -57,7 +57,7 @@ void SetPopupFocusOverride() override; void EndPopupFocusOverride() override; void FireFocusAfterMenuClose() override; - bool IsIgnored() const override; + bool GetIsIgnored() const override; gfx::NativeViewAccessible GetNativeObject() const override; void NotifyAccessibilityEvent(ax::mojom::Event event_type) override; #if BUILDFLAG(IS_MAC)
diff --git a/ui/views/accessibility/view_ax_platform_node_delegate_unittest.cc b/ui/views/accessibility/view_ax_platform_node_delegate_unittest.cc index 2d2636f..832d5197 100644 --- a/ui/views/accessibility/view_ax_platform_node_delegate_unittest.cc +++ b/ui/views/accessibility/view_ax_platform_node_delegate_unittest.cc
@@ -797,12 +797,12 @@ EXPECT_EQ(0u, button_accessibility()->GetIndexInParent()); EXPECT_EQ(2u, parent_view->GetIndexInParent()); - EXPECT_FALSE(contents_view->IsIgnored()); - EXPECT_FALSE(parent_view->IsIgnored()); - EXPECT_TRUE(child_view_1->IsIgnored()); - EXPECT_TRUE(child_view_2->IsIgnored()); - EXPECT_TRUE(child_view_3->IsIgnored()); - EXPECT_TRUE(child_view_4->IsIgnored()); + EXPECT_FALSE(contents_view->GetIsIgnored()); + EXPECT_FALSE(parent_view->GetIsIgnored()); + EXPECT_TRUE(child_view_1->GetIsIgnored()); + EXPECT_TRUE(child_view_2->GetIsIgnored()); + EXPECT_TRUE(child_view_3->GetIsIgnored()); + EXPECT_TRUE(child_view_4->GetIsIgnored()); EXPECT_FALSE(contents_view->IsLeaf()); EXPECT_TRUE(parent_view->IsLeaf()); @@ -834,12 +834,12 @@ EXPECT_EQ(0u, button_accessibility()->GetIndexInParent()); EXPECT_EQ(2u, parent_view->GetIndexInParent()); - EXPECT_FALSE(contents_view->IsIgnored()); - EXPECT_FALSE(parent_view->IsIgnored()); - EXPECT_FALSE(child_view_1->IsIgnored()); - EXPECT_FALSE(child_view_2->IsIgnored()); - EXPECT_FALSE(child_view_3->IsIgnored()); - EXPECT_FALSE(child_view_4->IsIgnored()); + EXPECT_FALSE(contents_view->GetIsIgnored()); + EXPECT_FALSE(parent_view->GetIsIgnored()); + EXPECT_FALSE(child_view_1->GetIsIgnored()); + EXPECT_FALSE(child_view_2->GetIsIgnored()); + EXPECT_FALSE(child_view_3->GetIsIgnored()); + EXPECT_FALSE(child_view_4->GetIsIgnored()); EXPECT_FALSE(contents_view->IsLeaf()); EXPECT_FALSE(parent_view->IsLeaf());