-
Notifications
You must be signed in to change notification settings - Fork 304
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
feat: add css variables and support link element #961
Conversation
@@ -249,7 +257,7 @@ class AssetsBundle extends KrakenBundle { | |||
: super(url); | |||
|
|||
@override | |||
Future<KrakenBundle> resolve(int contextId) async { |
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.
这个为啥要加?呀
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.
去耦合, 跟 EventTargetContext 是 nullable 的原因一样, KrakenBundle 可以单独测试, contextId 的依赖本质上是依赖 Bridge (这个 id 是 bridge 生成的)
Please enter the commit message for your changes. Lines starting
@@ -107,32 +110,37 @@ abstract class KrakenBundle { | |||
} | |||
|
|||
|
|||
Future<void> eval(int contextId) async { |
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.
如果 eval 去掉了contextId 的 耦合的话,我理解 KrakenBundle 应该是一个抽象类,在上面派生出 ,eval 的职责应该丢给 contraoller,然后 controller 提供一个 eval(BundleKraken bundle) 的方法。
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.
是的, KrakenBundle 作为抽象类会好一点
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.
这里暂时先不改了, 只是为了解决 contextId Nullable 传染性的问题才改了参数声明, 后面单独重构一个 PR 好了
@@ -853,6 +1087,14 @@ class CSSRenderStyle | |||
return realWidth; | |||
} | |||
|
|||
|
|||
@override | |||
void visitChildren<T extends RenderStyle>(RenderStyleVisitor<T> visitor) { |
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.
这里通过 element 去取 renderStyle children 职责有点不清晰,是不是考虑实现完整的 renderStyle tree,直接遍历 renderStyle tree 就好了
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.
是的, 如果有直接的 RenderStyle 树状结构, 就不需要这么去干了
目前没有, 整一个的话成本还有点高, 所以为了结构清晰我先把这个方法抽出来了, 未来实现好了之后改这里就好了
stylesheet
will send request and parse style. Close link 标签 不会发起请求 或者是 不显示在devtools面板 #955application/javascript
andapplication/x-javascript
, sincetext/javascript
is an obsolete mime.id
andtype
is a signed int, which was cast to unsigned causing not working in newly version of Flutter.