mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 05:45:33 +00:00
Bug 1807251 - Small cleanup of fix for nested content-visibility: auto
elements r=emilio
This change removes an unused member that was accidentally preserved from an earlier version of the fix and also makes the argument to `DOMIntersectionObserver::Update` a reference since it can never be null and the method was not asserting that it wasn't. Differential Revision: https://phabricator.services.mozilla.com/D167356
This commit is contained in:
parent
5b5450146f
commit
bf386f948a
@ -709,15 +709,15 @@ IntersectionOutput DOMIntersectionObserver::Intersect(
|
||||
|
||||
// https://w3c.github.io/IntersectionObserver/#update-intersection-observations-algo
|
||||
// (step 2)
|
||||
void DOMIntersectionObserver::Update(Document* aDocument,
|
||||
void DOMIntersectionObserver::Update(Document& aDocument,
|
||||
DOMHighResTimeStamp time) {
|
||||
auto input = ComputeInput(*aDocument, mRoot, &mRootMargin);
|
||||
auto input = ComputeInput(aDocument, mRoot, &mRootMargin);
|
||||
|
||||
// If this observer is used to determine content relevancy for
|
||||
// `content-visiblity: auto` content, then do not skip intersection
|
||||
// for content that is hidden by `content-visibility: auto`.
|
||||
IgnoreContentVisibility ignoreContentVisibility =
|
||||
aDocument->GetContentVisibilityObserver() == this
|
||||
aDocument.GetContentVisibilityObserver() == this
|
||||
? IgnoreContentVisibility::Yes
|
||||
: IgnoreContentVisibility::No;
|
||||
|
||||
|
@ -95,9 +95,6 @@ struct IntersectionInput {
|
||||
nsMargin mRootMargin;
|
||||
// If this is in an OOP iframe, the visible rect of the OOP frame.
|
||||
Maybe<nsRect> mRemoteDocumentVisibleRect;
|
||||
// Whether this intersection is for the purposes of computing content
|
||||
// relevancy for `content-visiblilty: auto`.
|
||||
bool mIsForContentVisibility = false;
|
||||
};
|
||||
|
||||
struct IntersectionOutput {
|
||||
@ -162,7 +159,7 @@ class DOMIntersectionObserver final : public nsISupports,
|
||||
// Intersects with a given rect, already relative to the root frame.
|
||||
static IntersectionOutput Intersect(const IntersectionInput&, const nsRect&);
|
||||
|
||||
void Update(Document* aDocument, DOMHighResTimeStamp time);
|
||||
void Update(Document& aDocument, DOMHighResTimeStamp time);
|
||||
MOZ_CAN_RUN_SCRIPT void Notify();
|
||||
|
||||
static already_AddRefed<DOMIntersectionObserver> CreateLazyLoadObserver(
|
||||
|
@ -15765,7 +15765,7 @@ void Document::UpdateIntersectionObservations(TimeStamp aNowTime) {
|
||||
mIntersectionObservers);
|
||||
for (const auto& observer : observers) {
|
||||
if (observer) {
|
||||
observer->Update(this, time);
|
||||
observer->Update(*this, time);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user