Add support for CompactPointerTuple<..., OptionSet<...>>
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Oct 2019 00:13:22 +0000 (00:13 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Oct 2019 00:13:22 +0000 (00:13 +0000)
commit8f81cfb9289ac35fcd195d00f8946d816584287a
treebf1d4ca76654dc2985e24e6d8f6fa503401d8a33
parenta682dcc5b9a79eacbd56ab635968a68131c7af73
Add support for CompactPointerTuple<..., OptionSet<...>>
https://bugs.webkit.org/show_bug.cgi?id=201316

Reviewed by Yusuke Suzuki.

Source/WebCore:

Use the new CompactPointerTuple capability to replace CompactPointerTuple<RenderObject*, uint8_t>
with CompactPointerTuple<RenderObject*, OptionSet<ElementStyleFlag>> in Node.h.

* dom/Node.h:
(WebCore::Node::hasStyleFlag const):
(WebCore::Node::setStyleFlag):
(WebCore::Node::clearStyleFlags):
Update code now that we support CompactPointerTuple<..., OptionSet<...>>.

Source/WTF:

Support using an OptionSet<> for the byte value portion of a CompactPointerTuple so that
you can encode both a pointer and 8-bit bitmask in a type-safe way. Another benefit of
supporting OptionSet<> is that we have a LLDB pretty-printer for it so this makes it easy
to see the set flags in such a CompactPointerTuple.

* wtf/CompactPointerTuple.h:

Tools:

Add a test to ensure we encode and decode a compact pointer tuple correctly when an uint8_t and
a OptionSet<> as the byte value portion of the tuple.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/CompactPointerTuple.cpp: Added.
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250945 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/wtf/CompactPointerTuple.h
Source/WebCore/ChangeLog
Source/WebCore/dom/Node.h
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WTF/CompactPointerTuple.cpp [new file with mode: 0644]