From 3bee7b7e127be7b378a90569c63b82cde9fb20bc Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Tue, 9 Feb 2016 16:42:28 +0000 Subject: Layout: Don't generate :before and :after boxes for replaced elements. In CSS 2.1 this was undefined. CSS 2.1 -- 12.1 The :before and :after pseudo-elements Note. This specification does not fully define the interaction of :before and :after with replaced elements (such as IMG in HTML). This will be defined in more detail in a future specification. -- https://www.w3.org/TR/CSS21/generate.html#before-after-content In CSS 3 the :before and :after generated content boxes are not allowed on replaced elements. CSS 3 Generated and Replaced Content Module 12. Replaced content The box model defines different rules for the layout of replaced elements than normal elements. Replaced elements do not have '::before' and '::after' pseudo-elements; the 'content' property in the case of replaced content replaces the entire contents of the element's box. -- https://www.w3.org/TR/css3-content/#replacedContent --- render/box.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'render/box.h') diff --git a/render/box.h b/render/box.h index 1f35adad9..4ac3453aa 100644 --- a/render/box.h +++ b/render/box.h @@ -132,7 +132,8 @@ typedef enum { NEED_MIN = 1 << 8, /* minimum width is required for layout */ REPLACE_DIM = 1 << 9, /* replaced element has given dimensions */ IFRAME = 1 << 10, /* box contains an iframe */ - CONVERT_CHILDREN = 1 << 11 /* wanted children converting */ + CONVERT_CHILDREN = 1 << 11, /* wanted children converting */ + IS_REPLACED = 1 << 12 /* box is a replaced element */ } box_flags; /* Sides of a box */ -- cgit v1.2.3