Bug 80856 - Split the extra logic out of RenderObjectChildList::updateBeforeAfterContent
Summary: Split the extra logic out of RenderObjectChildList::updateBeforeAfterContent
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Igor Trindade Oliveira
Depends on:
Reported: 2012-03-12 10:40 PDT by Igor Trindade Oliveira
Modified: 2012-03-13 18:45 PDT (History)
6 users (show)

See Also:

Patch. (14.23 KB, patch)
2012-03-12 13:34 PDT, Igor Trindade Oliveira
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
Patch (11.91 KB, patch)
2012-03-12 16:58 PDT, Igor Trindade Oliveira
jchaffraix: review+
jchaffraix: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Trindade Oliveira 2012-03-12 10:40:58 PDT
Currently, updateBeforeAfterContent has a complex logic, it creates and updates the before and after elements. 
Splitting the extra logic out of  RenderObjectChildList::updateBeforeAfterContent, makes it easier to understand.
Comment 1 Igor Trindade Oliveira 2012-03-12 10:45:39 PDT
Patch coming.
Comment 2 Igor Trindade Oliveira 2012-03-12 13:34:57 PDT
Created attachment 131396 [details]

Proposed patch.
Comment 3 WebKit Review Bot 2012-03-12 15:08:01 PDT
Comment on attachment 131396 [details]

Attachment 131396 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/11943161

New failing tests:
Comment 4 Julien Chaffraix 2012-03-12 15:27:31 PDT
Comment on attachment 131396 [details]

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

The rest of the change looks fine but I would like a green EWS!

> Source/WebCore/rendering/RenderObjectChildList.cpp:540
> -                    return;
> -                }
> +                generatedContentContainer = createBeforeAfterGeneratedContentContainer(owner, renderer, styledObject, pseudoElementStyle);

I don't think this change is right. We used to bail out if |generatedContentContainer| was not allowed by |owner| and now we don't - because it's missing a NULL-check. I guess that's why the EWS is unhappy.

Arguably this doesn't add much so I would advise just dropping this part of the change unless you need that for your refactoring.
Comment 5 Igor Trindade Oliveira 2012-03-12 16:58:01 PDT
Created attachment 131455 [details]

Proposed patch v2.
Comment 6 Julien Chaffraix 2012-03-13 08:56:21 PDT
Comment on attachment 131455 [details]

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

> Source/WebCore/ChangeLog:3
> +        Split the extra logic out of RenderObjectChildList::updateBeforeAfterContent

Btw, I don't know what the "extra logic" is. I guess it should be either
* Split some logic out of RenderObjectChildList::updateBeforeAfterContent
* Extra part of the generated content handling logic out of RenderObjectChildList::updateBeforeAfterContent

> Source/WebCore/ChangeLog:12
> +        (WebCore):

Useless line (not your fault as prepare-ChangeLog has been sick for some time).

> Source/WebCore/ChangeLog:14
> +        (WebCore::createBeforeAfterGeneratedContentContainer):

Stale entry.

> Source/WebCore/rendering/RenderObjectChildList.cpp:350
> +    if (child && child->style()->styleType() == type) {

Nit: This could use an early return.
Comment 7 Igor Trindade Oliveira 2012-03-13 18:45:48 PDT
Committed r110656: http://trac.webkit.org/changeset/110656