Commit Graph
80 Commits
Author SHA1 Message Date
Jan-Niklas Jaeschke 8528772830 Bug 2042623 - Text fragments: Scroll to the first matched directive in multi-directive URLs. r=dom-core,smaug
Differential Revision: https://phabricator.services.mozilla.com/D302818
2026-05-28 06:50:57 +00:00
Emilio Cobos Álvarez 1bd0da8bf7 Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug
As per the HTML terminology (https://html.spec.whatwg.org/#relevant)

Automatic rename using sed + lints.

Differential Revision: https://phabricator.services.mozilla.com/D297184
2026-05-02 22:04:17 +00:00
iulian moraru 480fc572da Revert "Bug 2036439, Bug 2033243 - Deal with ownerGlobal -> documentGlobal rename in extensions. r=robwu,home-newtab-reviewers,mconley" for causing newtab failures.
This reverts commit 4f62279d01.

Revert "Bug 2033243 - Other miscellaneous ownerGlobal-related naming removal. r=dom-core,smaug"

This reverts commit 91a4ece356.

Revert "Bug 2033243 - BindToOwner -> BindToGlobal. r=dom-core,smaug"

This reverts commit 5a95a889e1.

Revert "Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug"

This reverts commit 7177a68e67.

Revert "Bug 2033243 - Replace ownerGlobal with documentGlobal, and stop exposing ownerGlobal to JS. r=firefox-desktop-core-reviewers ,webidl,joschmidt,perftest-reviewers,sparky,smaug,mossop ,webidl,joschmidt,perftest-reviewers,sparky,smaug,mossop"

This reverts commit 5263254690.
2026-05-02 16:43:35 +00:00
Emilio Cobos Álvarez 7177a68e67 Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug
As per the HTML terminology (https://html.spec.whatwg.org/#relevant)

Automatic rename using sed + lints.

Differential Revision: https://phabricator.services.mozilla.com/D297184
2026-05-02 15:33:23 +00:00
rperta d4cc71008d Revert "Bug 2033243 - Other miscellaneous ownerGlobal-related naming removal. r=dom-core,smaug" on developer request
This reverts commit e58e122135.

This reverts commit 84ca206f3e.

This reverts commit a7945292ed.

This reverts commit 367d83d299.
2026-05-02 06:20:30 +00:00
Emilio Cobos Álvarez a7945292ed Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug
As per the HTML terminology (https://html.spec.whatwg.org/#relevant)

Automatic rename using sed + lints.

Differential Revision: https://phabricator.services.mozilla.com/D297184
2026-05-01 11:58:14 +00:00
agoloman c814da612d Revert "Bug 2033243 - Other miscellaneous ownerGlobal-related naming removal. r=dom-core,smaug" for causing multiple failures.
This reverts commit c7246654bc.

Revert "Bug 2033243 - BindToOwner -> BindToGlobal. r=dom-core,smaug"

This reverts commit 8873ddf33c.

Revert "Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug"

This reverts commit 8bf999e03c.

Revert "Bug 2033243 - Replace ownerGlobal with documentGlobal, and stop exposing ownerGlobal to JS. r=firefox-desktop-core-reviewers ,webidl,joschmidt,perftest-reviewers,sparky,smaug,mossop"

This reverts commit 7dea1af2e0.
2026-04-30 20:13:14 +00:00
Emilio Cobos Álvarez 8bf999e03c Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug
As per the HTML terminology (https://html.spec.whatwg.org/#relevant)

Automatic rename using sed + lints.

Differential Revision: https://phabricator.services.mozilla.com/D297184
2026-04-30 17:47:11 +00:00
Sylvestre Ledru 9eb1a31a98 Bug 2023419 - Remove Emacs/Vim modelines from dom/ r=emilio,media-playback-reviewers,webidl,padenot
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287843
2026-03-16 21:02:32 +00:00
Jan-Niklas Jaeschke 08a5a0de94 Bug 2014551 - Flush Layout in FragmentDirective::FindTextFragmentsInDocument(). r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D281927
2026-02-11 05:26:44 +00:00
Jan-Niklas Jaeschke 8569b7016d Bug 2003534 - Text Fragments: Clean up prefs. r=Gijs,dom-core,webidl,smaug
This patch removes the pref `dom.text_fragments.create_text_fragment.enabled`,
which is not required anymore now that the feature has shipped.

If a user wants to disable text fragments, this can be done using
the pref `dom.text_fragments.enabled`, which now controls the feature in its entirety.

Differential Revision: https://phabricator.services.mozilla.com/D274758
2025-12-02 16:37:55 +00:00
serge-sans-paille 7662b3abdc Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 19:36:01 +00:00
Cristina Horotan 8a1b1970b7 Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing Gtest failures on AlreadyAddRefed.h
This reverts commit e98adca292.
2025-10-21 16:16:29 +00:00
serge-sans-paille e98adca292 Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 15:05:17 +00:00
Cristina Horotan aab924e90d Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing build bustage at nsBrowserApp.cpp
This reverts commit fd0ffa193c.
2025-10-21 10:44:13 +00:00
serge-sans-paille fd0ffa193c Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 09:44:11 +00:00
Narcis Beleuzu e1e6bbb1c9 Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing bustages on Document.cpp
This reverts commit b23c15e927.
2025-10-21 06:34:58 +00:00
serge-sans-paille b23c15e927 Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 06:01:36 +00:00
serge-sans-paille 5bb9e0bbc5 Bug 1982662 - Use std::default_delete instead of mozilla::DefaultDelete r=necko-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,jesup,emilio,pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D260855
2025-08-25 08:59:21 +00:00
Norisz Fay 61404617b8 Revert "Bug 1982662 - Use std::default_delete instead of mozilla::DefaultDelete r=necko-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,jesup,emilio,pehrsons" for causing bustage @ txUnknownHandler.cpp
This reverts commit c39705fbdc.
2025-08-22 16:16:32 +00:00
serge-sans-paille c39705fbdc Bug 1982662 - Use std::default_delete instead of mozilla::DefaultDelete r=necko-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,jesup,emilio,pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D260855
2025-08-22 14:16:49 +00:00
Jan-Niklas Jaeschke 6b0031d712 Bug 1974126 - Text Fragments: Allow users to copy an existing highlight. r=Gijs,webidl,emilio
Other browsers provide the "copy link to highlight" context menu entry  if the user right-clicks
onto an existing highlight (without selection). In this case, the created link contains all highlights
on the page. If a selection exists as well, it should take precedence.

This patch adapts to this behavior. When the context menu is opened, it is determined
whether there is a selection or an existing highlight range at the given point.
This has the side-effect that the "Copy Link to Highlight" option only shows up
if the user right-clicks on a selection or an existing highlight, but not anywhere else
(this also aligns behavior to Chrome).

Differential Revision: https://phabricator.services.mozilla.com/D259730
2025-08-07 10:28:46 +00:00
agoloman ca18a6d9e1 Revert "Bug 1974126 - Text Fragments: Allow users to copy an existing highlight. r=Gijs,webidl,emilio" for causing bc failures @browser_contextmenu.js.
This reverts commit 0c72c07170.

Revert "Bug 1948246 - Text Fragments: Don't show context menu entry for "Copy Link to Highlight" in view-source pages. r=Gijs"

This reverts commit 7dde84499e.
2025-08-06 15:01:41 +00:00
Jan-Niklas Jaeschke 0c72c07170 Bug 1974126 - Text Fragments: Allow users to copy an existing highlight. r=Gijs,webidl,emilio
Other browsers provide the "copy link to highlight" context menu entry  if the user right-clicks
onto an existing highlight (without selection). In this case, the created link contains all highlights
on the page. If a selection exists as well, it should take precedence.

This patch adapts to this behavior. When the context menu is opened, it is determined
whether there is a selection or an existing highlight range at the given point.
This has the side-effect that the "Copy Link to Highlight" option only shows up
if the user right-clicks on a selection or an existing highlight, but not anywhere else
(this also aligns behavior to Chrome).

Differential Revision: https://phabricator.services.mozilla.com/D259730
2025-08-06 08:07:58 +00:00
Ciprian Todea 93904aec9c Revert "Bug 1974126 - Text Fragments: Allow users to copy an existing highlight. r=Gijs,webidl,emilio" for causing mochitests failures
This reverts commit 942e756723.

Revert "Bug 1948246 - Text Fragments: Don't show context menu entry for "Copy Link to Highlight" in view-source pages. r=Gijs"

This reverts commit 33fbb17c75.
2025-08-05 14:29:26 +00:00
Jan-Niklas Jaeschke 942e756723 Bug 1974126 - Text Fragments: Allow users to copy an existing highlight. r=Gijs,webidl,emilio
Other browsers provide the "copy link to highlight" context menu entry  if the user right-clicks
onto an existing highlight (without selection). In this case, the created link contains all highlights
on the page. If a selection exists as well, it should take precedence.

This patch adapts to this behavior. When the context menu is opened, it is determined
whether there is a selection or an existing highlight range at the given point.
This has the side-effect that the "Copy Link to Highlight" option only shows up
if the user right-clicks on a selection or an existing highlight, but not anywhere else
(this also aligns behavior to Chrome).

Differential Revision: https://phabricator.services.mozilla.com/D259730
2025-08-05 13:08:49 +00:00
Emilio Cobos Álvarez 791917d8af Bug 1976665 - Sort headers in dom/. r=dom-core,media-playback-reviewers,webrtc-reviewers,dom-storage-reviewers,padenot,janv,smaug,jesup,jib
Most changes are automated. Relevant bit is dom/.clang-format. I had to
manually disable clang-format in a few places where importing external
files and so on that aren't self-contained, and fix a couple includes /
forward declarations.

Differential Revision: https://phabricator.services.mozilla.com/D256800
2025-08-05 11:47:34 +00:00
Jan-Niklas Jaeschke d2fc365ff6 Bug 1975158 - Text Fragments: Fix cycle collection leak. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D255808
2025-07-02 18:59:11 +00:00
Jan-Niklas Jaeschke 23c41ebb1a Bug 1970339, part 2 - Text Fragments: Make timeout for creating text fragments global for all ranges. r=vhilla,mccr8
Before this patch, the 5 second timeout was applied
to each range individually. In some edge cases,
the number of ranges could be large. And even if
creating a text directive for a single range was
very fast, the accumulated time for all ranges
could exceed the 5 second limit.

This patch changes the watchdog to run
globally instead of per range, therefore
cutting off the whole process of creating
a text directive after 5 seconds.

It is not feasible to create a test case for
the timeout watchdog, hence there are
no changed tests.

Differential Revision: https://phabricator.services.mozilla.com/D252946
2025-07-02 09:37:05 +00:00
Jan-Niklas Jaeschke a29d3572ac Bug 1970339, part 1 - Text Fragments: Change API to create text fragments to use Selection instead of a single range. r=webidl,smaug,vhilla,mccr8
Before this patch, the C++ code was responsible
for creating a single text directive from a single
range. Accumulating the text directives into a
text fragment was done in the JS code.

This patch moves the responsibility of creating
the text fragment to the C++ code, which simplifies
the JS code, and improves the performance.

This is a prerequisite for the second patch, which
will make the timeout for creating text fragments
global for all ranges, instead of per range.

Differential Revision: https://phabricator.services.mozilla.com/D252945
2025-07-02 09:37:02 +00:00
Jan-Niklas Jaeschke eda97e012f Bug 1974513 - Text Fragments: Use strong pointers to Document in helper classes. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D255506
2025-07-01 08:48:42 +00:00
agoloman c5055a75c8 Revert "Bug 1974513 - Text Fragments: Use strong pointers to Document in helper classes. r=mccr8" for causing build bustages @TextDirectiveCreator.cpp.
This reverts commit 6dc38deef8.
2025-06-30 18:12:04 +00:00
Jan-Niklas Jaeschke 6dc38deef8 Bug 1974513 - Text Fragments: Use strong pointers to Document in helper classes. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D255506
2025-06-30 16:15:31 +00:00
Jan-Niklas Jaeschke 62670c535b Bug 1958601 - Text Fragments: Fixed broken use counter metric collection. r=emilio
Also did some cleaning up for duplicate tests.

Differential Revision: https://phabricator.services.mozilla.com/D244934
2025-04-09 15:05:48 +00:00
Roland Kossel f714f6fa67 Bug 1942117 - Part 2: gather metrics for text fragments, r=jjaschke
Differential Revision: https://phabricator.services.mozilla.com/D237494
2025-03-23 12:31:26 +00:00
Roland Kossel fa0e843843 Bug 1927764, part 1: change logger macros of TextFragment to use MOZ_LOG_FMT. r=jjaschke
Differential Revision: https://phabricator.services.mozilla.com/D235562
2025-01-27 11:56:01 +00:00
Jan-Niklas Jaeschke 458f36e9cb Bug 1934825, part 4 - Text Fragments: Introduce TextDirectiveCreator helper class. r=farre
The helper class provides a static creator function,
which is being filled with content in the following patches.

Differential Revision: https://phabricator.services.mozilla.com/D231102
2025-01-23 22:27:22 +00:00
Jan-Niklas Jaeschke e097878f21 Bug 1934825, part 2 - Text Fragments: Create chrome-only API to create text directives from a range. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D231100
2025-01-23 22:27:22 +00:00
Sandor Molnar a075939bef Backed out 12 changesets (bug 1934825, bug 1934827) for causing build bustages. CLOSED TREE
Backed out changeset 27296a2c825b (bug 1934827)
Backed out changeset dd86e3d3e63a (bug 1934827)
Backed out changeset b2ab060fe7e4 (bug 1934827)
Backed out changeset 883150cd2569 (bug 1934827)
Backed out changeset 21b2f024f889 (bug 1934827)
Backed out changeset 2a12d7d6dc3f (bug 1934827)
Backed out changeset 0f49bfec8e3e (bug 1934825)
Backed out changeset 628c560fcb21 (bug 1934825)
Backed out changeset 320c3334e44b (bug 1934825)
Backed out changeset 541745eec530 (bug 1934825)
Backed out changeset beb5a753c616 (bug 1934825)
Backed out changeset 750a7ff53dee (bug 1934825)
2025-01-22 18:25:54 +02:00
Jan-Niklas Jaeschke 56b5f1aaf9 Bug 1934825, part 4 - Text Fragments: Introduce TextDirectiveCreator helper class. r=farre
The helper class provides a static creator function,
which is being filled with content in the following patches.

Differential Revision: https://phabricator.services.mozilla.com/D231102
2025-01-22 10:26:11 +00:00
Jan-Niklas Jaeschke 34c878c390 Bug 1934825, part 2 - Text Fragments: Create chrome-only API to create text directives from a range. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D231100
2025-01-22 10:26:10 +00:00
Jan-Niklas Jaeschke 71b8133854 Bug 1924519, part 2 - Text Fragments: Refactor algorithm to find a text directive in a document into its own file. r=dom-core,farre
Similarly to the last part, this commit attempts to clean up the FragmentDirective class and have it serve more as an Interface than the implementation.

The new class TextDirectiveFinder encapsules the find code. It is instantiated lazily using unique pointers and removed when all text directives are invoked.

Differential Revision: https://phabricator.services.mozilla.com/D225535
2024-11-04 08:59:30 +00:00
Jan-Niklas Jaeschke dda5f80d37 Bug 1924519, part 1 - Text Fragments: Refactored helper functions into separate file. r=dom-core,farre
This commit moves all utility helper functions,
which used to be free functions in `FragmentDirective.cpp`,
into a class `TextDirectiveUtil` as static functions.

Also, the logging macro has been renamed and moved into the header,
to allow using it from several files.

Differential Revision: https://phabricator.services.mozilla.com/D225534
2024-11-04 08:59:30 +00:00
Cosmin Sabou 1137241a2e Backed out 3 changesets (bug 1928690, bug 1924519) for causing linting and wpt failures on hash-empty-string.html. CLOSED TREE
Backed out changeset 8b8421f48a71 (bug 1928690)
Backed out changeset 3e18f9b22c75 (bug 1924519)
Backed out changeset 59eee00e6ccb (bug 1924519)
2024-11-01 21:49:05 +02:00
Jan-Niklas Jaeschke bff8931174 Bug 1924526 - Text Fragments: Implement new chrome-only APIs to access and remove text directive ranges. r=farre,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D225536
2024-11-01 15:53:51 +00:00
Jan-Niklas Jaeschke 5b2ecdfc7d Bug 1924519, part 2 - Text Fragments: Refactor algorithm to find a text directive in a document into its own file. r=dom-core,farre
Similarly to the last part, this commit attempts to clean up the FragmentDirective class and have it serve more as an Interface than the implementation.

The new class TextDirectiveFinder encapsules the find code. It is instantiated lazily using unique pointers and removed when all text directives are invoked.

Differential Revision: https://phabricator.services.mozilla.com/D225535
2024-11-01 15:49:54 +00:00
Jan-Niklas Jaeschke dbe2b2b966 Bug 1924519, part 1 - Text Fragments: Refactored helper functions into separate file. r=dom-core,farre
This commit moves all utility helper functions,
which used to be free functions in `FragmentDirective.cpp`,
into a class `TextDirectiveUtil` as static functions.

Also, the logging macro has been renamed and moved into the header,
to allow using it from several files.

Differential Revision: https://phabricator.services.mozilla.com/D225534
2024-11-01 15:49:54 +00:00
Andreas Farre fee00273bb Bug 1919565 - Hide the text fragment from Navigation and Resource Timing API. r=dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D222941
2024-09-30 13:17:23 +00:00
Jan-Niklas Jaeschke c771ce3b08 Bug 1910417 - Text Fragments: Simplify URL parsing algorithm. r=dom-core,avandolder
Originally, the algorithm was designed to be capable of dealing with full URLs
and finding the fragment in it.
However, all usages of the parser use a `Ref` from an `nsIURI`,
so checking for full URLs is not necessary.

Simplifying this makes the algorithm easier to understand and makes it also parse edge cases like `#:~:text=#` correctly
(which is invalid wrt the URL spec, but should work regardless).

Differential Revision: https://phabricator.services.mozilla.com/D218051
2024-07-30 17:02:20 +00:00
Jan-Niklas Jaeschke d4ee399d4e Bug 1904773 - Text Fragments: Implemented makeshift user involvement check. r=edgar,dom-core,frontend-codestyle-reviewers
User involvement as defined in the spec is not implemented in Gecko yet.
Therefore, the changes introduced in Bug 1888756 disallowed scrolling to text directives if the load was triggered by the user, eg. by pasting a link with a text fragment into the url bar.

This patch checks if the triggering principal of the load is the system principal.
This is equivalent to the "browser UI" value of user involvement.

Differential Revision: https://phabricator.services.mozilla.com/D214409
2024-07-01 11:24:08 +00:00