WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
158773
Decouple the percent height and positioned descendants maps.
https://bugs.webkit.org/show_bug.cgi?id=158773
Summary
Decouple the percent height and positioned descendants maps.
zalan
Reported
2016-06-14 20:07:32 PDT
While we track the elements with percent height through multiple containers (direct parent, indirect parent), a positioned element can only have one containing block. Sharing the same data structure between these 2 concepts is defective. precent height element with multiple containers -> typedef WTF::HashMap<const RenderBox*, std::unique_ptr<HashSet<const RenderBlock*>>> TrackedContainerMap; positioned element with single containing block -> typedef HashMap<const RenderBox*, const RenderBlock*> TrackedContainerMap;
Attachments
Patch
(22.18 KB, patch)
2016-06-14 20:49 PDT
,
zalan
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews102 for mac-yosemite
(940.00 KB, application/zip)
2016-06-14 21:36 PDT
,
Build Bot
no flags
Details
Archive of layout-test-results from ews105 for mac-yosemite-wk2
(941.64 KB, text/plain)
2016-06-14 21:40 PDT
,
Build Bot
no flags
Details
Archive of layout-test-results from ews126 for ios-simulator-wk2
(653.98 KB, application/zip)
2016-06-14 21:46 PDT
,
Build Bot
no flags
Details
Archive of layout-test-results from ews114 for mac-yosemite
(1.42 MB, application/zip)
2016-06-14 21:50 PDT
,
Build Bot
no flags
Details
Patch
(22.69 KB, patch)
2016-06-14 21:51 PDT
,
zalan
no flags
Details
Formatted Diff
Diff
Patch
(24.82 KB, patch)
2016-06-15 19:47 PDT
,
zalan
no flags
Details
Formatted Diff
Diff
Show Obsolete
(6)
View All
Add attachment
proposed patch, testcase, etc.
zalan
Comment 1
2016-06-14 20:49:48 PDT
Created
attachment 281322
[details]
Patch
Build Bot
Comment 2
2016-06-14 21:36:53 PDT
Comment on
attachment 281322
[details]
Patch
Attachment 281322
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.webkit.org/results/1504857
New failing tests: fast/block/fixed-position-reparent-when-transition-is-removed.html
Build Bot
Comment 3
2016-06-14 21:36:57 PDT
Created
attachment 281327
[details]
Archive of layout-test-results from ews102 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-yosemite Platform: Mac OS X 10.10.5
Build Bot
Comment 4
2016-06-14 21:40:22 PDT
Comment on
attachment 281322
[details]
Patch
Attachment 281322
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.webkit.org/results/1504870
New failing tests: fast/block/fixed-position-reparent-when-transition-is-removed.html
Build Bot
Comment 5
2016-06-14 21:40:26 PDT
Created
attachment 281328
[details]
Archive of layout-test-results from ews105 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews105 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Build Bot
Comment 6
2016-06-14 21:46:36 PDT
Comment on
attachment 281322
[details]
Patch
Attachment 281322
[details]
did not pass ios-sim-ews (ios-simulator-wk2): Output:
http://webkit-queues.webkit.org/results/1504872
New failing tests: fast/block/fixed-position-reparent-when-transition-is-removed.html
Build Bot
Comment 7
2016-06-14 21:46:41 PDT
Created
attachment 281330
[details]
Archive of layout-test-results from ews126 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews126 Port: ios-simulator-wk2 Platform: Mac OS X 10.11.4
Build Bot
Comment 8
2016-06-14 21:50:54 PDT
Comment on
attachment 281322
[details]
Patch
Attachment 281322
[details]
did not pass mac-debug-ews (mac): Output:
http://webkit-queues.webkit.org/results/1504895
New failing tests: fast/block/fixed-position-reparent-when-transition-is-removed.html
Build Bot
Comment 9
2016-06-14 21:50:58 PDT
Created
attachment 281332
[details]
Archive of layout-test-results from ews114 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews114 Port: mac-yosemite Platform: Mac OS X 10.10.5
zalan
Comment 10
2016-06-14 21:51:59 PDT
Created
attachment 281333
[details]
Patch
Dave Hyatt
Comment 11
2016-06-15 13:21:13 PDT
Comment on
attachment 281333
[details]
Patch r=me
Chris Dumez
Comment 12
2016-06-15 13:53:40 PDT
Comment on
attachment 281333
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=281333&action=review
> Source/WebCore/rendering/RenderBlock.cpp:98 > static TrackedDescendantsMap* gPercentHeightDescendantsMap;
We normally don't use 'g' prefix for statics.
> Source/WebCore/rendering/RenderBlock.cpp:108 > + auto* descendantSet = gPercentHeightDescendantsMap->get(&container);
Could use HashMap::ensure() and std::make_unique<>()
> Source/WebCore/rendering/RenderBlock.cpp:121 > + auto* containerSet = gPercentHeightContainerMap->get(&descendant);
Could use HashMap::ensure() and std::make_unique<>()
> Source/WebCore/rendering/RenderBlock.cpp:148 > auto* descendantSet = descendantsMapIterator->value.get();
Auto& descendantSet = *descendantsMapIterator->value;
> Source/WebCore/rendering/RenderBlock.cpp:158 > + void addDescendant(const RenderBlock& containingBlock, RenderBox& positionedDescendant, bool moveDescendantToEnd = false)
The bool parameter would read nicer at call sites if this used an enum class: Enum class MoveDescendantToEnd { No, Yes }
> Source/WebCore/rendering/RenderBlock.cpp:204 > + for (const auto* renderer : *descendants)
Const does not really bring much.
> Source/WebCore/rendering/RenderBlock.cpp:214 > + typedef HashMap<const RenderBlock*, std::unique_ptr<TrackedRendererListHashSet>> DescendantsMap;
We using using instead of typedef these days: Using DescendantsMap = HashMap<const RenderBlock*, std::unique_ptr<TrackedRendererListHashSet>>;
> Source/WebCore/rendering/RenderBlock.cpp:325 > + if (std::unique_ptr<TrackedRendererListHashSet> descendantSet = gPercentHeightDescendantsMap->take(block)) {
We would usually do the if (!....) Return early.
> Source/WebCore/rendering/RenderBlock.cpp:327 > for (TrackedRendererListHashSet::iterator descendant = descendantSet->begin(); descendant != end; ++descendant) {
Would probably be nicer with a new range loop.
> Source/WebCore/rendering/RenderBlock.cpp:328 > + TrackedContainerMap::iterator it = gPercentHeightContainerMap->find(*descendant);
auto
> Source/WebCore/rendering/RenderBlock.cpp:3834 > + for (auto it = positionedDescendants->begin(), end = positionedDescendants->end(); it != end; ++it) {
New range loop?
zalan
Comment 13
2016-06-15 19:47:13 PDT
Created
attachment 281428
[details]
Patch
zalan
Comment 14
2016-06-15 20:09:38 PDT
(In reply to
comment #12
)
> Comment on
attachment 281333
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=281333&action=review
> > > Source/WebCore/rendering/RenderBlock.cpp:98 > > static TrackedDescendantsMap* gPercentHeightDescendantsMap; > > We normally don't use 'g' prefix for statics. > > > Source/WebCore/rendering/RenderBlock.cpp:108 > > + auto* descendantSet = gPercentHeightDescendantsMap->get(&container); > > Could use HashMap::ensure() and std::make_unique<>() > > > Source/WebCore/rendering/RenderBlock.cpp:121 > > + auto* containerSet = gPercentHeightContainerMap->get(&descendant); > > Could use HashMap::ensure() and std::make_unique<>() > > > Source/WebCore/rendering/RenderBlock.cpp:148 > > auto* descendantSet = descendantsMapIterator->value.get(); > > Auto& descendantSet = *descendantsMapIterator->value; > > > Source/WebCore/rendering/RenderBlock.cpp:158 > > + void addDescendant(const RenderBlock& containingBlock, RenderBox& positionedDescendant, bool moveDescendantToEnd = false) > > The bool parameter would read nicer at call sites if this used an enum class: > Enum class MoveDescendantToEnd { No, Yes } > > > Source/WebCore/rendering/RenderBlock.cpp:204 > > + for (const auto* renderer : *descendants) > > Const does not really bring much. > > > Source/WebCore/rendering/RenderBlock.cpp:214 > > + typedef HashMap<const RenderBlock*, std::unique_ptr<TrackedRendererListHashSet>> DescendantsMap; > > We using using instead of typedef these days: > Using DescendantsMap = HashMap<const RenderBlock*, > std::unique_ptr<TrackedRendererListHashSet>>; > > > Source/WebCore/rendering/RenderBlock.cpp:325 > > + if (std::unique_ptr<TrackedRendererListHashSet> descendantSet = gPercentHeightDescendantsMap->take(block)) { > > We would usually do the if (!....) Return early. > > > Source/WebCore/rendering/RenderBlock.cpp:327 > > for (TrackedRendererListHashSet::iterator descendant = descendantSet->begin(); descendant != end; ++descendant) { > > Would probably be nicer with a new range loop. > > > Source/WebCore/rendering/RenderBlock.cpp:328 > > + TrackedContainerMap::iterator it = gPercentHeightContainerMap->find(*descendant); > > auto > > > Source/WebCore/rendering/RenderBlock.cpp:3834 > > + for (auto it = positionedDescendants->begin(), end = positionedDescendants->end(); it != end; ++it) { > > New range loop?
Done.
WebKit Commit Bot
Comment 15
2016-06-15 20:30:21 PDT
Comment on
attachment 281428
[details]
Patch Clearing flags on attachment: 281428 Committed
r202123
: <
http://trac.webkit.org/changeset/202123
>
WebKit Commit Bot
Comment 16
2016-06-15 20:30:28 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug