Skip to content

Commit

Permalink
Bug 1409672: Hook in the invalidator stuff. r=xidorn
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: EoSMrYPS7dl

UltraBlame original commit: b54c60961def24de47cd13dc90e837e0a5049b2e
  • Loading branch information
marco-c committed Oct 2, 2019
1 parent d1b3a88 commit a17368b
Show file tree
Hide file tree
Showing 6 changed files with 345 additions and 185 deletions.
84 changes: 0 additions & 84 deletions dom/xbl/nsBindingManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6574,87 +6574,3 @@ return
parent
;
}
bool
nsBindingManager
:
:
AnyBindingHasDocumentStateDependency
(
EventStates
aStateMask
)
{
MOZ_ASSERT
(
mDocument
-
>
IsStyledByServo
(
)
)
;
bool
result
=
false
;
EnumerateBoundContentBindings
(
[
&
]
(
nsXBLBinding
*
aBinding
)
{
ServoStyleSet
*
styleSet
=
aBinding
-
>
PrototypeBinding
(
)
-
>
GetServoStyleSet
(
)
;
if
(
styleSet
&
&
styleSet
-
>
HasDocumentStateDependency
(
aStateMask
)
)
{
result
=
true
;
return
false
;
}
return
true
;
}
)
;
return
result
;
}
110 changes: 49 additions & 61 deletions dom/xbl/nsBindingManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -973,15 +973,59 @@ bool
aMulti
)
;
bool
AnyBindingHasDocumentStateDependency
/
/
Enumerate
each
bound
content
'
s
bindings
(
mozilla
including
its
base
bindings
)
/
/
in
mBoundContentSet
.
Return
false
from
the
callback
to
stop
enumeration
.
using
BoundContentBindingCallback
=
std
:
:
EventStates
aStateMask
function
<
bool
(
nsXBLBinding
*
)
>
;
bool
EnumerateBoundContentBindings
(
const
BoundContentBindingCallback
&
aCallback
)
const
;
protected
:
Expand Down Expand Up @@ -1116,64 +1160,8 @@ aClosure
;
/
/
Enumerate
each
bound
content
'
s
bindings
(
including
its
base
bindings
)
/
/
in
mBoundContentSet
.
Return
false
from
the
callback
to
stop
enumeration
.
using
BoundContentBindingCallback
=
std
:
:
function
<
bool
(
nsXBLBinding
*
)
>
;
bool
EnumerateBoundContentBindings
(
const
BoundContentBindingCallback
&
aCallback
)
const
;
/
/
MEMBER
VARIABLES
protected
:
/
/
A
Expand Down
66 changes: 26 additions & 40 deletions layout/base/PresShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26088,27 +26088,21 @@ aDocument
"
)
;
MOZ_ASSERT
(
!
aStateMask
.
IsEmpty
(
)
)
;
if
(
mDidInitialize
)
{
Element
*
rootElement
=
aDocument
-
>
GetRootElement
(
)
;
bool
needRestyle
=
false
;
if
(
mStyleSet
Expand All @@ -26119,12 +26113,6 @@ IsServo
)
)
{
needRestyle
=
rootElement
&
&
(
mStyleSet
-
>
Expand All @@ -26133,29 +26121,29 @@ AsServo
)
-
>
HasDocumentStateDependency
InvalidateStyleForDocumentStateChanges
(
aStateMask
)
|
|
aDocument
-
>
BindingManager
;
}
else
if
(
)
Element
*
rootElement
=
aDocument
-
>
AnyBindingHasDocumentStateDependency
GetRootElement
(
aStateMask
)
)
;
}
else
{
const
bool
needRestyle
=
mStyleSet
Expand All @@ -26172,7 +26160,6 @@ rootElement
aStateMask
)
;
}
if
(
needRestyle
Expand Down Expand Up @@ -26200,6 +26187,7 @@ VERIFY_STYLE_TREE
;
}
}
}
if
(
aStateMask
Expand All @@ -26210,6 +26198,8 @@ NS_DOCUMENT_STATE_WINDOW_INACTIVE
)
)
{
if
(
nsIFrame
*
root
Expand All @@ -26220,10 +26210,6 @@ mFrameConstructor
GetRootFrame
(
)
;
if
(
root
)
{
root
Expand Down
16 changes: 16 additions & 0 deletions layout/style/ServoBindingList.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,22 @@ bool
RawGeckoElementBorrowed
element
)
SERVO_BINDING_FUNC
(
Servo_InvalidateStyleForDocStateChanges
void
RawGeckoElementBorrowed
root
const
nsTArray
<
RawServoStyleSetBorrowed
>
*
sets
uint64_t
aStatesChanged
)
/
/
Styleset
Expand Down
Loading

0 comments on commit a17368b

Please sign in to comment.