[Webkit-unassigned] [Bug 64412] didFirstVisuallyNonEmptyLayout dispatched too early

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 12 17:35:18 PDT 2011


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


Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #100595|review?                     |review+
               Flag|                            |




--- Comment #4 from Darin Adler <darin at apple.com>  2011-07-12 17:35:18 PST ---
(From update of attachment 100595)
View in context: https://bugs.webkit.org/attachment.cgi?id=100595&action=review

> Source/WebCore/page/FrameView.cpp:2059
> -        if (m_isVisuallyNonEmpty && m_firstVisuallyNonEmptyLayoutCallbackPending) {
> +
> +        // Ensure that we always send this eventually.
> +        if (!m_frame->document()->parsing())
> +            m_isVisuallyNonEmpty = true;
> +
> +        if (m_isVisuallyNonEmpty && !m_frame->document()->didLayoutWithPendingStylesheets() && m_firstVisuallyNonEmptyLayoutCallbackPending) {

There is nothing in the change log or code that explains why you added a new check of didLayoutWithPendingStylesheets here.

> Source/WebCore/page/FrameView.h:231
> +    void incrementVisuallyNonEmptyPixelCount(const IntSize& size);

The name “size” here doesn’t add anything, so you should omit it.

> Source/WebCore/page/FrameView.h:461
> +    static const unsigned visualCharacterThreshold = 200;

Would like a why comment explaining where this threshold came from. There isn’t even a comment explaining why we made visually non-empty a heuristic rather than a more brittle but well defined mechanism. There should be.

> Source/WebCore/page/FrameView.h:470
> +    m_visuallyNonEmptyPixelCount += size.width() * size.height();

Any risk of overflow here?

> Source/WebCore/page/FrameView.h:471
> +    static const unsigned visualPixelThreshold = 256 * 256;

Same kind of comment about threshold needed as above.

> Source/WebCore/rendering/RenderImage.cpp:146
> +    if (!m_didIncrementVisuallyNonEmptyPixelCount) {
> +        view()->frameView()->incrementVisuallyNonEmptyPixelCount(m_imageResource->imageSize(1.0f));
> +        m_didIncrementVisuallyNonEmptyPixelCount = true;
> +    }

Does this do the right thing for incrementally loading images? Seems like it will only do the pixel count thing once, perhaps with a smaller size than the actual final size?

> Source/WebCore/rendering/RenderText.cpp:114
> -    // FIXME: It would be better to call this only if !m_text->containsOnlyWhitespace().
> -    // But that might slow things down, and maybe should only be done if visuallyNonEmpty
> -    // is still false. Not making any change for now, but should consider in the future.
> -    view()->frameView()->setIsVisuallyNonEmpty();
> +    view()->frameView()->incrementVisuallyNonEmptyCharacterCount(m_text.length());

Not worried about cases where there is nothing but a lot of whitespace?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list