[Webkit-unassigned] [Bug 153205] Selector checker should not mutate document and style

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 18 15:18:23 PST 2016


https://bugs.webkit.org/show_bug.cgi?id=153205

Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #269223|review?                     |review+
              Flags|                            |

--- Comment #6 from Darin Adler <darin at apple.com> ---
Comment on attachment 269223
  --> https://bugs.webkit.org/attachment.cgi?id=269223
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=269223&action=review

> Source/WebCore/css/SelectorChecker.cpp:91
> +    checkingContext.styleRelations.append({ const_cast<Element&>(element), type, value });

A little strange that we end up using the const_cast here. Any way to avoid it in future? I guess you are focusing on using const here more to express the fact that we won’t be setting flags and such on the Element.

> Source/WebCore/css/SelectorChecker.cpp:1014
> +        LocalContext subContext(context);

The coined word “subcontext” is a single word and it should not have a capital "C" in it.

> Source/WebCore/css/SelectorCheckerTestFunctions.h:66
> +ALWAYS_INLINE bool isMediaDocument(const Element* element)

This requires a non-null pointer, so I would have expected it to take a reference. Then I thought there was some assembly-language-related reason these have to take pointers, but I noticed that isChecked takes a reference.

> Source/WebCore/css/SelectorCheckerTestFunctions.h:86
> +ALWAYS_INLINE bool isInRange(const Element* element)

Ditto.

> Source/WebCore/css/SelectorCheckerTestFunctions.h:91
> +ALWAYS_INLINE bool isOutOfRange(const Element* element)

Ditto.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160118/b37e3486/attachment.html>


More information about the webkit-unassigned mailing list