Skip to content

Commit

Permalink
Merge r222823 - Move scroll snap point unregistration from willBeRemo…
Browse files Browse the repository at this point in the history
…vedFromTree to willBeDestroyed

https://bugs.webkit.org/show_bug.cgi?id=177830
<rdar://problem/34796065>

Reviewed by Antti Koivisto.

willBeRemovedFromTree is called conditionally, relying on unregistering objects in there is highly error prone.

Covered by existing tests.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::willBeDestroyed):
(WebCore::RenderBox::willBeRemovedFromTree): Deleted.
* rendering/RenderBox.h:
  • Loading branch information
alanbaradlay authored and carlosgcampos committed Oct 17, 2017
1 parent b2cf496 commit 6beb16e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
17 changes: 17 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,20 @@
2017-10-03 Zalan Bujtas <zalan@apple.com>

Move scroll snap point unregistration from willBeRemovedFromTree to willBeDestroyed
https://bugs.webkit.org/show_bug.cgi?id=177830
<rdar://problem/34796065>

Reviewed by Antti Koivisto.

willBeRemovedFromTree is called conditionally, relying on unregistering objects in there is highly error prone.

Covered by existing tests.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::willBeDestroyed):
(WebCore::RenderBox::willBeRemovedFromTree): Deleted.
* rendering/RenderBox.h:

2017-10-03 Joanmarie Diggs <jdiggs@igalia.com>

AX: [ATK] ARIA menuitems should be exposed with ATK_ROLE_MENU_ITEM even when it's the child of group role
Expand Down
18 changes: 6 additions & 12 deletions Source/WebCore/rendering/RenderBox.cpp
Expand Up @@ -161,7 +161,12 @@ void RenderBox::willBeDestroyed()

view().unscheduleLazyRepaint(*this);
removeControlStatesForRenderer(*this);


#if ENABLE(CSS_SCROLL_SNAP)
if (hasInitializedStyle() && style().scrollSnapArea().hasSnapPosition())
view().unregisterBoxWithScrollSnapPositions(*this);
#endif

RenderBoxModelObject::willBeDestroyed();
}

Expand Down Expand Up @@ -454,17 +459,6 @@ void RenderBox::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle
updateGridPositionAfterStyleChange(style(), oldStyle);
}

void RenderBox::willBeRemovedFromTree()
{
#if ENABLE(CSS_SCROLL_SNAP)
if (hasInitializedStyle() && style().scrollSnapArea().hasSnapPosition())
view().unregisterBoxWithScrollSnapPositions(*this);
#endif

RenderBoxModelObject::willBeRemovedFromTree();
}


void RenderBox::updateGridPositionAfterStyleChange(const RenderStyle& style, const RenderStyle* oldStyle)
{
if (!oldStyle || !is<RenderGrid>(parent()))
Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/rendering/RenderBox.h
Expand Up @@ -628,7 +628,6 @@ class RenderBox : public RenderBoxModelObject {
void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
void updateFromStyle() override;

void willBeRemovedFromTree() override;
void willBeDestroyed() override;

bool createsNewFormattingContext() const;
Expand Down

0 comments on commit 6beb16e

Please sign in to comment.