RESOLVED FIXED 222640
Hold onto AppHighlights and restore them once the page is loaded.
https://bugs.webkit.org/show_bug.cgi?id=222640
Summary Hold onto AppHighlights and restore them once the page is loaded.
Megan Gardner
Reported 2021-03-02 22:00:37 PST
Hold onto AppHighlights and restore them once the page is loaded.
Attachments
Patch (4.57 KB, patch)
2021-03-02 22:01 PST, Megan Gardner
no flags
Patch for landing (4.80 KB, patch)
2021-03-03 10:57 PST, Megan Gardner
no flags
Patch for landing (4.80 KB, patch)
2021-03-08 19:57 PST, Megan Gardner
no flags
Patch (4.80 KB, patch)
2021-03-08 23:53 PST, Megan Gardner
no flags
Patch for landing (4.80 KB, patch)
2021-03-09 09:36 PST, Megan Gardner
no flags
Megan Gardner
Comment 1 2021-03-02 22:01:23 PST
Devin Rousso
Comment 2 2021-03-02 23:02:27 PST
Comment on attachment 422045 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=422045&action=review r=me > Source/WebCore/Modules/highlight/AppHighlightStorage.cpp:254 > + auto strongDocument = makeRefPtr(m_document.get()); I think this will `ASSERT` if `m_document` is not set or has been destroyed. You might have to move this below the `if (!m_document)` check. > Source/WebCore/Modules/highlight/AppHighlightStorage.h:50 > + ~AppHighlightStorage(); NIT: Can you also make this class `final`? > Source/WebCore/dom/Document.cpp:6024 > + if (appHighlightStorageIfExists()) NIT: You could save the return value and use that instead of `appHighlightStorage()` ``` if (auto* appHighlightStorage = appHighlightStorageIfExists()) appHighlightStorage->restoreUnrestoredAppHighlights(); ```
Wenson Hsieh
Comment 3 2021-03-03 09:36:24 PST
Comment on attachment 422045 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=422045&action=review >> Source/WebCore/Modules/highlight/AppHighlightStorage.cpp:254 >> + auto strongDocument = makeRefPtr(m_document.get()); > > I think this will `ASSERT` if `m_document` is not set or has been destroyed. You might have to move this below the `if (!m_document)` check. Is this accurate? I'm curious where the assertion is.
Megan Gardner
Comment 4 2021-03-03 10:57:19 PST
Created attachment 422123 [details] Patch for landing
EWS
Comment 5 2021-03-03 10:57:57 PST
Tools/Scripts/svn-apply failed to apply attachment 422123 [details] to trunk. Please resolve the conflicts and upload a new patch.
Megan Gardner
Comment 6 2021-03-08 19:57:50 PST
Created attachment 422659 [details] Patch for landing
EWS
Comment 7 2021-03-08 22:02:20 PST
Found 1 new test failure: media/media-fragments/TC0051.html
Megan Gardner
Comment 8 2021-03-08 23:53:32 PST
Devin Rousso
Comment 9 2021-03-09 09:34:34 PST
Comment on attachment 422045 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=422045&action=review >>> Source/WebCore/Modules/highlight/AppHighlightStorage.cpp:254 >>> + auto strongDocument = makeRefPtr(m_document.get()); >> >> I think this will `ASSERT` if `m_document` is not set or has been destroyed. You might have to move this below the `if (!m_document)` check. > > Is this accurate? I'm curious where the assertion is. Ah I think I misread the `ASSERT` in `WeakPtr::get`. I thought it was `ASSERT(m_impl || ...);` 😅
Megan Gardner
Comment 10 2021-03-09 09:36:45 PST
Created attachment 422718 [details] Patch for landing
EWS
Comment 11 2021-03-09 10:02:04 PST
Committed r274155: <https://commits.webkit.org/r274155> All reviewed patches have been landed. Closing bug and clearing flags on attachment 422718 [details].
Radar WebKit Bug Importer
Comment 12 2021-03-09 10:03:21 PST
Note You need to log in before you can comment on or make changes to this bug.