Bug 80856

Summary: Split the extra logic out of RenderObjectChildList::updateBeforeAfterContent
Product: WebKit Reporter: Igor Trindade Oliveira <igor.oliveira>
Component: Layout and RenderingAssignee: Igor Trindade Oliveira <igor.oliveira>
Status: RESOLVED FIXED    
Severity: Normal CC: dglazkov, enne, hyatt, jchaffraix, morrita, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch.
webkit.review.bot: commit-queue-
Patch jchaffraix: review+, jchaffraix: commit-queue-

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]
Patch.

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

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

New failing tests:
svg/text/text-block-child-crash.xhtml
Comment 4 Julien Chaffraix 2012-03-12 15:27:31 PDT
Comment on attachment 131396 [details]
Patch.

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]
Patch

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

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