[webkit-reviews] review granted: [Bug 233057] Add ModelDocument for directly showing content that can be handled by <model> : [Attachment 444452] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Nov 16 17:18:07 PST 2021
Darin Adler <darin at apple.com> has granted Dean Jackson <dino at apple.com>'s
request for review:
Bug 233057: Add ModelDocument for directly showing content that can be handled
by <model>
https://bugs.webkit.org/show_bug.cgi?id=233057
Attachment 444452: Patch
https://bugs.webkit.org/attachment.cgi?id=444452&action=review
--- Comment #13 from Darin Adler <darin at apple.com> ---
Comment on attachment 444452
--> https://bugs.webkit.org/attachment.cgi?id=444452
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=444452&action=review
> Source/WebCore/dom/Document.h:309
> -using DocumentClassFlags = unsigned char;
> +using DocumentClassFlags = uint16_t;
This should be changed to be an OptionSet at some point; would be a pretty
small change, believe it or not. That does not require using "enum class" in
case someone tries to convince you it does, but also this would be a great
choice for an enum class since all the values have DocumentClass in their
names. Also, the DocumentClass enum should use uint16_t as its underlying type.
Also does not require "enum class".
> Source/WebCore/html/ModelDocument.cpp:98
> + auto styleContent = "body { background-color: white; text-align: center;
}\n at media (prefers-color-scheme: dark) { body { background-color: rgb(32, 32,
37); } }\nmodel { width: 80vw; height: 80vh; }\n"_s;
This does not have to be one large line. Can use string pasting to format
however you like:
auto styleContent =
"body { background-color: white; text-align: center; }\n"
"@media (prefers-color-scheme: dark) { body { background-color: rgb(32,
32, 37); } }\n"
;
Maybe not exactly like that, but something like that.
> Source/WebCore/html/ModelDocument.cpp:119
> + RefPtr<Frame> frame = document.frame();
Just RefPtr is fine, no need to write <Frame>.
> Source/WebCore/html/ModelDocument.h:61
> +#endif // ENABLE(VIDEO)
Oops, MODEL_ELEMENT.
More information about the webkit-reviews
mailing list