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: positioned element logical width/height calculation #1053
Conversation
// The width of positioned, non-replaced element is determined as following algorithm. | ||
// https://www.w3.org/TR/css-position-3/#abs-non-replaced-width | ||
} else if ((renderStyle.position == CSSPositionType.absolute || | ||
renderStyle.position == CSSPositionType.fixed) |
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.
sticky 需要考虑吗
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.
翻了下上面的文档, 应该是不需要的 忽略
// The width of positioned, non-replaced element is determined as following algorithm. | ||
// https://www.w3.org/TR/css-position-3/#abs-non-replaced-width | ||
} else if ((renderStyle.position == CSSPositionType.absolute || | ||
renderStyle.position == CSSPositionType.fixed) |
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.
翻了下上面的文档, 应该是不需要的 忽略
} | ||
// Should access the renderStyle of renderBoxModel parent but not renderStyle parent | ||
// cause the element of renderStyle parent may not equal to containing block. | ||
RenderBoxModel parent = current.parent as RenderBoxModel; |
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.
这里会不会 parent 不存在?
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.
上面的判断 current.parent is! RenderBoxModel
已经排除了 parent 为 null 的 case
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.
OK
Closes #1051