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(devtools): fix the mapping between DOM tree and UI inspector #4122

Merged
merged 4 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
fix(devtools): fix the name of function
  • Loading branch information
Cyunong committed Nov 15, 2024
commit f69d2990dd09aee67722f6fff031c323eedcbce5
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class DevToolsUtil {
static bool ShouldAvoidPostDomManagerTask(const std::string& event_name);

private:
static hippy::dom::DomArgument makeLocationArgument(double x, double y);
static hippy::dom::DomArgument MakeLocationArgument(double x, double y);
static std::shared_ptr<DomNode> GetHitNode(const std::shared_ptr<RootNode>& root_node, double x, double y);
static std::string ParseNodeKeyProps(const std::string& node_key, const NodePropsUnorderedMap& node_props);
static std::string ParseNodeProps(const NodePropsUnorderedMap& node_props);
Expand Down
8 changes: 4 additions & 4 deletions devtools/devtools-integration/native/src/devtools_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ auto MakeCopyable(F&& f) {
};
}

hippy::dom::DomArgument DevToolsUtil::makeLocationArgument(double x, double y) {
hippy::dom::DomArgument DevToolsUtil::MakeLocationArgument(double x, double y) {
footstone::value::HippyValue::HippyValueObjectType hippy_value_object;
hippy_value_object[kXOnScreen] = footstone::value::HippyValue(x);
hippy_value_object[kYOnScreen] = footstone::value::HippyValue(y);
Expand All @@ -160,8 +160,8 @@ std::shared_ptr<DomNode> DevToolsUtil::GetHitNode(const std::shared_ptr<RootNode
return root_node;
}

hippy::dom::DomArgument argument = makeLocationArgument(x, y);
auto screen_shot_callback =
hippy::dom::DomArgument argument = MakeLocationArgument(x, y);
auto get_view_tag_callback =
MakeCopyable([promise = std::move(layout_promise)](std::shared_ptr<hippy::dom::DomArgument> arg) mutable {
footstone::value::HippyValue result_hippy_value;
arg->ToObject(result_hippy_value);
Expand All @@ -177,7 +177,7 @@ std::shared_ptr<DomNode> DevToolsUtil::GetHitNode(const std::shared_ptr<RootNode
int hippyTag = static_cast<int>(result_dom_object.find(kHippyTag)->second.ToInt32Checked());
promise.set_value(hippyTag);
});
base_node->CallFunction(kGetViewTagByLocation, argument, screen_shot_callback);
base_node->CallFunction(kGetViewTagByLocation, argument, get_view_tag_callback);
std::chrono::milliseconds span(10);
if (read_file_future.wait_for(span) == std::future_status::timeout) {
FOOTSTONE_DLOG(WARNING) << kDevToolsTag << "GetHitNode wait_for timeout";
Expand Down
Loading