From f61cc3bb7de73c6837e8fb29774db4cb9dcb78d2 Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Fri, 24 Jun 2022 19:13:26 +0000 Subject: [PATCH] Rename popup=async to popup=manual Per the [1] resolution, we have decided to rename popup=async to popup=manual, since it is a) parallel to popup=auto, and b) easier to understand. [1] https://github.com/openui/open-ui/issues/495#issuecomment-1164827851 Bug: 1307772 Change-Id: I786f6332c2a7f9df4810aeedfd425e38579ea1b1 Cq-Do-Not-Cancel-Tryjobs: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3722345 Commit-Queue: Mason Freed Auto-Submit: Mason Freed Reviewed-by: Joey Arhar Cr-Commit-Position: refs/heads/main@{#1017762} NOKEYCHECK=True GitOrigin-RevId: c302eb6c79c4d435f8a046ae130fa5873ec36ecc --- blink/renderer/core/dom/element.cc | 6 ++-- blink/renderer/core/dom/element.h | 4 +-- blink/renderer/core/dom/element.idl | 2 +- .../popup-attribute-basic.tentative.html | 6 ++-- ...pup-backdrop-appearance-ref.tentative.html | 2 +- .../popup-backdrop-appearance.tentative.html | 2 +- .../popups/popup-defaultopen.tentative.html | 8 ++--- .../popup-invoking-attribute.tentative.html | 2 +- .../popups/popup-light-dismiss.tentative.html | 18 +++++------ .../popups/popup-types.tentative.html | 30 +++++++++---------- 10 files changed, 40 insertions(+), 40 deletions(-) diff --git a/blink/renderer/core/dom/element.cc b/blink/renderer/core/dom/element.cc index 382732987ac..bc31ffc6b1f 100644 --- a/blink/renderer/core/dom/element.cc +++ b/blink/renderer/core/dom/element.cc @@ -2438,8 +2438,8 @@ void Element::UpdatePopupAttribute(String value) { type = PopupValueType::kAuto; } else if (EqualIgnoringASCIICase(value, kPopupTypeValueHint)) { type = PopupValueType::kHint; - } else if (EqualIgnoringASCIICase(value, kPopupTypeValueAsync)) { - type = PopupValueType::kAsync; + } else if (EqualIgnoringASCIICase(value, kPopupTypeValueManual)) { + type = PopupValueType::kManual; } else { type = PopupValueType::kNone; } @@ -3224,7 +3224,7 @@ Node::InsertionNotificationRequest Element::InsertedInto( WTF::Bind( [](Element* popup) { if (popup && popup->isConnected() && - (popup->PopupType() == PopupValueType::kAsync || + (popup->PopupType() == PopupValueType::kManual || !popup->GetDocument().PopupOrHintShowing())) { popup->showPopUp(ASSERT_NO_EXCEPTION); } diff --git a/blink/renderer/core/dom/element.h b/blink/renderer/core/dom/element.h index b61f04e75b2..aa78c740260 100644 --- a/blink/renderer/core/dom/element.h +++ b/blink/renderer/core/dom/element.h @@ -163,11 +163,11 @@ enum class PopupValueType { kNone, kAuto, kHint, - kAsync, + kManual, }; constexpr const char* kPopupTypeValueAuto = "auto"; constexpr const char* kPopupTypeValueHint = "hint"; -constexpr const char* kPopupTypeValueAsync = "async"; +constexpr const char* kPopupTypeValueManual = "manual"; enum class PopupTriggerAction { kNone, diff --git a/blink/renderer/core/dom/element.idl b/blink/renderer/core/dom/element.idl index 6d0ccb20eb9..410e919abdd 100644 --- a/blink/renderer/core/dom/element.idl +++ b/blink/renderer/core/dom/element.idl @@ -151,7 +151,7 @@ dictionary IsVisibleOptions { // The Popup API [MeasureAs=ElementShowPopup,RuntimeEnabled=HTMLPopupAttribute,RaisesException] void showPopUp(); [MeasureAs=ElementHidePopup,RuntimeEnabled=HTMLPopupAttribute,RaisesException] void hidePopUp(); - [Unscopable,CEReactions,RuntimeEnabled=HTMLPopupAttribute,MeasureAs=AnyPopupAttribute,Reflect,ReflectOnly=("auto","hint","async"),ReflectEmpty="auto",ReflectInvalid] attribute DOMString? popUp; + [Unscopable,CEReactions,RuntimeEnabled=HTMLPopupAttribute,MeasureAs=AnyPopupAttribute,Reflect,ReflectOnly=("auto","hint","manual"),ReflectEmpty="auto",ReflectInvalid] attribute DOMString? popUp; [CEReactions,RuntimeEnabled=HTMLPopupAttribute,Reflect] attribute boolean defaultOpen; // Experimental accessibility API diff --git a/blink/web_tests/external/wpt/html/semantics/popups/popup-attribute-basic.tentative.html b/blink/web_tests/external/wpt/html/semantics/popups/popup-attribute-basic.tentative.html index efcd3355ebe..e7c2c316881 100644 --- a/blink/web_tests/external/wpt/html/semantics/popups/popup-attribute-basic.tentative.html +++ b/blink/web_tests/external/wpt/html/semantics/popups/popup-attribute-basic.tentative.html @@ -11,7 +11,7 @@
Pop up
Pop up
Pop up
-
Pop up
+
Pop up
@@ -158,7 +158,7 @@ assert_false(popUp.matches(':top-layer')); popUp.showPopUp(); assert_true(popUp.matches(':top-layer')); - popUp.setAttribute('popup','async'); + popUp.setAttribute('popup','manual'); assert_false(popUp.matches(':top-layer')); popUp.showPopUp(); assert_true(popUp.matches(':top-layer')); @@ -175,7 +175,7 @@ } } - ["auto","hint","async"].forEach(type => { + ["auto","hint","manual"].forEach(type => { test((t) => { const popUp = createPopUp(t); popUp.setAttribute('popup',type); diff --git a/blink/web_tests/external/wpt/html/semantics/popups/popup-backdrop-appearance-ref.tentative.html b/blink/web_tests/external/wpt/html/semantics/popups/popup-backdrop-appearance-ref.tentative.html index 0327f3886fb..283eed24d3d 100644 --- a/blink/web_tests/external/wpt/html/semantics/popups/popup-backdrop-appearance-ref.tentative.html +++ b/blink/web_tests/external/wpt/html/semantics/popups/popup-backdrop-appearance-ref.tentative.html @@ -40,7 +40,7 @@ if there are 3 stacked boxes, with the brightest green on top.

Bottom
Middle -
Top
+
Top
diff --git a/blink/web_tests/external/wpt/html/semantics/popups/popup-backdrop-appearance.tentative.html b/blink/web_tests/external/wpt/html/semantics/popups/popup-backdrop-appearance.tentative.html index da975d95b65..62005db75be 100644 --- a/blink/web_tests/external/wpt/html/semantics/popups/popup-backdrop-appearance.tentative.html +++ b/blink/web_tests/external/wpt/html/semantics/popups/popup-backdrop-appearance.tentative.html @@ -41,7 +41,7 @@ if there are 3 stacked boxes, with the brightest green on top.

Bottom
Middle -
Top
+
Top
Popup 1