Attention is currently required from: Thomas Nguyen.
Andy Paicu would like Thomas Nguyen to review this change.
[PEPC] Set PEPC default strings
* Add new strings for the default state
* Use said strings in the PEPC
* Ignore contents and end tag when parsing the permission element
Bug: 1462930
Change-Id: Ic42738bc338e2a9aa152b81f9647028017fc9e9a
---
M chrome/test/data/permissions/permission_element.html
M third_party/blink/public/strings/blink_strings.grd
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA_MIC.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_GEOLOCATION.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_MIC.png.sha1
M third_party/blink/renderer/core/html/html_permission_element.cc
M third_party/blink/renderer/core/html/html_permission_element.h
M third_party/blink/renderer/core/html/parser/html_tree_builder.cc
9 files changed, 63 insertions(+), 5 deletions(-)
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Thomas Nguyen.
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Andy Paicu.
4 comments:
File third_party/blink/renderer/core/html/html_permission_element.cc:
Patch Set #1, Line 80: EnsureUserAgentShadowRoot();
This one will have a conflict, let's see which CL will be landing first 😊
Patch Set #1, Line 136: UpdateText();
Can we move this right after `permission_text_` ctor? I am guessing you looked at it, just want to double check
Patch Set #1, Line 264: auto permission_descriptors = ParsePermissionDescriptorsFromString(GetType());
We can keep a local vector of permission_descriptors. In that way, we don't have to parse the descriptors again each team using, and show console error log right from here.
nit: show error if `permission_descriptors.size() == 0`
File third_party/blink/renderer/core/html/parser/html_tree_builder.cc:
We might need a test for this change, either unit or wpt test. I don't mind to do it later when we have a better shape of <permission> wpt, but make sure we note that task in our tracker list.
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Andy Paicu.
1 comment:
File third_party/blink/renderer/core/html/html_permission_element.cc:
Patch Set #1, Line 263: void HTMLPermissionElement::UpdateText() {
We might need to take into account current permission status here right. It feels like we fill the "ask" string here and re-write the string later.
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Andy Paicu.
Andy Paicu uploaded patch set #2 to this change.
[PEPC] Set PEPC default strings
* Add new strings for the default state
* Use said strings in the PEPC
* Ignore contents and end tag when parsing the permission element
Bug: 1462930
Change-Id: Ic42738bc338e2a9aa152b81f9647028017fc9e9a
---
M chrome/test/data/permissions/permission_element.html
M third_party/blink/public/strings/blink_strings.grd
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA_MIC.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_GEOLOCATION.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_MIC.png.sha1
M third_party/blink/renderer/core/html/html_permission_element.cc
M third_party/blink/renderer/core/html/html_permission_element.h
M third_party/blink/renderer/core/html/parser/html_tree_builder.cc
9 files changed, 86 insertions(+), 7 deletions(-)
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Thomas Nguyen.
Patch set 2:-Commit-Queue
5 comments:
File third_party/blink/renderer/core/html/html_permission_element.cc:
Patch Set #1, Line 80: EnsureUserAgentShadowRoot();
This one will have a conflict, let's see which CL will be landing first 😊
Done. This CL is based on the other one so now that the I've updated to the latest version which contains this, it's no longer in my CL so there won't be a conflict.
Patch Set #1, Line 136: UpdateText();
Can we move this right after `permission_text_` ctor? I am guessing you looked at it, just want to d […]
`permission_text_` is built in the same call stack as the ctor. At this point the `type` attribute has not been parsed yet so we won't have permission descriptors.
Patch Set #1, Line 263: void HTMLPermissionElement::UpdateText() {
We might need to take into account current permission status here right. […]
Yes, in the future this will need to be updated to take into account the current permission state. Added a TODO.
Patch Set #1, Line 264: auto permission_descriptors = ParsePermissionDescriptorsFromString(GetType());
We can keep a local vector of permission_descriptors. […]
Done
File third_party/blink/renderer/core/html/parser/html_tree_builder.cc:
We might need a test for this change, either unit or wpt test. […]
For now I've considered the existing browser test to implicitly test the parsing as well.
masonf@ do you know where it would be an appropriate place to test that parsing HTML results in the expected HTML elements tree?
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Thomas Nguyen.
Andy Paicu uploaded patch set #3 to this change.
[PEPC] Set PEPC default strings
* Add new strings for the default state
* Use said strings in the PEPC
* Ignore contents and end tag when parsing the permission element
Bug: 1462930
Change-Id: Ic42738bc338e2a9aa152b81f9647028017fc9e9a
---
M chrome/test/data/permissions/permission_element.html
M third_party/blink/public/strings/blink_strings.grd
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA_MIC.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_GEOLOCATION.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_MIC.png.sha1
M third_party/blink/renderer/core/html/html_permission_element.cc
M third_party/blink/renderer/core/html/html_permission_element.h
M third_party/blink/renderer/core/html/parser/html_tree_builder.cc
9 files changed, 86 insertions(+), 8 deletions(-)
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Andy Paicu.
Patch set 3:Code-Review +1
4 comments:
Patchset:
Permissions LGTM with the few comments addressed.
File third_party/blink/public/strings/blink_strings.grd:
Patch Set #3, Line 685: Allow
I think we should keep sync with the last mock strings: "Use ..." instead of "Allow ..." for media permissions, and change later if required.
File third_party/blink/renderer/core/html/html_permission_element.cc:
Patch Set #3, Line 181: Vector<PermissionDescriptorPtr> permission_descriptors =
mojo should be able to clone WFT::Vector `descriptor->permissions = mojo::Clone(permission_descriptors_);`
Patch Set #3, Line 295: Vector<mojom::blink::PermissionDescriptorPtr>
We don't need to create our own Clone function
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Andy Paicu.
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Andy Paicu.
Andy Paicu uploaded patch set #4 to this change.
[PEPC] Set PEPC default strings
* Add new strings for the default state
* Use said strings in the PEPC
* Ignore contents and end tag when parsing the permission element
Bug: 1462930
Change-Id: Ic42738bc338e2a9aa152b81f9647028017fc9e9a
---
M chrome/test/data/permissions/permission_element.html
M third_party/blink/public/strings/blink_strings.grd
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA_MIC.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_GEOLOCATION.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_MIC.png.sha1
M third_party/blink/renderer/core/html/html_permission_element.cc
M third_party/blink/renderer/core/html/html_permission_element.h
M third_party/blink/renderer/core/html/parser/html_tree_builder.cc
9 files changed, 73 insertions(+), 9 deletions(-)
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Mason Freed, Thomas Nguyen.
Andy Paicu would like Mason Freed to review this change.
[PEPC] Set PEPC default strings
* Add new strings for the default state
* Use said strings in the PEPC
* Ignore contents and end tag when parsing the permission element
Bug: 1462930
Change-Id: Ic42738bc338e2a9aa152b81f9647028017fc9e9a
---
M chrome/test/data/permissions/permission_element.html
M third_party/blink/public/strings/blink_strings.grd
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA_MIC.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_GEOLOCATION.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_MIC.png.sha1
M third_party/blink/renderer/core/html/html_permission_element.cc
M third_party/blink/renderer/core/html/html_permission_element.h
M third_party/blink/renderer/core/html/parser/html_tree_builder.cc
9 files changed, 73 insertions(+), 9 deletions(-)
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Mason Freed, Thomas Nguyen.
5 comments:
Patchset:
Thank you Thomas.
Patchset:
Thank you Thomas.
Mason, PTAL.
File third_party/blink/public/strings/blink_strings.grd:
Patch Set #3, Line 685: Allow
I think we should keep sync with the last mock strings: "Use ..." instead of "Allow ... […]
These strings are based on the "PEPC in Meet" slides so I think they have the highest chance of not needing to be changed for the OT.
File third_party/blink/renderer/core/html/html_permission_element.cc:
Patch Set #3, Line 181: Vector<PermissionDescriptorPtr> permission_descriptors =
mojo should be able to clone WFT::Vector `descriptor->permissions = mojo::Clone(permission_descripto […]
Done. I didn't know about this function. TY.
Patch Set #3, Line 295: Vector<mojom::blink::PermissionDescriptorPtr>
We don't need to create our own Clone function
Done
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Andy Paicu, Mason Freed.
Patch set 4:Code-Review +1
1 comment:
File third_party/blink/public/strings/blink_strings.grd:
Patch Set #3, Line 685: Allow
These strings are based on the "PEPC in Meet" slides so I think they have the highest chance of not […]
Acknowledged. Fine, given that we are still waiting for a final string approval.
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Andy Paicu, Mason Freed.
1 comment:
File third_party/blink/renderer/core/html/html_permission_element.cc:
nit: we don't need this forward header? Found that when I cherry-pick this CL
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Andy Paicu, Mason Freed.
Andy Paicu uploaded patch set #5 to this change.
[PEPC] Set PEPC default strings
* Add new strings for the default state
* Use said strings in the PEPC
* Ignore contents and end tag when parsing the permission element
Bug: 1462930
Change-Id: Ic42738bc338e2a9aa152b81f9647028017fc9e9a
---
M chrome/test/data/permissions/permission_element.html
M third_party/blink/public/strings/blink_strings.grd
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA_MIC.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_GEOLOCATION.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_MIC.png.sha1
M third_party/blink/renderer/core/html/html_permission_element.cc
M third_party/blink/renderer/core/html/html_permission_element.h
M third_party/blink/renderer/core/html/parser/html_tree_builder.cc
9 files changed, 72 insertions(+), 9 deletions(-)
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Mason Freed.
2 comments:
Patchset:
Hi Mason, friendly ping on this.
File third_party/blink/renderer/core/html/html_permission_element.cc:
nit: we don't need this forward header? Found that when I cherry-pick this CL
Done
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Claudio M, Mason Freed.
Andy Paicu would like Claudio M to review this change.
[PEPC] Set PEPC default strings
* Add new strings for the default state
* Use said strings in the PEPC
* Ignore contents and end tag when parsing the permission element
Bug: 1462930
Change-Id: Ic42738bc338e2a9aa152b81f9647028017fc9e9a
---
M chrome/test/data/permissions/permission_element.html
M third_party/blink/public/strings/blink_strings.grd
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA_MIC.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_GEOLOCATION.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_MIC.png.sha1
M third_party/blink/renderer/core/html/html_permission_element.cc
M third_party/blink/renderer/core/html/html_permission_element.h
M third_party/blink/renderer/core/html/parser/html_tree_builder.cc
9 files changed, 72 insertions(+), 9 deletions(-)
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Claudio M, Mason Freed.
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Andy Paicu, Claudio M, Thomas Nguyen.
5 comments:
File third_party/blink/public/strings/blink_strings.grd:
Nit: `REQUEST_MICROPHONE` - no need to abbreviate
Patch Set #4, Line 687: rigger a camera and microphone request
That seems wrong
File third_party/blink/renderer/core/html/html_permission_element.cc:
Patch Set #4, Line 135: permission_descriptors_
Can you add
`DCHECK(!permission_descriptors_);`
here?
Should there be a `CHECK` that `size()` is not greater than 2? It seems like the code understands 0, 1, or 2.
File third_party/blink/renderer/core/html/parser/html_tree_builder.cc:
For now I've considered the existing browser test to implicitly test the parsing as well. […]
Theoretically, html5lib tests can be added:
https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/web_tests/html5lib/;bpv=1
But the state of that test harness is sketchy at the moment. I think if it were me, I'd add a new folder somewhere under here:
and add manual tests of the permission element. I do agree this needs some testing.
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Andy Paicu, Claudio M, Thomas Nguyen.
1 comment:
Patchset:
Hi Mason, friendly ping on this.
Sorry for the delay - I was OOO but forgot to set my status accordingly.
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Andy Paicu, Claudio M, Thomas Nguyen.
Andy Paicu uploaded patch set #6 to this change.
The following approvals got outdated and were removed: Code-Review+1 by Thomas Nguyen
[PEPC] Set PEPC default strings
* Add new strings for the default state
* Use said strings in the PEPC
* Ignore contents and end tag when parsing the permission element
Bug: 1462930
Change-Id: Ic42738bc338e2a9aa152b81f9647028017fc9e9a
---
M chrome/test/data/permissions/permission_element.html
M third_party/blink/public/strings/blink_strings.grd
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA_MICROPHONE.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_GEOLOCATION.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_MICROPHONE.png.sha1
M third_party/blink/renderer/core/html/html_permission_element.cc
M third_party/blink/renderer/core/html/html_permission_element.h
M third_party/blink/renderer/core/html/parser/html_tree_builder.cc
9 files changed, 76 insertions(+), 9 deletions(-)
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Claudio M, Mason Freed, Thomas Nguyen.
5 comments:
File third_party/blink/public/strings/blink_strings.grd:
Nit: `REQUEST_MICROPHONE` - no need to abbreviate
Done
Patch Set #4, Line 687: rigger a camera and microphone request
That seems wrong
Done
File third_party/blink/renderer/core/html/html_permission_element.cc:
Patch Set #4, Line 135: permission_descriptors_
Can you add […]
Done
Should there be a `CHECK` that `size()` is not greater than 2? It seems like the code understands 0, […]
Done
File third_party/blink/renderer/core/html/parser/html_tree_builder.cc:
Theoretically, html5lib tests can be added: […]
I've tried adding the permission element to the "interfaces.html" test in that directory for now but it fails because the `PermissionElement` feature is not enabled. Do you know if there is a standard approach to enable a chrome feature in WPT tests?
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Andy Paicu, Claudio M, Thomas Nguyen.
I've tried adding the permission element to the "interfaces. […]
Yes, just mark it experimental in runtime_enabled_features:
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Andy Paicu, Claudio M, Thomas Nguyen.
* Add new strings for the default state
* Use said strings in the PEPC
* Ignore contents and end tag when parsing the permission element
Bug: 1462930
Change-Id: Ic42738bc338e2a9aa152b81f9647028017fc9e9a
---
M chrome/test/data/permissions/permission_element.html
M third_party/blink/public/strings/blink_strings.grd
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA_MICROPHONE.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_GEOLOCATION.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_MICROPHONE.png.sha1
M third_party/blink/renderer/core/html/html_permission_element.cc
M third_party/blink/renderer/core/html/html_permission_element.h
M third_party/blink/renderer/core/html/parser/html_tree_builder.cc
M third_party/blink/renderer/platform/runtime_enabled_features.json5
M third_party/blink/web_tests/external/wpt/html/semantics/interfaces.js
A third_party/blink/web_tests/external/wpt/html/semantics/permission-element/no-end-tag-no-contents.html
12 files changed, 97 insertions(+), 12 deletions(-)
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Claudio M, Mason Freed, Thomas Nguyen.
1 comment:
File third_party/blink/renderer/core/html/parser/html_tree_builder.cc:
Yes, just mark it experimental in runtime_enabled_features: […]
Thank you. I've added a basic parsing test. PTAL
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Claudio M, Mason Freed, Thomas Nguyen.
Exportable changes to web-platform-tests were detected in this CL and a pull request in the upstream repo has been made: https://github.com/web-platform-tests/wpt/pull/42205.
When this CL lands, the bot will automatically merge the PR on GitHub if the required GitHub checks pass; otherwise, ecosystem-infra@ team will triage the failures and may contact you.
WPT Export docs:
https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md#Automatic-export-process
Attention is currently required from: Andy Paicu, Claudio M, Thomas Nguyen.
Patch set 7:Code-Review +1
3 comments:
Patchset:
LGTM! Looks like you'll need to rebaseline a couple tests though. And a few comments on the test.
File third_party/blink/web_tests/external/wpt/html/semantics/permission-element/no-end-tag-no-contents.html:
Patch Set #7, Line 6: The permission element should have no end tag or content
This is a good test, but it seems like maybe you could add a few more? Like what happens when it's inside a <template> element? Inside a table? In the <head>? Emitted by a `document.write()`? Parsed by `innerHTML`? Inside an <iframe>? Inside a `display:none` subtree?
Definitely feel free to take these as action items for a followup CL - it just seems like there should be more testing of the parsing or DOM tree behavior.
Patch Set #7, Line 16: document.body.innerText, "this is some text"
This would be true either way, since the inner text for a content-containing <permission> element would just be that same contained text.
Perhaps do:
```
const permissionElement = document.body.children[0];
assert_true(permissionElement instanceof HTMLPermissionElement,...);
const nextText = permissionElement.nextSibling;
assert_true(nextText instanceof Text);
assert_equals(nextText.innerText,"this is some text");
```
or something similar?
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Andy Paicu, Thomas Nguyen.
1 comment:
Patchset:
I can only review addition of new languages, so you'll have to find another reviewer for third_party/blink/public/strings/blink_strings.grd
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Andy Paicu, Mason Freed, Thomas Nguyen.
Andy Paicu uploaded patch set #8 to this change.
The following approvals got outdated and were removed: Code-Review+1 by Mason Freed
[PEPC] Set PEPC default strings
* Add new strings for the default state
* Use said strings in the PEPC
* Ignore contents and end tag when parsing the permission element
Bug: 1462930
Change-Id: Ic42738bc338e2a9aa152b81f9647028017fc9e9a
---
M chrome/test/data/permissions/permission_element.html
M third_party/blink/public/strings/blink_strings.grd
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA_MICROPHONE.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_GEOLOCATION.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_MICROPHONE.png.sha1
M third_party/blink/renderer/core/html/html_permission_element.cc
M third_party/blink/renderer/core/html/html_permission_element.h
M third_party/blink/renderer/core/html/parser/html_tree_builder.cc
M third_party/blink/renderer/platform/runtime_enabled_features.json5
M third_party/blink/web_tests/external/wpt/html/semantics/interfaces.js
A third_party/blink/web_tests/external/wpt/html/semantics/permission-element/no-end-tag-no-contents.html
M third_party/blink/web_tests/webexposed/element-instance-property-listing-expected.txt
M third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt
14 files changed, 110 insertions(+), 12 deletions(-)
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Mason Freed, Thomas Nguyen.
2 comments:
File third_party/blink/web_tests/external/wpt/html/semantics/permission-element/no-end-tag-no-contents.html:
Patch Set #7, Line 6: The permission element should have no end tag or content
This is a good test, but it seems like maybe you could add a few more? Like what happens when it's i […]
I added a task to add more parsing tests in a future CL.
Patch Set #7, Line 16: document.body.innerText, "this is some text"
This would be true either way, since the inner text for a content-containing <permission> element wo […]
Perhaps I'm misunderstanding but that doesn't seem to be the case. When running this test without the `parser/html_tree_builder.cc` changes, `document.body.innerText` is an empty string (which makes sense since it has 2 child elements (`permission` & `script`) and no text). The `permission` element has the innerText set in this case.
With the parser changes added back in, there are still the 2 child elements created, however the text is added to `document.body` (not as a child element just as inner text) and the end tag `</permission>` is simply discarded.
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
File third_party/blink/web_tests/external/wpt/html/semantics/permission-element/no-end-tag-no-contents.html:
Patch Set #7, Line 16: document.body.innerText, "this is some text"
Perhaps I'm misunderstanding but that doesn't seem to be the case. […]
I'm confused. The `innerText` property [1] returns the text content of the provided element *plus* its descendants. So `document.body.innerText` should always contain the "this is some text" text in this example, whether it's a direct child of the body or whether the `<permission>` element contains that text.
I tried it here: https://jsbin.com/cilahaw/1/edit?html,output
Help me see what I'm missing.
[1] https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/innerText
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Andy Paicu.
1 comment:
File third_party/blink/renderer/core/html/html_permission_element.cc:
Patch Set #8, Line 275: CHECK_LE
Hmm, we don't have a bound check of `type`, and it's still free to add > 3 permission types in <permission> element. Consequently, this check dies with a fatal error without giving any hints. We have to add a size limit at "AttributeChanged" either in this CL or in the next CL.
If you are not going to add the size limit here, I don't mind to add it in the next CL.
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Andy Paicu.
* Add new strings for the default state
* Use said strings in the PEPC
* Ignore contents and end tag when parsing the permission element
Bug: 1462930
Change-Id: Ic42738bc338e2a9aa152b81f9647028017fc9e9a
---
M chrome/test/data/permissions/permission_element.html
M third_party/blink/public/strings/blink_strings.grd
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA_MICROPHONE.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_GEOLOCATION.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_MICROPHONE.png.sha1
M third_party/blink/renderer/core/html/html_permission_element.cc
M third_party/blink/renderer/core/html/html_permission_element.h
M third_party/blink/renderer/core/html/parser/html_tree_builder.cc
M third_party/blink/renderer/platform/runtime_enabled_features.json5
M third_party/blink/web_tests/external/wpt/html/semantics/interfaces.js
A third_party/blink/web_tests/external/wpt/html/semantics/permission-element/no-end-tag-no-contents.html
M third_party/blink/web_tests/webexposed/element-instance-property-listing-expected.txt
M third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt
14 files changed, 123 insertions(+), 12 deletions(-)
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
File third_party/blink/renderer/core/html/html_permission_element.cc:
Patch Set #8, Line 275: CHECK_LE
Hmm, we don't have a bound check of `type`, and it's still free to add > 3 permission types in <perm […]
Added a TODO for a later CL.
File third_party/blink/web_tests/external/wpt/html/semantics/permission-element/no-end-tag-no-contents.html:
Patch Set #7, Line 16: document.body.innerText, "this is some text"
I'm confused. […]
Ah I see. Our current implementation of the `<permission>` element does not return the inside text (I assume we would need to implement/override something in order to make it work correctly). So `<permission>.innerText` always returned the empty text which lead me to the false assumption that `innerText` is only the direct text, not including descendants.
You can try this in the example jsbin: if you run chrome with `--enable-features=PermissionElement --enable-blink-features=PermissionElement`, it will only alert "aaa".
Now that I know that `innerText` should, in a correct implementation, return all the text, I've reworked the test. PTAL.
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Kinuko Yasuda, Mason Freed, Thomas Nguyen.
Andy Paicu would like Kinuko Yasuda to review this change.
[PEPC] Set PEPC default strings
* Add new strings for the default state
* Use said strings in the PEPC
* Ignore contents and end tag when parsing the permission element
Bug: 1462930
Change-Id: Ic42738bc338e2a9aa152b81f9647028017fc9e9a
---
M chrome/test/data/permissions/permission_element.html
M third_party/blink/public/strings/blink_strings.grd
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA_MICROPHONE.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_GEOLOCATION.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_MICROPHONE.png.sha1
M third_party/blink/renderer/core/html/html_permission_element.cc
M third_party/blink/renderer/core/html/html_permission_element.h
M third_party/blink/renderer/core/html/parser/html_tree_builder.cc
M third_party/blink/renderer/platform/runtime_enabled_features.json5
M third_party/blink/web_tests/external/wpt/html/semantics/interfaces.js
A third_party/blink/web_tests/external/wpt/html/semantics/permission-element/no-end-tag-no-contents.html
M third_party/blink/web_tests/webexposed/element-instance-property-listing-expected.txt
M third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt
14 files changed, 123 insertions(+), 12 deletions(-)
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Kinuko Yasuda, Mason Freed, Thomas Nguyen.
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Andy Paicu, Kinuko Yasuda, Thomas Nguyen.
Patch set 9:Code-Review +1
2 comments:
Patchset:
Still LGTM, thanks.
File third_party/blink/web_tests/external/wpt/html/semantics/permission-element/no-end-tag-no-contents.html:
Patch Set #7, Line 16: document.body.innerText, "this is some text"
Ah I see. […]
Hmm, you might check in here to see why permission element content isn't being output:
https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/editing/element_inner_text.cc;l=91;drc=f5bdc89c7395ed24f1b8d196a3bdd6232d5bf771
But thanks for reworking the test.
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Andy Paicu, Kinuko Yasuda.
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Andy Paicu.
Patch set 9:Code-Review +1
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
To view, visit change 4875313. To unsubscribe, or for help writing mail filters, visit settings.
Chromium LUCI CQ submitted this change.
[PEPC] Set PEPC default strings
* Add new strings for the default state
* Use said strings in the PEPC
* Ignore contents and end tag when parsing the permission element
Bug: 1462930
Change-Id: Ic42738bc338e2a9aa152b81f9647028017fc9e9a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4875313
Reviewed-by: Thomas Nguyen <tun...@chromium.org>
Reviewed-by: Mason Freed <mas...@chromium.org>
Reviewed-by: Kinuko Yasuda <kin...@chromium.org>
Commit-Queue: Andy Paicu <andy...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1206337}
---
M chrome/test/data/permissions/permission_element.html
M third_party/blink/public/strings/blink_strings.grd
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_CAMERA_MICROPHONE.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_GEOLOCATION.png.sha1
A third_party/blink/public/strings/blink_strings_grd/IDS_PERMISSION_REQUEST_MICROPHONE.png.sha1
M third_party/blink/renderer/core/html/html_permission_element.cc
M third_party/blink/renderer/core/html/html_permission_element.h
M third_party/blink/renderer/core/html/parser/html_tree_builder.cc
M third_party/blink/renderer/platform/runtime_enabled_features.json5
M third_party/blink/web_tests/external/wpt/html/semantics/interfaces.js
A third_party/blink/web_tests/external/wpt/html/semantics/permission-element/no-end-tag-no-contents.html
M third_party/blink/web_tests/webexposed/element-instance-property-listing-expected.txt
M third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt
14 files changed, 123 insertions(+), 12 deletions(-)
The WPT PR for this CL has been merged upstream! https://github.com/web-platform-tests/wpt/pull/42205