Plumb Document to MediaQueryExpValue::Consume() [chromium/src : main]

0 views
Skip to first unread message

Alison Maher (Gerrit)

unread,
Apr 15, 2024, 4:39:50 PMApr 15
to Kevin Babbitt, Rune Lillesveen, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, Nate Chapin, Kenneth Rohde Christiansen, Yoav Weiss (@Shopify), apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, dmurph+watch...@chromium.org, dominickn+wa...@chromium.org, feature-me...@chromium.org, gavinp...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, loading...@chromium.org, webap...@microsoft.com
Attention needed from Kevin Babbitt and Rune Lillesveen

Alison Maher voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Kevin Babbitt
  • Rune Lillesveen
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id4ba07f79b202bb81351ed4f8a6fab9d55cc03da
Gerrit-Change-Number: 5451504
Gerrit-PatchSet: 9
Gerrit-Owner: Alison Maher <alm...@microsoft.com>
Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
Gerrit-Reviewer: Kevin Babbitt <kbab...@microsoft.com>
Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-CC: Kenneth Rohde Christiansen <kenneth.ch...@gmail.com>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
Gerrit-Attention: Kevin Babbitt <kbab...@microsoft.com>
Gerrit-Attention: Rune Lillesveen <fut...@chromium.org>
Gerrit-Comment-Date: Mon, 15 Apr 2024 20:39:40 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Rune Lillesveen (Gerrit)

unread,
Apr 15, 2024, 5:41:30 PMApr 15
to Alison Maher, Kevin Babbitt, Rune Lillesveen, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, Nate Chapin, Kenneth Rohde Christiansen, Yoav Weiss (@Shopify), apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, dmurph+watch...@chromium.org, dominickn+wa...@chromium.org, feature-me...@chromium.org, gavinp...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, loading...@chromium.org, webap...@microsoft.com
Attention needed from Alison Maher and Kevin Babbitt

Rune Lillesveen added 1 comment

File third_party/blink/renderer/core/css/parser/media_query_parser.cc
Line 166, Patchset 9 (Latest): const Document* document,
Rune Lillesveen . unresolved

If document is non-null here, isn't execution_context typically a LocalDOMWindow, and you can get the Document from that via DynamicTo<LocalDOMWindow>(execution_context) when creating the fake_context_ instead of plumbing it down here?

Open in Gerrit

Related details

