forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1830909 - Implement <hr> in <select> r=hsivonen,emilio,geckoview-…
…reviewers,desktop-theme-reviewers,Jamie,owlish Updated HTML parser to allow <hr> in <select>. Updated internal toolkit UI for <select> dropdown to create menuseperators for hrs. Updated WPT expectations: - HTML5Lib WebKit parsing for it now passes 100% Also includes Android support, but Fenix does not support separators in the menus used (single/multiple) yet so they are not rendered. Differential Revision: https://phabricator.services.mozilla.com/D189065
- Loading branch information
1 parent
289e9fb
commit a1eb267
Showing
10 changed files
with
186 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
add_task(async function test_hr() { | ||
await SpecialPowers.pushPrefEnv({ | ||
set: [["dom.forms.select.customstyling", true]], | ||
}); | ||
|
||
const PAGE_CONTENT = ` | ||
<!doctype html> | ||
<select> | ||
<option>One</option> | ||
<hr style="color: red; background-color: blue"> | ||
<option>Two</option> | ||
</select>`; | ||
|
||
const pageUrl = "data:text/html," + encodeURIComponent(PAGE_CONTENT); | ||
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, pageUrl); | ||
|
||
const selectPopup = await openSelectPopup("click"); | ||
const menulist = selectPopup.parentNode; | ||
|
||
const optionOne = selectPopup.children[0]; | ||
const separator = selectPopup.children[1]; | ||
const optionTwo = selectPopup.children[2]; | ||
|
||
is(optionOne.textContent, "One", "First option has expected text content"); | ||
|
||
is(separator.tagName, "menuseparator", "Separator is menuseparator"); | ||
|
||
const separatorStyle = getComputedStyle(separator); | ||
|
||
is( | ||
separatorStyle.color, | ||
"rgb(255, 0, 0)", | ||
"Separator color is specified CSS color" | ||
); | ||
|
||
is( | ||
separatorStyle.backgroundColor, | ||
"rgba(0, 0, 0, 0)", | ||
"Separator background-color is not set to specified CSS color" | ||
); | ||
|
||
is(optionTwo.textContent, "Two", "Second option has expected text content"); | ||
|
||
is(menulist.activeChild, optionOne, "First option is selected to start"); | ||
|
||
EventUtils.synthesizeKey("KEY_ArrowDown"); | ||
|
||
is( | ||
menulist.activeChild, | ||
optionTwo, | ||
"Second option is selected after arrow down" | ||
); | ||
|
||
BrowserTestUtils.removeTab(tab); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 0 additions & 100 deletions
100
testing/web-platform/meta/html/syntax/parsing/html5lib_webkit02.html.ini
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.