Last Comment Bug 753777 - ringmark's matchMedia test fails because we don't flush to create presContext for newly-created iframe
: ringmark's matchMedia test fails because we don't flush to create presContext...
Product: Core
Classification: Components
Component: DOM: CSS Object Model (show other bugs)
: Trunk
: All All
P4 normal (vote)
: mozilla16
Assigned To: David Baron :dbaron: ⌚️UTC-8
: Jet Villegas (:jet)
Depends on:
Blocks: ringmark-ring1
  Show dependency treegraph
Reported: 2012-05-10 07:37 PDT by David Baron :dbaron: ⌚️UTC-8
Modified: 2014-05-16 04:56 PDT (History)
4 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch (2.30 KB, patch)
2012-07-05 15:26 PDT, David Baron :dbaron: ⌚️UTC-8
bzbarsky: review+
Details | Diff | Splinter Review

Description User image David Baron :dbaron: ⌚️UTC-8 2012-05-10 07:37:35 PDT
Steps to reproduce:
 1. load and let it run
 2. open Ring 1
 3. open 2D Games
 4. open CSS3 MediaQueries
 5. look at the results

Actual results: second and third tests fail

Expected results: all tests pass

What's happening here is that we're failing this null-check:
because presContext is null.

If I add a FlushPendingNotifications(Flush_Layout) call earlier in the method, the tests pass.

The question is whether there's any weaker flush (e.g., flush on the parent) that would be sufficient to ensure that nsGlobalWindow::GetPresContext gives an up-to-date result.
Comment 1 User image Boris Zbarsky [:bz] (still a bit busy) 2012-05-10 07:42:03 PDT
I _think_ that a Flush_Style on the parent should be sufficient if we don't care about having the prescontext size up to date.
Comment 2 User image David Baron :dbaron: ⌚️UTC-8 2012-05-10 07:53:51 PDT
Er, I meant to do Flush_Frames and then I did Flush_Layout for some reason.

I think we do need the size up-to-date, though, and I *think* something deeper in the code does a flush to ensure that, though I need to check.
Comment 3 User image Boris Zbarsky [:bz] (still a bit busy) 2012-05-10 09:09:27 PDT
OK.  Worst case, a Flush_Layout on the parent would suffice; nsGlobalWindow even has an EnsureSizeUpToDate helper for that.
Comment 4 User image David Baron :dbaron: ⌚️UTC-8 2012-05-17 12:31:55 PDT
nsDOMMediaQueryList actually doesn't have any flushes, but almost certainly needs them
Comment 5 User image David Baron :dbaron: ⌚️UTC-8 2012-07-05 15:26:22 PDT
Created attachment 639487 [details] [diff] [review]

Anyway, we should get this in.  comment 4 should be a separate bug.
Comment 6 User image Boris Zbarsky [:bz] (still a bit busy) 2012-07-07 21:13:01 PDT
Comment on attachment 639487 [details] [diff] [review]

Comment 7 User image David Baron :dbaron: ⌚️UTC-8 2012-07-07 22:35:27 PDT
Comment 8 User image Ryan VanderMeulen [:RyanVM] 2012-07-08 10:50:59 PDT
Comment 9 User image David Baron :dbaron: ⌚️UTC-8 2014-05-16 04:56:11 PDT
Filed bug 1011468 on comment 4.

Note You need to log in before you can comment on or make changes to this bug.