Attention is currently required from:
  • Alison Maher
  • Kevin Babbitt
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id4ba07f79b202bb81351ed4f8a6fab9d55cc03da
    Gerrit-Change-Number: 5451504
    Gerrit-PatchSet: 9
    Gerrit-Owner: Alison Maher <alm...@microsoft.com>
    Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
    Gerrit-Reviewer: Kevin Babbitt <kbab...@microsoft.com>
    Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-CC: Kenneth Rohde Christiansen <kenneth.ch...@gmail.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Attention: Kevin Babbitt <kbab...@microsoft.com>
    Gerrit-Attention: Alison Maher <alm...@microsoft.com>
    Gerrit-Comment-Date: Mon, 15 Apr 2024 21:41:21 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Alison Maher (Gerrit)

    unread,
    Apr 15, 2024, 5:51:41 PMApr 15
    to Kevin Babbitt, Rune Lillesveen, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, Nate Chapin, Kenneth Rohde Christiansen, Yoav Weiss (@Shopify), apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, dmurph+watch...@chromium.org, dominickn+wa...@chromium.org, feature-me...@chromium.org, gavinp...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, loading...@chromium.org, webap...@microsoft.com
    Attention needed from Kevin Babbitt and Rune Lillesveen

    Alison Maher added 1 comment

    File third_party/blink/renderer/core/css/parser/media_query_parser.cc
    Line 166, Patchset 9 (Latest): const Document* document,
    Rune Lillesveen . unresolved

    If document is non-null here, isn't execution_context typically a LocalDOMWindow, and you can get the Document from that via DynamicTo<LocalDOMWindow>(execution_context) when creating the fake_context_ instead of plumbing it down here?

    Alison Maher

    Document isn't always guaranteed (although there were several call sites, so it could be that this one is guarenteed and others weren't). I tried to pass it in wherever it was available, though. From what I found, the execution context is also sometimes fake. As a result, I decided to pass this in separately, but I do think this could likely use some further cleanup at some point since it would be nice to guarantee both and then avoid passing one of them in.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Kevin Babbitt
    • Rune Lillesveen
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id4ba07f79b202bb81351ed4f8a6fab9d55cc03da
    Gerrit-Change-Number: 5451504
    Gerrit-PatchSet: 9
    Gerrit-Owner: Alison Maher <alm...@microsoft.com>
    Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
    Gerrit-Reviewer: Kevin Babbitt <kbab...@microsoft.com>
    Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-CC: Kenneth Rohde Christiansen <kenneth.ch...@gmail.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Attention: Kevin Babbitt <kbab...@microsoft.com>
    Gerrit-Attention: Rune Lillesveen <fut...@chromium.org>
    Gerrit-Comment-Date: Mon, 15 Apr 2024 21:51:30 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Rune Lillesveen <fut...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Rune Lillesveen (Gerrit)

    unread,
    Apr 16, 2024, 11:01:40 AMApr 16
    to Alison Maher, Kevin Babbitt, Rune Lillesveen, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, Nate Chapin, Kenneth Rohde Christiansen, Yoav Weiss (@Shopify), apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, dmurph+watch...@chromium.org, dominickn+wa...@chromium.org, feature-me...@chromium.org, gavinp...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, loading...@chromium.org, webap...@microsoft.com
    Attention needed from Alison Maher and Kevin Babbitt

    Rune Lillesveen added 1 comment

    File third_party/blink/renderer/core/css/parser/media_query_parser.cc
    Line 166, Patchset 9 (Latest): const Document* document,
    Rune Lillesveen . unresolved

    If document is non-null here, isn't execution_context typically a LocalDOMWindow, and you can get the Document from that via DynamicTo<LocalDOMWindow>(execution_context) when creating the fake_context_ instead of plumbing it down here?

    Alison Maher

    Document isn't always guaranteed (although there were several call sites, so it could be that this one is guarenteed and others weren't). I tried to pass it in wherever it was available, though. From what I found, the execution context is also sometimes fake. As a result, I decided to pass this in separately, but I do think this could likely use some further cleanup at some point since it would be nice to guarantee both and then avoid passing one of them in.

    Rune Lillesveen

    Where do we create fake ExecutionContexts? And in those cases, would we have a valid Document instead? It seems to me if we can pass in a valid Document, it would be trivial to pass a real ExecutionContext too?

    If the ExecutionContext is an instance of LocalDOMWindow, and the passed in document is non-null, then getting the document from the LocalDOMWindow should match the document parameter, right?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alison Maher
    • Kevin Babbitt
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id4ba07f79b202bb81351ed4f8a6fab9d55cc03da
    Gerrit-Change-Number: 5451504
    Gerrit-PatchSet: 9
    Gerrit-Owner: Alison Maher <alm...@microsoft.com>
    Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
    Gerrit-Reviewer: Kevin Babbitt <kbab...@microsoft.com>
    Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-CC: Kenneth Rohde Christiansen <kenneth.ch...@gmail.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Attention: Kevin Babbitt <kbab...@microsoft.com>
    Gerrit-Attention: Alison Maher <alm...@microsoft.com>
    Gerrit-Comment-Date: Tue, 16 Apr 2024 15:01:31 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Rune Lillesveen <fut...@chromium.org>
    Comment-In-Reply-To: Alison Maher <alm...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Alison Maher (Gerrit)

    unread,
    Apr 16, 2024, 7:39:12 PMApr 16
    to Kevin Babbitt, Rune Lillesveen, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, Nate Chapin, Kenneth Rohde Christiansen, Yoav Weiss (@Shopify), apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, dmurph+watch...@chromium.org, dominickn+wa...@chromium.org, feature-me...@chromium.org, gavinp...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, loading...@chromium.org, webap...@microsoft.com
    Attention needed from Kevin Babbitt and Rune Lillesveen

    Alison Maher added 1 comment

    File third_party/blink/renderer/core/css/parser/media_query_parser.cc
    Line 166, Patchset 9 (Latest): const Document* document,
    Rune Lillesveen . unresolved

    If document is non-null here, isn't execution_context typically a LocalDOMWindow, and you can get the Document from that via DynamicTo<LocalDOMWindow>(execution_context) when creating the fake_context_ instead of plumbing it down here?

    Alison Maher

    Document isn't always guaranteed (although there were several call sites, so it could be that this one is guarenteed and others weren't). I tried to pass it in wherever it was available, though. From what I found, the execution context is also sometimes fake. As a result, I decided to pass this in separately, but I do think this could likely use some further cleanup at some point since it would be nice to guarantee both and then avoid passing one of them in.

    Rune Lillesveen

    Where do we create fake ExecutionContexts? And in those cases, would we have a valid Document instead? It seems to me if we can pass in a valid Document, it would be trivial to pass a real ExecutionContext too?

    If the ExecutionContext is an instance of LocalDOMWindow, and the passed in document is non-null, then getting the document from the LocalDOMWindow should match the document parameter, right?

    Alison Maher

    Just walked back all of the call sites and I think you are right. There are some cases where we pass in nullptr for the context, but we don't have access to the Document in those cases either. There was at least a few cases, example `ManifestManager::ParseManifestFromString()`, where we had a context, but it seemed to not be created via a Document [1]. But this wasn't a case of concern for what I was looking into.

    I tried updating to what you had suggested in code, and we are able to still access the Document where we were hoping to, so this will simplify things drastically. Thanks for the super useful feedback. I'll get this cleaned up and re-uploaded.

    [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/manifest/manifest_manager.cc;l=96;drc=503773789a3b4754afd75acf1d1a48658082846b;bpv=1;bpt=1

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Kevin Babbitt
    • Rune Lillesveen
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id4ba07f79b202bb81351ed4f8a6fab9d55cc03da
    Gerrit-Change-Number: 5451504
    Gerrit-PatchSet: 9
    Gerrit-Owner: Alison Maher <alm...@microsoft.com>
    Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
    Gerrit-Reviewer: Kevin Babbitt <kbab...@microsoft.com>
    Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-CC: Kenneth Rohde Christiansen <kenneth.ch...@gmail.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Attention: Kevin Babbitt <kbab...@microsoft.com>
    Gerrit-Attention: Rune Lillesveen <fut...@chromium.org>
    Gerrit-Comment-Date: Tue, 16 Apr 2024 23:39:02 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages