From ea0dd88455bcd1c279b12754f91f9edbe7344a9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 11 Dec 2018 03:31:47 +0100 Subject: [PATCH 1/8] Bug 1511625 - Restore the status quo before bug 1511324. Pretty sure I saw the test pass on my try run, but oh well. --- .../shadow-dom/scroll-to-the-fragment-in-shadow-tree.html.ini | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 testing/web-platform/meta/shadow-dom/scroll-to-the-fragment-in-shadow-tree.html.ini diff --git a/testing/web-platform/meta/shadow-dom/scroll-to-the-fragment-in-shadow-tree.html.ini b/testing/web-platform/meta/shadow-dom/scroll-to-the-fragment-in-shadow-tree.html.ini new file mode 100644 index 000000000000..d6e8dc9a6d08 --- /dev/null +++ b/testing/web-platform/meta/shadow-dom/scroll-to-the-fragment-in-shadow-tree.html.ini @@ -0,0 +1,4 @@ +[scroll-to-the-fragment-in-shadow-tree.html] + [The user agent scroll to the fragment when there is an element with an ID exactly equal to the decoded fragid] + expected: + if os == "android": FAIL From 06798d3c2e50e6e3c42b1348aa257a5cfec4ec89 Mon Sep 17 00:00:00 2001 From: Daisuke Akatsuka Date: Tue, 11 Dec 2018 02:16:25 +0000 Subject: [PATCH 2/8] Bug 1497450: Get DOMTitleChanged event of Android from DevTools server. r=ochameau,jdescottes Currently, when `about:debugging` is displaying, even if move to another URL on Android, its update does not reflect to `about:debugging` page. Because the `DOMTitleChanged` event on message manager comes from only in case of remote browser. In this patch, get the event on even not remote browser, then notify to clients. Differential Revision: https://phabricator.services.mozilla.com/D12094 --- devtools/server/actors/webbrowser.js | 68 +++++++++++++++---- .../modules/geckoview/GeckoViewTab.jsm | 4 ++ 2 files changed, 59 insertions(+), 13 deletions(-) diff --git a/devtools/server/actors/webbrowser.js b/devtools/server/actors/webbrowser.js index 405cc8642753..9a647ae041b3 100644 --- a/devtools/server/actors/webbrowser.js +++ b/devtools/server/actors/webbrowser.js @@ -20,6 +20,7 @@ loader.lazyRequireGetter(this, "WorkerTargetActorList", "devtools/server/actors/ loader.lazyRequireGetter(this, "ServiceWorkerRegistrationActorList", "devtools/server/actors/worker/worker-list", true); loader.lazyRequireGetter(this, "ProcessActorList", "devtools/server/actors/process", true); loader.lazyImporter(this, "AddonManager", "resource://gre/modules/AddonManager.jsm"); +loader.lazyImporter(this, "AppConstants", "resource://gre/modules/AppConstants.jsm"); /** * Browser-specific actors. @@ -143,11 +144,11 @@ exports.createRootActor = function createRootActor(connection) { * - Title changes: * * For tabs living in the child process, we listen for DOMTitleChange message - * via the top-level window's message manager. Doing this also allows listening - * for title changes on Fennec. + * via the top-level window's message manager. * But as these messages aren't sent for tabs loaded in the parent process, * we also listen for TabAttrModified event, which is fired only on Firefox * desktop. + * Also, we listen DOMTitleChange event on Android document. */ function BrowserTabList(connection) { this._connection = connection; @@ -191,6 +192,8 @@ function BrowserTabList(connection) { /* True if we're testing, and should throw if consistency checks fail. */ this._testing = false; + + this._onAndroidDocumentEvent = this._onAndroidDocumentEvent.bind(this); } BrowserTabList.prototype.constructor = BrowserTabList; @@ -453,11 +456,28 @@ BrowserTabList.prototype._checkListening = function() { /* * We also listen for title changed from the child process. - * This allows listening for title changes from Fennec and OOP tabs in Fx. + * This allows listening for title changes from OOP tabs. + * OOP tabs are running browser-child.js frame script which sends DOMTitleChanged + * events through the message manager. */ this._listenForMessagesIf(this._onListChanged && this._mustNotify, "_listeningForTitleChange", ["DOMTitleChanged"]); + + /* + * We also listen for title changed event on Android document. + * Android document events are used for single process Gecko View and Firefox for + * Android. They do no execute browser-child.js because of single process, instead + * DOMTitleChanged events are emitted on the top level document. + * Also, Multi process Gecko View is not covered by here since that receives title + * updates via DOMTitleChanged messages. + */ + if (AppConstants.platform === "android") { + this._listenForEventsIf(this._onListChanged && this._mustNotify, + "_listeningForAndroidDocument", + ["DOMTitleChanged"], + this._onAndroidDocumentEvent); + } }; /* @@ -472,12 +492,12 @@ BrowserTabList.prototype._checkListening = function() { * An array of event names. */ BrowserTabList.prototype._listenForEventsIf = - function(shouldListen, guard, eventNames) { + function(shouldListen, guard, eventNames, listener = this) { if (!shouldListen !== !this[guard]) { const op = shouldListen ? "addEventListener" : "removeEventListener"; for (const win of Services.wm.getEnumerator(DebuggerServer.chromeWindowType)) { for (const name of eventNames) { - win[op](name, this, false); + win[op](name, listener, false); } } this[guard] = shouldListen; @@ -487,12 +507,12 @@ BrowserTabList.prototype._listenForEventsIf = /* * Add or remove message listeners for all XUL windows. * - * @param aShouldListen boolean + * @param shouldListen boolean * True if we should add message listeners; false if we should remove them. - * @param aGuard string + * @param guard string * The name of a guard property of 'this', indicating whether we're * already listening for those messages. - * @param aMessageNames array of strings + * @param messageNames array of strings * An array of message names. */ BrowserTabList.prototype._listenForMessagesIf = @@ -508,6 +528,20 @@ BrowserTabList.prototype._listenForMessagesIf = } }; +/* + * This function assumes to be used as a event listener for Android document. + */ +BrowserTabList.prototype._onAndroidDocumentEvent = function(event) { + switch (event.type) { + case "DOMTitleChanged": { + const win = event.currentTarget.ownerGlobal; + const browser = win.BrowserApp.getBrowserForDocument(event.target); + this._onDOMTitleChanged(browser); + break; + } + } +}; + /** * Implement nsIMessageListener. */ @@ -516,16 +550,24 @@ BrowserTabList.prototype.receiveMessage = DevToolsUtils.makeInfallible( const browser = message.target; switch (message.name) { case "DOMTitleChanged": { - const actor = this._actorByBrowser.get(browser); - if (actor) { - this._notifyListChanged(); - this._checkListening(); - } + this._onDOMTitleChanged(browser); break; } } }); +/** + * Handle "DOMTitleChanged" event. + */ +BrowserTabList.prototype._onDOMTitleChanged = DevToolsUtils.makeInfallible( + function(browser) { + const actor = this._actorByBrowser.get(browser); + if (actor) { + this._notifyListChanged(); + this._checkListening(); + } + }); + /** * Implement nsIDOMEventListener. */ diff --git a/mobile/android/modules/geckoview/GeckoViewTab.jsm b/mobile/android/modules/geckoview/GeckoViewTab.jsm index 325dec8f6257..331907cf5b4a 100644 --- a/mobile/android/modules/geckoview/GeckoViewTab.jsm +++ b/mobile/android/modules/geckoview/GeckoViewTab.jsm @@ -53,6 +53,10 @@ class GeckoViewTab extends GeckoViewModule { getBrowserForOuterWindowID: function(aID) { return this.browser; }, + + getBrowserForDocument: function(aDocument) { + return this.selectedBrowser; + }, }; } } From 2a711de8f162b77198306ab007d43dec5bac63ea Mon Sep 17 00:00:00 2001 From: Yura Zenevich Date: Mon, 10 Dec 2018 20:43:49 +0000 Subject: [PATCH 3/8] Bug 1434888 - set accessibility panel command key to Shift + F10. r=gl MozReview-Commit-ID: HkL5dDfo0p9 Differential Revision: https://phabricator.services.mozilla.com/D14095 --- devtools/client/definitions.js | 3 ++- devtools/client/locales/en-US/startup.properties | 4 ++-- devtools/startup/devtools-startup.js | 6 ++++++ devtools/startup/locales/en-US/key-shortcuts.properties | 4 ++++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/devtools/client/definitions.js b/devtools/client/definitions.js index 8b809dcfdc89..0f47345fbafc 100644 --- a/devtools/client/definitions.js +++ b/devtools/client/definitions.js @@ -412,7 +412,8 @@ Tools.accessibility = { label: l10n("accessibility.label"), panelLabel: l10n("accessibility.panelLabel"), get tooltip() { - return l10n("accessibility.tooltip2"); + return l10n("accessibility.tooltip3", + "Shift+" + functionkey(l10n("accessibility.commandkey"))); }, inMenu: true, diff --git a/devtools/client/locales/en-US/startup.properties b/devtools/client/locales/en-US/startup.properties index 76548e515dab..82d13de32cf0 100644 --- a/devtools/client/locales/en-US/startup.properties +++ b/devtools/client/locales/en-US/startup.properties @@ -262,11 +262,11 @@ accessibility.panelLabel=Accessibility Panel # Used for the menuitem in the tool menu accessibility.accesskey=y -# LOCALIZATION NOTE (accessibility.tooltip2): +# LOCALIZATION NOTE (accessibility.tooltip3): # This string is displayed in the tooltip of the tab when the Accessibility is # displayed inside the developer tools window. # Keyboard shortcut for Accessibility panel will be shown inside the brackets. -accessibility.tooltip2=Accessibility +accessibility.tooltip3=Accessibility (%S) # LOCALIZATION NOTE (application.label): # This string is displayed in the title of the tab when the Application panel diff --git a/devtools/startup/devtools-startup.js b/devtools/startup/devtools-startup.js index 209b95b40507..53cc698a3e34 100644 --- a/devtools/startup/devtools-startup.js +++ b/devtools/startup/devtools-startup.js @@ -170,6 +170,12 @@ XPCOMUtils.defineLazyGetter(this, "KeyShortcuts", function() { shortcut: KeyShortcutsBundle.GetStringFromName("dom.commandkey"), modifiers, }, + // Key for opening the Accessibility Panel + { + toolId: "accessibility", + shortcut: KeyShortcutsBundle.GetStringFromName("accessibility.commandkey"), + modifiers: "shift", + }, ]; if (isMac) { diff --git a/devtools/startup/locales/en-US/key-shortcuts.properties b/devtools/startup/locales/en-US/key-shortcuts.properties index 3dff6a59f3ff..b33a034fc8bf 100644 --- a/devtools/startup/locales/en-US/key-shortcuts.properties +++ b/devtools/startup/locales/en-US/key-shortcuts.properties @@ -61,3 +61,7 @@ storage.commandkey=VK_F9 # LOCALIZATION NOTE (dom.commandkey): # Key pressed to open a toolbox with the DOM panel selected dom.commandkey=W + +# LOCALIZATION NOTE (accessibility.commandkey): +# Key pressed to open a toolbox with the accessibility panel selected +accessibility.commandkey=VK_F10 From 3b68fe64600a0fd0688080808173d891cd46aea0 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 10 Dec 2018 22:24:49 +0000 Subject: [PATCH 4/8] Bug 1512386. Add support for 's' flag on attribute selectors. r=emilio We could keep using ParsedCaseSensitivity::CaseSensitive as a temporary stand-in for "case-sensitive or maybe not depending on what HTML says" until we check the attribute list, but it seems better to make that explicit. Differential Revision: https://phabricator.services.mozilla.com/D14093 --- servo/components/selectors/attr.rs | 12 +- servo/components/selectors/parser.rs | 86 +++++++++---- .../attribute-case/cssom.html | 3 + .../resources/syntax-quirks.html | 2 +- .../attribute-case/resources/syntax-xml.xhtml | 2 +- .../attribute-case/semantics.html | 115 +++++++++++++++++- .../attribute-case/syntax.html | 30 ++++- 7 files changed, 221 insertions(+), 29 deletions(-) diff --git a/servo/components/selectors/attr.rs b/servo/components/selectors/attr.rs index 38612f57b647..35e678946f9c 100644 --- a/servo/components/selectors/attr.rs +++ b/servo/components/selectors/attr.rs @@ -134,8 +134,13 @@ pub static SELECTOR_WHITESPACE: &'static [char] = &[' ', '\t', '\n', '\r', '\x0C #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum ParsedCaseSensitivity { - CaseSensitive, + // 's' was specified. + ExplicitCaseSensitive, + // 'i' was specified. AsciiCaseInsensitive, + // No flags were specified and HTML says this is a case-sensitive attribute. + CaseSensitive, + // No flags were specified and HTML says this is a case-insensitive attribute. AsciiCaseInsensitiveIfInHtmlElementInHtmlDocument, } @@ -150,7 +155,10 @@ impl ParsedCaseSensitivity { ParsedCaseSensitivity::AsciiCaseInsensitiveIfInHtmlElementInHtmlDocument => { CaseSensitivity::CaseSensitive }, - ParsedCaseSensitivity::CaseSensitive => CaseSensitivity::CaseSensitive, + ParsedCaseSensitivity::CaseSensitive | + ParsedCaseSensitivity::ExplicitCaseSensitive => { + CaseSensitivity::CaseSensitive + }, ParsedCaseSensitivity::AsciiCaseInsensitive => CaseSensitivity::AsciiCaseInsensitive, } } diff --git a/servo/components/selectors/parser.rs b/servo/components/selectors/parser.rs index e8e98dbe38ef..01dcfdd99d1f 100644 --- a/servo/components/selectors/parser.rs +++ b/servo/components/selectors/parser.rs @@ -1223,6 +1223,7 @@ impl ToCss for Component { ParsedCaseSensitivity::CaseSensitive | ParsedCaseSensitivity::AsciiCaseInsensitiveIfInHtmlElementInHtmlDocument => {}, ParsedCaseSensitivity::AsciiCaseInsensitive => dest.write_str(" i")?, + ParsedCaseSensitivity::ExplicitCaseSensitive => dest.write_str(" s")?, } dest.write_char(']') }, @@ -1301,6 +1302,7 @@ impl ToCss for AttrSelectorWithOptionalNamespace { ParsedCaseSensitivity::CaseSensitive | ParsedCaseSensitivity::AsciiCaseInsensitiveIfInHtmlElementInHtmlDocument => {}, ParsedCaseSensitivity::AsciiCaseInsensitive => dest.write_str(" i")?, + ParsedCaseSensitivity::ExplicitCaseSensitive => dest.write_str(" i")?, } }, } @@ -1711,24 +1713,15 @@ where AttrSelectorOperator::Suffix => value.is_empty(), }; - let mut case_sensitivity = parse_attribute_flags(input)?; + let attribute_flags = parse_attribute_flags(input)?; let value = value.as_ref().into(); let local_name_lower; let local_name_is_ascii_lowercase; + let case_sensitivity; { let local_name_lower_cow = to_ascii_lowercase(&local_name); - if let ParsedCaseSensitivity::CaseSensitive = case_sensitivity { - if namespace.is_none() && include!(concat!( - env!("OUT_DIR"), - "/ascii_case_insensitive_html_attributes.rs" - )) - .contains(&*local_name_lower_cow) - { - case_sensitivity = - ParsedCaseSensitivity::AsciiCaseInsensitiveIfInHtmlElementInHtmlDocument - } - } + case_sensitivity = attribute_flags.to_case_sensitivity(local_name_lower_cow.as_ref(), namespace.is_some()); local_name_lower = local_name_lower_cow.as_ref().into(); local_name_is_ascii_lowercase = matches!(local_name_lower_cow, Cow::Borrowed(..)); } @@ -1758,20 +1751,67 @@ where } } +/// An attribute selector can have 's' or 'i' as flags, or no flags at all. +enum AttributeFlags { + // Matching should be case-sensitive ('s' flag). + CaseSensitive, + // Matching should be case-insensitive ('i' flag). + AsciiCaseInsensitive, + // No flags. Matching behavior depends on the name of the attribute. + CaseSensitivityDependsOnName +} + +impl AttributeFlags { + fn to_case_sensitivity( + self, + local_name: &str, + have_namespace: bool, + ) -> ParsedCaseSensitivity { + match self { + AttributeFlags::CaseSensitive => + ParsedCaseSensitivity::ExplicitCaseSensitive, + AttributeFlags::AsciiCaseInsensitive => + ParsedCaseSensitivity::AsciiCaseInsensitive, + AttributeFlags::CaseSensitivityDependsOnName => { + if !have_namespace && include!(concat!( + env!("OUT_DIR"), + "/ascii_case_insensitive_html_attributes.rs" + )) + .contains(local_name) + { + ParsedCaseSensitivity::AsciiCaseInsensitiveIfInHtmlElementInHtmlDocument + } else { + ParsedCaseSensitivity::CaseSensitive + } + } + } + } +} + fn parse_attribute_flags<'i, 't>( input: &mut CssParser<'i, 't>, -) -> Result> { +) -> Result> { let location = input.current_source_location(); - match input.next() { - Err(_) => { - // Selectors spec says language-defined, but HTML says sensitive. - Ok(ParsedCaseSensitivity::CaseSensitive) - }, - Ok(&Token::Ident(ref value)) if value.eq_ignore_ascii_case("i") => { - Ok(ParsedCaseSensitivity::AsciiCaseInsensitive) - }, - Ok(t) => Err(location.new_basic_unexpected_token_error(t.clone())), - } + let token = match input.next() { + Ok(t) => t, + Err(..) => { + // Selectors spec says language-defined; HTML says it depends on the + // exact attribute name. + return Ok(AttributeFlags::CaseSensitivityDependsOnName); + } + }; + + let ident = match *token { + Token::Ident(ref i) => i, + ref other => return Err(location.new_basic_unexpected_token_error(other.clone())), + }; + + Ok(match_ignore_ascii_case! { + ident, + "i" => AttributeFlags::AsciiCaseInsensitive, + "s" => AttributeFlags::CaseSensitive, + _ => return Err(location.new_basic_unexpected_token_error(token.clone())), + }) } /// Level 3: Parse **one** simple_selector. (Though we might insert a second diff --git a/testing/web-platform/tests/css/selectors/attribute-selectors/attribute-case/cssom.html b/testing/web-platform/tests/css/selectors/attribute-selectors/attribute-case/cssom.html index 5c01e3cc78e5..d03d820a3e6e 100644 --- a/testing/web-platform/tests/css/selectors/attribute-selectors/attribute-case/cssom.html +++ b/testing/web-platform/tests/css/selectors/attribute-selectors/attribute-case/cssom.html @@ -24,6 +24,9 @@ ['[foo="bar" i]', '[foo="bar" i]'], ['[foo="bar" /**/ i]', '[foo="bar" i]'], ['[foo="bar"/**/i]', '[foo="bar" i]'], + ['[foo="bar" s]', '[foo="bar" s]'], + ['[foo="bar" /**/ s]', '[foo="bar" s]'], + ['[foo="bar"/**/s]', '[foo="bar" s]'], ] tests.forEach(function(arr) { diff --git a/testing/web-platform/tests/css/selectors/attribute-selectors/attribute-case/resources/syntax-quirks.html b/testing/web-platform/tests/css/selectors/attribute-selectors/attribute-case/resources/syntax-quirks.html index 4606419b31c4..a7ec7e2e04f2 100644 --- a/testing/web-platform/tests/css/selectors/attribute-selectors/attribute-case/resources/syntax-quirks.html +++ b/testing/web-platform/tests/css/selectors/attribute-selectors/attribute-case/resources/syntax-quirks.html @@ -1,5 +1,5 @@ -
+
diff --git a/testing/web-platform/tests/css/selectors/attribute-selectors/attribute-case/resources/syntax-xml.xhtml b/testing/web-platform/tests/css/selectors/attribute-selectors/attribute-case/resources/syntax-xml.xhtml index 19491c94c46a..b90c2777464d 100644 --- a/testing/web-platform/tests/css/selectors/attribute-selectors/attribute-case/resources/syntax-xml.xhtml +++ b/testing/web-platform/tests/css/selectors/attribute-selectors/attribute-case/resources/syntax-xml.xhtml @@ -3,7 +3,7 @@ -
+
diff --git a/testing/web-platform/tests/css/selectors/attribute-selectors/attribute-case/semantics.html b/testing/web-platform/tests/css/selectors/attribute-selectors/attribute-case/semantics.html index 6b04fb517acc..51e5c5162841 100644 --- a/testing/web-platform/tests/css/selectors/attribute-selectors/attribute-case/semantics.html +++ b/testing/web-platform/tests/css/selectors/attribute-selectors/attribute-case/semantics.html @@ -12,6 +12,17 @@ var match = [ // [selector, attrs...] (each attr is [ns, name, value]) ["[foo='BAR'] /* sanity check (match) */", ["", "foo", "BAR"]], + ["[foo='bar'] /* sanity check (match) */", ["", "foo", "bar"]], + ["[align='left'] /* sanity check (match) */", ["", "align", "left"]], + ["[class~='a'] /* sanity check (match) */", ["", "class", "X a b"]], + ["[class~='A'] /* sanity check (match) */", ["", "class", "x A B"]], + ["[id^='a'] /* sanity check (match) */", ["", "id", "ab"]], + ["[id$='A'] /* sanity check (match) */", ["", "id", "XA"]], + ["[lang|='a'] /* sanity check (match) */", ["", "lang", "a-b"]], + ["[lang*='A'] /* sanity check (match) */", ["", "lang", "XAB"]], + ["@namespace x 'http://www.w3.org/XML/1998/namespace'; [x|lang='A'] /* sanity check (match) */", + ["http://www.w3.org/XML/1998/namespace", "lang", "A"]], + // Case-insensitive matching. ["[foo='bar' i]", ["", "foo", "BAR"]], ["[foo='' i]", ["", "foo", ""]], ["[foo='a\u0308' i] /* COMBINING in both */", ["", "foo", "A\u0308"]], @@ -32,9 +43,47 @@ ["[foo='bar' i][foo='bar' i]", ["", "foo", "BAR"]], ["[foo='BAR'][foo='bar' i]", ["", "foo", "BAR"]], ["[foo='bar' i][foo='BAR']", ["", "foo", "BAR"]], + // Case-sensitive matching. + ["[foo='bar' s]", ["", "foo", "bar"]], + ["[foo='' s]", ["", "foo", ""]], + ["[foo='a\u0308' s] /* COMBINING in both */", ["", "foo", "a\u0308"]], + ["[*|foo='bar' s]", ["", "foo", "x"], ["a", "foo", "x"], ["b", "foo", "bar"], ["c", "foo", "x"]], + ["[*|foo='bar' s]", ["", "foo", "bar"], ["a", "foo", "x"], ["b", "foo", "x"], ["c", "foo", "x"]], + ["[align='left' s]", ["", "align", "left"]], + ["[align='LEFT' s]", ["", "align", "LEFT"]], + ["[class~='a' s]", ["", "class", "x a b"]], + ["[class~='A' s]", ["", "class", "X A B"]], + ["[id^='a' s]", ["", "id", "ab"]], + ["[id$='A' s]", ["", "id", "XA"]], + ["[lang|='a' s]", ["", "lang", "a-b"]], + ["[lang*='A' s]", ["", "lang", "XAB"]], + ["[*|lang='a' s]", ["http://www.w3.org/XML/1998/namespace", "lang", "a"]], + ["[*|lang='A' s]", ["http://www.w3.org/XML/1998/namespace", "lang", "A"]], + ["@namespace x 'http://www.w3.org/XML/1998/namespace'; [x|lang='A' s]", ["http://www.w3.org/XML/1998/namespace", "lang", "A"]], + ["[foo='BAR' s][foo='BAR' s]", ["", "foo", "BAR"]], ]; + +var matchHTMLOnly = [ + ["[align='left'] /* sanity check (match HTML) */", ["", "align", "LEFT"]], + ["[align='LEFT'] /* sanity check (match HTML) */", ["", "align", "left"]], + ["[lang|='a'] /* sanity check (match HTML) */", ["", "lang", "A-B"]], + ["[lang*='A'] /* sanity check (match HTML) */", ["", "lang", "xab"]], +]; + var nomatch = [ ["[missingattr] /* sanity check (no match) */", ["", "foo", "BAR"]], + ["[foo='bar'] /* sanity check (no match) */", ["", "foo", "BAR"]], + ["[class~='a'] /* sanity check (no match) */", ["", "class", "X A B"]], + ["[class~='A'] /* sanity check (no match) */", ["", "class", "x a b"]], + ["[id^='a'] /* sanity check (no match) */", ["", "id", "AB"]], + ["[id$='A']", ["", "id", "xa"]], + ["[*|lang='a'] /* sanity check (no match) */", + ["http://www.w3.org/XML/1998/namespace", "lang", "A"]], + ["[*|lang='A'] /* sanity check (no match) */", + ["http://www.w3.org/XML/1998/namespace", "lang", "a"]], + ["@namespace x 'http://www.w3.org/XML/1998/namespace'; [x|lang='A'] /* sanity check (no match) */", + ["http://www.w3.org/XML/1998/namespace", "lang", "a"]], + // Case-insensitive matching. ["[foo='' i]", ["", "foo", "BAR"]], ["[foo='\u0000' i] /* \\0 in selector */", ["", "foo", ""]], ["[foo='' i] /* \\0 in attribute */", ["", "foo", "\u0000"]], @@ -73,6 +122,66 @@ ["@namespace x 'A'; [x|foo='' i]", ["a", "foo", ""]], ["[foo='bar' i][foo='bar']", ["", "foo", "BAR"]], ["[foo='bar' i]", ["", "baz", "BAR"]], + // Case-sensitive matching + ["[foo='' s]", ["", "foo", "BAR"]], + ["[foo='\u0000' s] /* \\0 in selector */", ["", "foo", ""]], + ["[foo='' s] /* \\0 in attribute */", ["", "foo", "\u0000"]], + ["[foo='\u00E4' s]", ["", "foo", "\u00C4"]], + ["[foo='\u00C4' s]", ["", "foo", "\u00E4"]], + ["[foo='a\u0308' s] /* COMBINING in selector */", ["", "foo", "\u00C4"]], + ["[foo~='a\u0308' s] /* COMBINING in selector */", ["", "foo", "\u00E4"]], + ["[foo^='A\u0308' s] /* COMBINING in selector */", ["", "foo", "\u00C4"]], + ["[foo$='A\u0308' s] /* COMBINING in selector */", ["", "foo", "\u00E4"]], + ["[foo*='\u00E4' s] /* COMBINING in attribute */", ["", "foo", "a\u0308"]], + ["[foo|='\u00E4' s] /* COMBINING in attribute */", ["", "foo", "A\u0308"]], + ["[foo='\u00C4' s] /* COMBINING in attribute */", ["", "foo", "a\u0308"]], + ["[foo='\u00C4' s] /* COMBINING in attribute */", ["", "foo", "A\u0308"]], + ["[foo='a\u0308' s] /* COMBINING in selector */", ["", "foo", "a"]], + ["[foo='a\u0308' s] /* COMBINING in selector */", ["", "foo", "A"]], + ["[foo='A\u0308' s] /* COMBINING in selector */", ["", "foo", "a"]], + ["[foo='A\u0308' s] /* COMBINING in selector */", ["", "foo", "A"]], + ["[foo='a' s] /* COMBINING in attribute */", ["", "foo", "a\u0308"]], + ["[foo='A' s] /* COMBINING in attribute */", ["", "foo", "a\u0308"]], + ["[foo='a' s] /* COMBINING in attribute */", ["", "foo", "A\u0308"]], + ["[foo='A' s] /* COMBINING in attribute */", ["", "foo", "A\u0308"]], + ["[foo='i' s]", ["", "foo", "\u0130"]], + ["[foo='i' s]", ["", "foo", "\u0131"]], + ["[foo='I' s]", ["", "foo", "\u0130"]], + ["[foo='I' s]", ["", "foo", "\u0131"]], + ["[foo='\u0130' s]", ["", "foo", "i"]], + ["[foo='\u0131' s]", ["", "foo", "i"]], + ["[foo='\u0130' s]", ["", "foo", "I"]], + ["[foo='\u0131' s]", ["", "foo", "I"]], + ["[foo='bar' s]", ["", "foo", "x"], ["a", "foo", "BAR"]], + ["[|foo='bar' s]", ["", "foo", "x"], ["a", "foo", "BAR"]], + ["[foo='bar' s]", ["", "FOO", "bar"]], + ["[foo='\t' s] /* tab in selector */", ["", "foo", " "]], + ["[foo=' ' s] /* tab in attribute */", ["", "foo", "\t"]], + ["@namespace x 'a'; [x|foo='' s]", ["A", "foo", ""]], + ["@namespace x 'A'; [x|foo='' s]", ["a", "foo", ""]], + ["[foo='bar' s][foo='bar']", ["", "foo", "BAR"]], + ["[foo='bar' s]", ["", "baz", "BAR"]], + ["[foo='bar' s]", ["", "foo", "BAR"]], + ["[foo='a\u0308' s] /* COMBINING in both */", ["", "foo", "A\u0308"]], + ["[foo='A\u0308' s] /* COMBINING in both */", ["", "foo", "a\u0308"]], + ["[*|foo='bar' s]", ["", "foo", "x"], ["a", "foo", "x"], ["b", "foo", "BAR"], ["c", "foo", "x"]], + ["[*|foo='bar' s]", ["", "foo", "BAR"], ["a", "foo", "x"], ["b", "foo", "x"], ["c", "foo", "x"]], + ["[align='left' s]", ["", "align", "LEFT"]], + ["[align='LEFT' s]", ["", "align", "left"]], + ["[class~='a' s]", ["", "class", "X A B"]], + ["[class~='A' s]", ["", "class", "x a b"]], + ["[id^='a' s]", ["", "id", "AB"]], + ["[id$='A' s]", ["", "id", "xa"]], + ["[lang|='a' s]", ["", "lang", "A-B"]], + ["[lang*='A' s]", ["", "lang", "xab"]], + ["[*|lang='a' s]", ["http://www.w3.org/XML/1998/namespace", "lang", "A"]], + ["[*|lang='A' s]", ["http://www.w3.org/XML/1998/namespace", "lang", "a"]], + ["@namespace x 'http://www.w3.org/XML/1998/namespace'; [x|lang='A' s]", ["http://www.w3.org/XML/1998/namespace", "lang", "a"]], + ["[foo='bar' s][foo='bar' s]", ["", "foo", "BAR"]], + ["[foo='BAR' s][foo='bar']", ["", "foo", "BAR"]], + ["[foo='bar'][foo='BAR' s]", ["", "foo", "BAR"]], + ["[foo='BAR'][foo='bar' s]", ["", "foo", "BAR"]], + ["[foo='bar' s][foo='BAR']", ["", "foo", "bar"]], ]; var mode = "standards mode"; function format_attrs(attrs) { @@ -107,7 +216,11 @@ elm.setAttributeNS(attr[0], attr[1], attr[2]); }); } - match.forEach(function(arr) { + var localMatch = match.slice(); + if (global != xml) { + localMatch.push(...matchHTMLOnly); + } + localMatch.forEach(function(arr) { var s = arr[0]; var attrs = arr.slice(1); var ns_decl = s.substr(0, "@namespace".length) == "@namespace"; diff --git a/testing/web-platform/tests/css/selectors/attribute-selectors/attribute-case/syntax.html b/testing/web-platform/tests/css/selectors/attribute-selectors/attribute-case/syntax.html index be00f624e399..e5acde100b06 100644 --- a/testing/web-platform/tests/css/selectors/attribute-selectors/attribute-case/syntax.html +++ b/testing/web-platform/tests/css/selectors/attribute-selectors/attribute-case/syntax.html @@ -5,13 +5,15 @@
-
+
+ diff --git a/layout/reftests/css-transitions/reftest.list b/layout/reftests/css-transitions/reftest.list index a66abe70f53e..da6c60aa89eb 100644 --- a/layout/reftests/css-transitions/reftest.list +++ b/layout/reftests/css-transitions/reftest.list @@ -1,3 +1,4 @@ +fuzzy-if((OSX&&!webrender)||(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!gpuProcess&&layersGPUAccelerated),1-1,10000-10000) == background-color-with-opacity.html background-color-with-opacity-ref.html == transitions-inline-already-wrapped-1.html transitions-inline-ref.html == transitions-inline-already-wrapped-2.html transitions-inline-ref.html == transitions-inline-rewrap-1.html transitions-inline-ref.html