Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dom): fix skip style diff update style map null #3575

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions dom/src/dom/dom_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,13 @@ std::ostream& operator<<(std::ostream& os, const RefInfo& ref_info) {
return os;
}

std::ostream& operator<<(std::ostream& os, const DiffInfo& diff_info) {
os << "{";
os << "\"skip_style_diff\": " << diff_info.skip_style_diff << ", ";
os << "}";
return os;
}

std::ostream& operator<<(std::ostream& os, const DomNode& dom_node) {
os << "{";
os << "\"id\": " << dom_node.id_ << ", ";
Expand All @@ -637,10 +644,14 @@ std::ostream& operator<<(std::ostream& os, const DomNode& dom_node) {
std::ostream& operator<<(std::ostream& os, const DomInfo& dom_info) {
auto dom_node = dom_info.dom_node;
auto ref_info = dom_info.ref_info;
auto diff_info = dom_info.diff_info;
os << "{";
if (ref_info != nullptr) {
os << "\"ref info\": " << *ref_info << ", ";
}
if (diff_info != nullptr) {
os << "\"diff info\": " << *diff_info << ", ";
}
if (dom_node != nullptr) {
os << "\"dom node\": " << *dom_node << ", ";
}
Expand Down
4 changes: 3 additions & 1 deletion dom/src/dom/root_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ void RootNode::UpdateDomNodes(std::vector<std::shared_ptr<DomInfo>>&& nodes) {
if (!ext_update->empty()) {
diff_value->insert(ext_update->begin(), ext_update->end());
}
dom_node->SetStyleMap(node_info->dom_node->GetStyleMap());
if (!skip_style_diff) {
dom_node->SetStyleMap(node_info->dom_node->GetStyleMap());
}
dom_node->SetExtStyleMap(node_info->dom_node->GetExtStyle());
dom_node->SetDiffStyle(diff_value);

Expand Down
Loading