Handle navigation to data: urls for browsingContext.navigate
Categories
(Remote Protocol :: WebDriver BiDi, task, P1)
Tracking
(firefox103 fixed)
Tracking | Status | |
---|---|---|
firefox103 | --- | fixed |
People
(Reporter: jdescottes, Assigned: Sasha)
References
(Blocks 1 open bug)
Details
(Whiteboard: [webdriver:m4] [wptsync upstream])
Attachments
(2 files, 1 obsolete file)
Follow up to handle more specific navigation use cases.
We should support navigation to data: urls
Updated•2 years ago
|
Comment 1•2 years ago
|
||
As discussed we will try to have a look next week as long as we are working on navigation in M3. For this bug we most likely only require some wdspec tests to be added.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
Updated•2 years ago
|
Pushed by aborovova@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5f71c02fadb3 Add wdspec tests for browsingContext.navigate to data: urls. r=webdriver-reviewers,whimboo
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/34182 for changes under testing/web-platform/tests
Comment 5•2 years ago
|
||
Backed out for causing webdriver failures on data_url.py.
Failure log: https://treeherder.mozilla.org/logviewer?job_id=379107578&repo=autoland
Backout link: https://hg.mozilla.org/integration/autoland/rev/40e36555b6e25170ce7828bfe83e4b6c3dbce773
[task 2022-05-24T12:14:34.652Z] 12:14:34 INFO - TEST-PASS | /webdriver/tests/bidi/browsing_context/navigate/data_url.py | test_navigate_from_single_page[document to data:image]
[task 2022-05-24T12:14:34.652Z] 12:14:34 INFO - TEST-UNEXPECTED-FAIL | /webdriver/tests/bidi/browsing_context/navigate/data_url.py | test_navigate_from_single_page[data:image to data:image] - webdriver.bidi.error.UnknownErrorException: unknown error (Error: NS_ERROR_PARSED_DATA_CACHED)
[task 2022-05-24T12:14:34.652Z] 12:14:34 INFO - bidi_session = <webdriver.bidi.client.BidiSession object at 0x7f2d1472e780>
[task 2022-05-24T12:14:34.652Z] 12:14:34 INFO - new_tab = {'children': None, 'context': '3dfb77b2-4cf6-4bcc-8658-f30424a971f2', 'parent': None, 'url': 'about:blank'}
[task 2022-05-24T12:14:34.653Z] 12:14:34 INFO - url = <function url.<locals>.url at 0x7f2d14783730>
[task 2022-05-24T12:14:34.653Z] 12:14:34 INFO - url_before = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg%3D%3D'
[task 2022-05-24T12:14:34.653Z] 12:14:34 INFO - url_after = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlPM0jRW/QAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII%3D'
[task 2022-05-24T12:14:34.653Z] 12:14:34 INFO -
[task 2022-05-24T12:14:34.654Z] 12:14:34 INFO - @pytest.mark.parametrize(
[task 2022-05-24T12:14:34.654Z] 12:14:34 INFO - "url_before, url_after",
[task 2022-05-24T12:14:34.654Z] 12:14:34 INFO - [
[task 2022-05-24T12:14:34.654Z] 12:14:34 INFO - (PAGE, IMG_BLACK_PIXEL),
[task 2022-05-24T12:14:34.655Z] 12:14:34 INFO - (IMG_BLACK_PIXEL, IMG_RED_PIXEL),
[task 2022-05-24T12:14:34.655Z] 12:14:34 INFO - (IMG_BLACK_PIXEL, HTML_FOO),
[task 2022-05-24T12:14:34.655Z] 12:14:34 INFO - (IMG_BLACK_PIXEL, PAGE),
[task 2022-05-24T12:14:34.656Z] 12:14:34 INFO - (PAGE, HTML_FOO),
[task 2022-05-24T12:14:34.656Z] 12:14:34 INFO - (HTML_FOO, TEXT_FOO),
[task 2022-05-24T12:14:34.657Z] 12:14:34 INFO - (HTML_FOO, HTML_BAR),
[task 2022-05-24T12:14:34.657Z] 12:14:34 INFO - (HTML_FOO, PAGE),
[task 2022-05-24T12:14:34.657Z] 12:14:34 INFO - (PAGE, TEXT_FOO),
[task 2022-05-24T12:14:34.658Z] 12:14:34 INFO - (TEXT_FOO, TEXT_BAR),
[task 2022-05-24T12:14:34.658Z] 12:14:34 INFO - (TEXT_FOO, IMG_BLACK_PIXEL),
[task 2022-05-24T12:14:34.658Z] 12:14:34 INFO - (TEXT_FOO, PAGE),
[task 2022-05-24T12:14:34.659Z] 12:14:34 INFO - ],
[task 2022-05-24T12:14:34.659Z] 12:14:34 INFO - ids=[
[task 2022-05-24T12:14:34.659Z] 12:14:34 INFO - "document to data:image",
[task 2022-05-24T12:14:34.659Z] 12:14:34 INFO - "data:image to data:image",
[task 2022-05-24T12:14:34.659Z] 12:14:34 INFO - "data:image to data:html",
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - "data:image to document",
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - "document to data:html",
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - "data:html to data:html",
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - "data:html to data:text",
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - "data:html to document",
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - "document to data:text",
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - "data:text to data:text",
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - "data:text to data:image",
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - "data:text to document",
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - ],
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - )
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - async def test_navigate_from_single_page(
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - bidi_session, new_tab, url, url_before, url_after
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - ):
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - await navigate_and_assert(
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - bidi_session,
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - new_tab,
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - > wrap_content_in_url(url, url_before),
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - )
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO -
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - bidi_session = <webdriver.bidi.client.BidiSession object at 0x7f2d1472e780>
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - new_tab = {'children': None,
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - 'context': '3dfb77b2-4cf6-4bcc-8658-f30424a971f2',
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - 'parent': None,
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - 'url': 'about:blank'}
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - url = <function url.<locals>.url at 0x7f2d14783730>
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - url_after = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlPM0jRW/QAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII%3D'
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - url_before = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg%3D%3D'
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO -
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - tests/web-platform/tests/webdriver/tests/bidi/browsing_context/navigate/data_url.py:83:
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - tests/web-platform/tests/webdriver/tests/bidi/browsing_context/navigate/__init__.py:15: in navigate_and_assert
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - context=context['context'], url=url, wait=wait
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - bidi_session = <webdriver.bidi.client.BidiSession object at 0x7f2d1472e780>
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - context = {'children': None,
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - 'context': '3dfb77b2-4cf6-4bcc-8658-f30424a971f2',
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - 'parent': None,
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - 'url': 'about:blank'}
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - expected_error = False
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - url = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg%3D%3D'
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - wait = 'complete'
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO -
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - self = <webdriver.bidi.modules.browsing_context.BrowsingContext object at 0x7f2d1472e5c0>
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - kwargs = {'context': '3dfb77b2-4cf6-4bcc-8658-f30424a971f2', 'url': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg%3D%3D', 'wait': 'complete'}
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - params = {'context': '3dfb77b2-4cf6-4bcc-8658-f30424a971f2', 'url': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg%3D%3D', 'wait': 'complete'}
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - mod_name = 'browsingContext', cmd_name = 'browsingContext.navigate'
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - future = <Future finished exception=UnknownErrorException(unknown error, Error: NS_ERROR_PARSED_DATA_CACHED, #checkLoadingState@chrome://remote/content/shared/Navigate.jsm:209:28
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - onStateChange@chrome://remote/content/shared/Navigate.jsm:254:28
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - )>
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO -
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - @functools.wraps(params_fn)
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - async def inner(self: Any, **kwargs: Any) -> Any:
[task 2022-05-24T12:14:34.660Z] 12:14:34 INFO - params = params_fn(self, **kwargs)
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO -
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - # Convert the classname and the method name to a bidi command name
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - mod_name = owner.__name__[0].lower() + owner.__name__[1:]
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - if hasattr(owner, "prefix"):
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - mod_name = f"{owner.prefix}:{mod_name}"
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - cmd_name = f"{mod_name}.{to_camelcase(name)}"
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO -
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - future = await self.session.send_command(cmd_name, params)
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - > result = await future
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - E webdriver.bidi.error.UnknownErrorException: unknown error (Error: NS_ERROR_PARSED_DATA_CACHED)
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - E
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - E Remote-end stacktrace:
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - E
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - E #checkLoadingState@chrome://remote/content/shared/Navigate.jsm:209:28
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - E onStateChange@chrome://remote/content/shared/Navigate.jsm:254:28
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO -
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - cmd_name = 'browsingContext.navigate'
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - future = <Future finished exception=UnknownErrorException(unknown error, Error: NS_ERROR_PARSED_DATA_CACHED, #checkLoadingState@chrome://remote/content/shared/Navigate.jsm:209:28
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - onStateChange@chrome://remote/content/shared/Navigate.jsm:254:28
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - )>
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - kwargs = {'context': '3dfb77b2-4cf6-4bcc-8658-f30424a971f2',
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - 'url': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg%3D%3D',
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - 'wait': 'complete'}
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - mod_name = 'browsingContext'
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - name = 'navigate'
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - owner = <class 'webdriver.bidi.modules.browsing_context.BrowsingContext'>
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - params = {'context': '3dfb77b2-4cf6-4bcc-8658-f30424a971f2',
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - 'url': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg%3D%3D',
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - 'wait': 'complete'}
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - params_fn = <function BrowsingContext.navigate at 0x7f2d2e83d7b8>
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - result_fn = <function BrowsingContext._navigate at 0x7f2d2e83d840>
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - self = <webdriver.bidi.modules.browsing_context.BrowsingContext object at 0x7f2d1472e5c0>
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO -
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - tests/web-platform/tests/tools/webdriver/webdriver/bidi/modules/_module.py:62: UnknownErrorException
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO -
[task 2022-05-24T12:14:34.661Z] 12:14:34 INFO - TEST-UNEXPECTED-FAIL | /webdriver/tests/bidi/browsing_context/navigate/data_url.py | test_navigate_from_single_page[data:image to data:html] - webdriver.bidi.error.UnknownErrorException: unknown error (Error: NS_ERROR_PARSED_DATA_CACHED)
Upstream PR was closed without merging
Reporter | ||
Updated•2 years ago
|
Assignee | ||
Comment 7•2 years ago
|
||
Assignee | ||
Comment 8•2 years ago
|
||
Depends on D146703
Updated•2 years ago
|
Assignee | ||
Comment 9•2 years ago
•
|
||
We receive NS_ERROR_PARSED_DATA_CACHED
error in non-fision builds when we navigate in the wdspec tests second time to the same data:image. But navigation actually happens, and the image is present on the page. Also, judging by this comment (https://searchfox.org/mozilla-central/source/xpcom/base/ErrorList.py#951-953) and what seems to be a similar case (https://searchfox.org/mozilla-central/rev/9902932742fcdce2c956eeb81fd38350f5394ab2/layout/base/nsDocumentViewer.cpp#959-964), it looks like we could consider this error as success.
Assignee | ||
Comment 10•2 years ago
•
|
||
hey Nika, we would like to write a logic to ignore NS_ERROR_PARSED_DATA_CACHED
but right now it's not very easy since we can not access it with Cr
(Cr.NS_ERROR_PARSED_DATA_CACHED = undefined
), most likely because it's not listed in https://searchfox.org/mozilla-central/source/js/xpconnect/src/xpc.msg. Would it be fine to add it there? Is there maybe any downside?
Comment 11•2 years ago
|
||
IIRC it should be fine to add another error to that file.
Comment 12•2 years ago
|
||
Pushed by aborovova@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8db3bcc8d757 Add wdspec tests for browsingContext.navigate to data: urls. r=webdriver-reviewers,whimboo https://hg.mozilla.org/integration/autoland/rev/ab48b81d2cb3 Ignore cache error in browsingContext.navigate. r=webdriver-reviewers,whimboo,nika,jdescottes
Comment 13•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8db3bcc8d757
https://hg.mozilla.org/mozilla-central/rev/ab48b81d2cb3
Upstream PR merged by moz-wptsync-bot
Comment hidden (obsolete) |
Comment 16•2 years ago
|
||
(In reply to Alex Finder from comment #15)
Ratio Test Platform Options Absolute values (old vs new) 6% twitter fcp windows10-64-shippable-qr fission warm webrender 100.40 -> 94.62 For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=34334
This improvement is clearly not for this change which basically only added a new string to the Firefox code but otherwise only new tests.
Comment 17•2 years ago
|
||
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+1] from comment #16)
This improvement is clearly not for this change which basically only added a new string to the Firefox code but otherwise only new tests.
I've asked on Element and the alert got re-assigned to bug 1770885.
Description
•