Bug 144528 - Assertion failure (!needsLayout()) loading inkedmag.com
Summary: Assertion failure (!needsLayout()) loading inkedmag.com
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-05-02 12:04 PDT by Simon Fraser (smfr)
Modified: 2015-05-04 12:19 PDT (History)
14 users (show)

See Also:


Attachments
Patch (24.73 KB, patch)
2015-05-02 12:12 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (24.79 KB, patch)
2015-05-02 12:13 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
For EWS (21.25 KB, patch)
2015-05-02 14:11 PDT, Simon Fraser (smfr)
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2015-05-02 12:04:09 PDT
Assertion failure (!needsLayout()) loading inkedmag.com
Comment 1 Simon Fraser (smfr) 2015-05-02 12:12:30 PDT
Created attachment 252241 [details]
Patch
Comment 2 Simon Fraser (smfr) 2015-05-02 12:13:42 PDT
Created attachment 252242 [details]
Patch
Comment 3 Simon Fraser (smfr) 2015-05-02 12:13:55 PDT
rdar://problem/20788681
Comment 4 Darin Adler 2015-05-02 12:31:43 PDT
Comment on attachment 252242 [details]
Patch

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

GTK and EFL build errors are both:
Source/WebCore/rendering/RenderReplaced.cpp:143:5: error: 'SetLayoutNeededForbiddenScope' is not a member of 'WebCore::RenderObject'

r=me assuming you fix the release build, but please consider my comments too

> Source/WebCore/platform/graphics/BitmapImage.cpp:91
> +void BitmapImage::startTimer(double delay)

In new code, we should be using standard library types, not doubles, for time and duration values. I think std::chrono::milliseconds might be what we want here and it’s probably worth considering rewriting the code to use it.

> Source/WebCore/platform/graphics/BitmapImage.cpp:94
> +    m_frameTimer = std::make_unique<Timer>(*this, &BitmapImage::advanceAnimation);
> +    m_frameTimer->startOneShot(delay);

Should we assert there is no existing timer? If there is, then destroying it is a side effect that doesn’t seem like part of the function name “start timer”.

Surprisingly low level graphics class to have a timer in it. I realize you were just refactoring, but I am still surprised. In modern code we would use a lambda instead of a pointer to member function for the timer.

> Source/WebCore/platform/graphics/BitmapImage.h:339
> +    bool m_pendingNotifyAfterCaughtUpToLastFrame : 1;

I find this name confusing. The noun here seems to be “notify” as in “this is a notify”, which doesn’t make sense. How would you describe this boolean flag in colloquial English? Maybe that would point to a better name for it.

> Source/WebCore/rendering/RenderReplaced.cpp:143
> +    RenderObject::SetLayoutNeededForbiddenScope scope(this);

Looks like this class is defined for builds without NDEBUG only. Would be better if it was a harmless inlined no-op in those builds, but otherwise you need to put #ifndef NDEBUG around this. Also, it should take a RenderObject&, not a RenderObject*.

Shouldn’t need the RenderObject:: prefix here. This is a member function of a class derived from RenderObject so that should already be in scope without an explicit qualifier.
Comment 5 Simon Fraser (smfr) 2015-05-02 14:02:01 PDT
(In reply to comment #4)
> Comment on attachment 252242 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=252242&action=review
> 
> GTK and EFL build errors are both:
> Source/WebCore/rendering/RenderReplaced.cpp:143:5: error:
> 'SetLayoutNeededForbiddenScope' is not a member of 'WebCore::RenderObject'
> 
> r=me assuming you fix the release build, but please consider my comments too
> 
> > Source/WebCore/platform/graphics/BitmapImage.cpp:91
> > +void BitmapImage::startTimer(double delay)
> 
> In new code, we should be using standard library types, not doubles, for
> time and duration values. I think std::chrono::milliseconds might be what we
> want here and it’s probably worth considering rewriting the code to use it.

I'd prefer to switch the entire class over to std::chrono later.

> > Source/WebCore/platform/graphics/BitmapImage.cpp:94
> > +    m_frameTimer = std::make_unique<Timer>(*this, &BitmapImage::advanceAnimation);
> > +    m_frameTimer->startOneShot(delay);
> 
> Should we assert there is no existing timer? If there is, then destroying it
> is a side effect that doesn’t seem like part of the function name “start
> timer”.

Added assert.

> Surprisingly low level graphics class to have a timer in it. I realize you
> were just refactoring, but I am still surprised. In modern code we would use
> a lambda instead of a pointer to member function for the timer.

Agreed; timer cleanup can come in a separate patch.

> > Source/WebCore/platform/graphics/BitmapImage.h:339
> > +    bool m_pendingNotifyAfterCaughtUpToLastFrame : 1;
> 
> I find this name confusing. The noun here seems to be “notify” as in “this
> is a notify”, which doesn’t make sense. How would you describe this boolean
> flag in colloquial English? Maybe that would point to a better name for it.

Renamed.

> > Source/WebCore/rendering/RenderReplaced.cpp:143
> > +    RenderObject::SetLayoutNeededForbiddenScope scope(this);
> 
> Looks like this class is defined for builds without NDEBUG only. Would be
> better if it was a harmless inlined no-op in those builds, but otherwise you
> need to put #ifndef NDEBUG around this. Also, it should take a
> RenderObject&, not a RenderObject*.

Wrapping in #ifndef NDEBUG for now, will clean up in a separate patch.

> Shouldn’t need the RenderObject:: prefix here. This is a member function of
> a class derived from RenderObject so that should already be in scope without
> an explicit qualifier.

Fixed.
Comment 6 Simon Fraser (smfr) 2015-05-02 14:11:17 PDT
Created attachment 252245 [details]
For EWS
Comment 7 Simon Fraser (smfr) 2015-05-03 09:16:31 PDT
Comment on attachment 252245 [details]
For EWS

Bring Darin's review forward.
Comment 8 Simon Fraser (smfr) 2015-05-03 09:16:45 PDT
http://trac.webkit.org/changeset/183732
Comment 10 Simon Fraser (smfr) 2015-05-04 10:09:50 PDT
No, I'll take a look when I get in soon.
Comment 11 Simon Fraser (smfr) 2015-05-04 12:19:17 PDT
Windows test skipped in https://trac.webkit.org/r183756.