!574 fix 1.0 inspector bugs

Merge pull request !574 from lihao71/1_inspector_bugs
This commit is contained in:
openharmony_ci 2022-01-17 13:36:16 +00:00 committed by Gitee
commit 0121c99d2b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 16 additions and 10 deletions

View File

@ -96,6 +96,8 @@ const char INSPECTOR_STYLES[] = "$styles";
const char INSPECTOR_INNER_DEBUGLINE[] = "debugLine";
const char INSPECTOR_DEBUGLINE[] = "$debugLine";
std::list<std::string> specialComponentNameV1 = {"dialog", "panel"};
} // namespace
@ -451,6 +453,11 @@ void JsInspectorManager::ClearContainer()
std::string JsInspectorManager::UpdateNodeRectStrInfo(const RefPtr<AccessibilityNode> node)
{
auto it = std::find(specialComponentNameV1.begin(), specialComponentNameV1.end(), node->GetTag());
if (it != specialComponentNameV1.end()) {
node->UpdateRectWithChildRect();
}
PositionInfo positionInfo = {0, 0, 0, 0};
if (node->GetTag() == DOM_NODE_TAG_SPAN) {
positionInfo = {

View File

@ -750,6 +750,14 @@ public:
}
SetZIndex(index);
}
void UpdateRectWithChildRect()
{
if (children_.empty()) {
return;
}
SetRect(children_.front()->GetRect());
}
#endif
protected:

View File

@ -536,13 +536,6 @@ void RenderBox::OnPaintFinish()
node->SetHeight(size.Height());
node->SetLeft(globalOffset.GetX());
node->SetTop(globalOffset.GetY());
if (node->GetTag() == "inspectDialog") {
auto parent = node->GetParentNode();
parent->SetTop(node->GetTop());
parent->SetLeft(node->GetLeft());
parent->SetWidth(node->GetWidth());
parent->SetHeight(node->GetHeight());
}
#endif
}

View File

@ -546,9 +546,7 @@ RefPtr<Component> DialogComponent::GenerateComposed(
accessibilityManager->CreateSpecializedNode(name, composedId, dialogTweenComposedId_);
} else {
dialogTweenComposedId_ = composedId;
#if defined(WINDOWS_PLATFORM) || defined(MAC_PLATFORM)
accessibilityManager->CreateSpecializedNode("inspectDialog", composedId, customDialogId_);
#else
#if !defined(WINDOWS_PLATFORM) && !defined(MAC_PLATFORM)
accessibilityManager->CreateSpecializedNode(name, composedId, -1);
#endif
}