summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorLuke Wilde <lukew@serenityos.org>2022-10-10 17:25:06 +0100
committerAndreas Kling <kling@serenityos.org>2022-10-10 19:33:34 +0200
commit081a617d8d16a1d13488572b49b8edc2eaf6ab2f (patch)
tree1e6512b7f7ca432632ee189f0b54408a3850b216 /Userland
parent6a7c5608496bfd6efad1a70fb6b7e3b135657cc4 (diff)
downloadserenity-081a617d8d16a1d13488572b49b8edc2eaf6ab2f.zip
LibWeb: Use the default CSS attributes for embedded content from HTML
The main benefit of this is respecting the iframe frameborder attribute, as frameborder="0" is a pretty common way of removing the default <iframe> border. For example, it's on all YouTube embeds by default and on some ReCAPTCHA embeds.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/CSS/Default.css43
1 files changed, 43 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Default.css b/Userland/Libraries/LibWeb/CSS/Default.css
index f2b417295f..60b8ec8c6a 100644
--- a/Userland/Libraries/LibWeb/CSS/Default.css
+++ b/Userland/Libraries/LibWeb/CSS/Default.css
@@ -623,6 +623,49 @@ video {
object-fit: contain;
}
+/* 15.4.3 Attributes for embedded content and images
+ * https://html.spec.whatwg.org/multipage/rendering.html#attributes-for-embedded-content-and-images
+ */
+
+iframe[frameborder='0'], iframe[frameborder=no i] { border: none; }
+
+embed[align=left i], iframe[align=left i], img[align=left i],
+input[type=image i][align=left i], object[align=left i] {
+ float: left;
+}
+
+embed[align=right i], iframe[align=right i], img[align=right i],
+input[type=image i][align=right i], object[align=right i] {
+ float: right;
+}
+
+embed[align=top i], iframe[align=top i], img[align=top i],
+input[type=image i][align=top i], object[align=top i] {
+ vertical-align: top;
+}
+
+embed[align=baseline i], iframe[align=baseline i], img[align=baseline i],
+input[type=image i][align=baseline i], object[align=baseline i] {
+ vertical-align: baseline;
+}
+
+embed[align=texttop i], iframe[align=texttop i], img[align=texttop i],
+input[type=image i][align=texttop i], object[align=texttop i] {
+ vertical-align: text-top;
+}
+
+embed[align=absmiddle i], iframe[align=absmiddle i], img[align=absmiddle i],
+input[type=image i][align=absmiddle i], object[align=absmiddle i],
+embed[align=abscenter i], iframe[align=abscenter i], img[align=abscenter i],
+input[type=image i][align=abscenter i], object[align=abscenter i] {
+ vertical-align: middle;
+}
+
+embed[align=bottom i], iframe[align=bottom i], img[align=bottom i],
+input[type=image i][align=bottom i], object[align=bottom i] {
+ vertical-align: bottom;
+}
+
/* 15.5.4 The details and summary elements
* https://html.spec.whatwg.org/multipage/rendering.html#the-details-and-summary-elements
*/