Fabric: Using ShadowView instad of ShadowNode inside AttributedString

Summary:
That's generally better because:
 * Avoids exposing ShadowNode to mounting layer;
 * Enables hashing and comparing the AttributedString based on actual meaningful data (not on just a pointer to ShadowNode).

Reviewed By: mdvacca

Differential Revision: D13205230

fbshipit-source-id: 7b79c1aad97b10d81e3faa10408be61b74f815cf
This commit is contained in:
Valentin Shergin
2018-11-27 18:34:15 -08:00
committed by Facebook Github Bot
parent 6c3b05f343
commit 7197aa026b
6 changed files with 21 additions and 26 deletions
@@ -18,12 +18,12 @@ using Fragments = AttributedString::Fragments;
#pragma mark - Fragment
bool Fragment::operator==(const Fragment &rhs) const {
return std::tie(string, textAttributes, shadowNode, parentShadowNode) ==
return std::tie(string, textAttributes, shadowView, parentShadowView) ==
std::tie(
rhs.string,
rhs.textAttributes,
rhs.shadowNode,
rhs.parentShadowNode);
rhs.shadowView,
rhs.parentShadowView);
}
bool Fragment::operator!=(const Fragment &rhs) const {
@@ -90,11 +90,6 @@ SharedDebugStringConvertibleList AttributedString::getDebugChildren() const {
auto propsList =
fragment.textAttributes.DebugStringConvertible::getDebugProps();
if (fragment.shadowNode) {
propsList.push_back(std::make_shared<DebugStringConvertibleItem>(
"shadowNode", fragment.shadowNode->getDebugDescription()));
}
list.push_back(std::make_shared<DebugStringConvertibleItem>(
"Fragment",
fragment.string,