-
Notifications
You must be signed in to change notification settings - Fork 6k
[web] retrieve hostElement for an implicit view #53296
Changes from 2 commits
98f0685
adb379b
e48806c
cdb4678
812a40e
b22fcf1
6045c9f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -99,6 +99,10 @@ class FlutterViewManager { | |||||
return _jsViewOptions[viewId]; | ||||||
} | ||||||
|
||||||
DomElement? getHostElement(int viewId) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we have a clear definition of "host element"? If not, then the docs seem recursive. The name
The docs should explain which one this function returns. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd expect the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is what we have for engine/lib/web_ui/lib/src/engine/view_embedder/embedding_strategy/embedding_strategy.dart Lines 29 to 30 in 928d34f
Also in the Flutter docs:
I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doc in the code can be more specific though. How about updating doc for the /// The dom element in which the Flutter view is embedded.
/// This element is the direct parent element of the <flutter-view> element. And then for the current function just leave it like this: /// Returns the dom element in which the Flutter view associated to [viewId] is embedded (if any). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @p-mazhnik is the "(if any)" true? I think there's always a "parent element of the flutter view" (unless viewId is wrong) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I meant that there might not be a Flutter view associated with the provided
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The revised doc comment is clearer. Thank you! However, it is more important to get the docs right in |
||||||
return _viewData[viewId]?.embeddingStrategy.hostElement; | ||||||
} | ||||||
|
||||||
EngineFlutterView? findViewForElement(DomElement? element) { | ||||||
const String viewRootSelector = | ||||||
'${DomManager.flutterViewTagName}[${GlobalHtmlAttributes.flutterViewIdAttributeName}]'; | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method could use a bit of
/// Documentation
.