Intermittent test_HTMLSpec.html | role: figure, name: 'Caption for the awesome picture ', address: 0x7f439cf288c0] have different children at index 1 : role: text leaf, name: ' ', address: 0x7f4379679e80]

RESOLVED FIXED in Firefox 59

Status

()

defect
P5
normal
RESOLVED FIXED
2 years ago
7 months ago

People

(Reporter: intermittent-bug-filer, Assigned: aosmond)

Tracking

(Blocks 1 bug, {intermittent-failure})

unspecified
mozilla60
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox59 fixed, firefox60 fixed)

Details

Attachments

(2 attachments, 2 obsolete attachments)

Blocks: 1383682
It looks like this failure is a subtle timing bug on when the image's metadata is decoded. Most of the time when it gets to the HTML code block below, it has already figured out the image size and thus hits the success case. But sometimes it doesn't and it hits the failure case.

Original HTML:
  <figure id="figure">
    <img src="../moz.png" alt="An awesome picture">
    <figcaption id="figcaption">Caption for the awesome picture</figcaption>
  </figure>

Success case, the image size was known when the nsImageFrame was first constructed:
    line 7fb9d3221a20: count=1 state=block,clean,prevmarginclean,not impacted,not wrapped,before:nobr,after:nobr[0x108] bm=960 {2400,126156,23940,3660} <
      Block(figure)(82)@7fb9a9add148 parent=7fb9b528dca8 next=7fb9a9add700 {2400,126156,23940,3660} [state=0000120000020200] [content=7fb9b52a2dc0] [sc=7fb9a9adae78]<
        line 7fb9a9add660: count=1 state=inline,clean,prevmarginclean,not impacted,not wrapped,before:nobr,after:nobr[0x100] {0,0,5340,2520} <
          ImageFrame(img)(1)@7fb9a9add348 parent=7fb9a9add148 next=7fb9a9add430 {0,0,5340,2280} [state=0000400000200200] bidi(0,0,255) [content=7fb9b34cf840] [sc=7fb9a9adb490] [src=chrome://mochitests/content/a11y/accessible/tests/mochitest/moz.png]
        >
        line 7fb9a9add6b0: count=1 state=block,clean,prevmarginclean,not impacted,not wrapped,before:nobr,after:nobr[0x8] {0,2520,23940,1140} <
          Block(figcaption)(3)@7fb9a9add430 parent=7fb9a9add148 {0,2520,23940,1140} [state=0000120000000200] bidi(0,0,255) [content=7fb9b52a2e50] [sc=7fb9a9add1f8]<
            line 7fb9a9add610: count=1 state=inline,clean,prevmarginclean,not impacted,not wrapped,before:nobr,after:nobr[0x100] {0,0,15840,1140} <
              Text(0)"Caption for the awesome picture"@7fb9a9add588 parent=7fb9a9add430 {0,0,15840,1140} [state=00000000b0600000] [content=7fb9ba79d880] [sc=7fb9a9adb9c8:-moz-text] [run=7fb9d32816b0][0,31,T] 
            >
          >
        >
      >
    >

Failure case, the image size was not known when the nsImageFrame was first constructed:
    line 7f1fb34bfa20: count=1 state=block,clean,prevmarginclean,not impacted,not wrapped,before:nobr,after:nobr[0x108] bm=960 {2400,125946,23940,2280} vis-overflow=2370,125946,23970,2280 scr-overflow=2400,125946,23940,2280 <
      Block(figure)(82)@7f1fb2ecd148 parent=7f1fb3f98ca8 next=7f1fb2ecd910 {2400,125946,23940,2280} vis-overflow=-30,0,23970,2280 scr-overflow=0,0,23940,2280 [state=0000120000020200] [content=7f1facceee50] [sc=7f1fb2ec4e78]<
        line 7f1fb2ecd870: count=1 state=inline,clean,prevmarginclean,not impacted,not wrapped,before:nobr,after:nobr[0x100] {0,0,9870,1140} vis-overflow=-30,0,9900,1140 scr-overflow=0,0,9870,1140 <
          Inline(img)(1)@7f1fb2ecd498 parent=7f1fb2ecd148 next=7f1fb2ecd640 {0,0,9870,1140} vis-overflow=-30,0,9900,1140 [state=0000100000e00200] [content=7f1fa0139970] [sc=7f1fb2ec5490]<
            Inline(_moz_generated_content_before)(-1)@7f1fb2ecd528 parent=7f1fb2ecd498 {0,0,9870,1140} vis-overflow=-30,0,9900,1140 [state=0000100000e00240] [content=7f1fb27cd0d0] [sc=7f1fb2ec59c8:before]<
              Text(0)"An awesome picture"@7f1fb2ecd5b8 parent=7f1fb2ecd528 {0,0,9870,1140} vis-overflow=-30,0,9900,1140 [state=00000000b0620040] bidi(0,0,255) [content=7f1fb2433840] [sc=7f1fb2ec5dd0:-moz-text] [run=7f1fb4fc4df0][0,18,T] 
            >
          >
        >
        line 7f1fb2ecd8c0: count=1 state=block,clean,prevmarginclean,not impacted,not wrapped,before:nobr,after:nobr[0x8] {0,1140,23940,1140} <
          Block(figcaption)(3)@7f1fb2ecd640 parent=7f1fb2ecd148 {0,1140,23940,1140} [state=0000120000000200] bidi(0,0,255) [content=7f1facceeee0] [sc=7f1fb2ecd1f8]<
            line 7f1fb2ecd820: count=1 state=inline,clean,prevmarginclean,not impacted,not wrapped,before:nobr,after:nobr[0x100] {0,0,15900,1140} <
              Text(0)"Caption for the awesome picture"@7f1fb2ecd798 parent=7f1fb2ecd640 {0,0,15900,1140} [state=00000000b0600000] [content=7f1facc5f580] [sc=7f1fb2ecd2a0:-moz-text] [run=7f1fb3315980][0,31,T] 
            >
          >
        >
      >
    >

Failure case, after the image size was determined and the nsImageFrame was reconstructed:
    line 7f1fb34bfa20: count=1 state=block,clean,prevmarginclean,not impacted,not wrapped,before:nobr,after:nobr[0x148] bm=960 {2400,125946,23940,3660} <
      Block(figure)(82)@7f1fb2ecd148 parent=7f1fb3f98ca8 next=7f1fb2ecd910 {2400,125946,23940,3660} [state=0002120000020200] [content=7f1facceee50] [sc=7f1fb2ec4e78]<
        line 7f1fb2ecd870: count=3 state=inline,clean,prevmarginclean,not impacted,not wrapped,before:nobr,after:nobr[0x100] {0,0,5340,2520} <
          Text(0)"\n    "@7f1fb2ecd5b8 parent=7f1fb2ecd148 next=7f1faee50ee0 {0,2280,0,0} [state=4000000028220000] bidi(0,0,255) [content=7f1facc5f400] [sc=7f1fb2ec5dd0:-moz-text] [run=7f1fa28e59e0][0,5,T] 
          ImageFrame(img)(1)@7f1faee50ee0 parent=7f1fb2ecd148 next=7f1f9ff59020 {0,0,5340,2280} [state=0000400000200200] bidi(0,0,255) [content=7f1fa0139970] [sc=7f1fb2ec5490] [src=chrome://mochitests/content/a11y/accessible/tests/mochitest/moz.png]
          Text(2)"\n    "@7f1f9ff59020 parent=7f1fb2ecd148 next=7f1fb2ecd640 {5340,1380,0,1140} [state=40010000a0420000] bidi(0,0,255) [content=7f1facc5f480] [sc=7f1fb2ec5dd0:-moz-text] [run=7f1fa28e5b30][0,5,T] 
        >
        line 7f1fb2ecd8c0: count=1 state=block,clean,prevmarginclean,not impacted,not wrapped,before:nobr,after:nobr[0x48] {0,2520,23940,1140} <
          Block(figcaption)(3)@7f1fb2ecd640 parent=7f1fb2ecd148 {0,2520,23940,1140} [state=0000120000000200] bidi(0,0,255) [content=7f1facceeee0] [sc=7f1fb2ecd1f8]<
            line 7f1fb2ecd820: count=1 state=inline,clean,prevmarginclean,not impacted,not wrapped,before:nobr,after:nobr[0x100] {0,0,15900,1140} <
              Text(0)"Caption for the awesome picture"@7f1fb2ecd798 parent=7f1fb2ecd640 {0,0,15900,1140} [state=00000000b0600000] [content=7f1facc5f580] [sc=7f1fb2ecd2a0:-moz-text] [run=7f1fb3315980][0,31,T] 
            >
          >
        >
      >
    >
Assignee: nobody → aosmond
In combination with the patch in bug 1383682, I have reproduced both success and failure with a debug Linux build in rr with this simplified test case.
During the nsImageFrame reconstruction,

https://searchfox.org/mozilla-central/rev/f5f1c3f294f89cfd242c3af9eb2c40d19d5e04e7/layout/base/nsCSSFrameConstructor.cpp#6311

AtLineBoundary returns false. This short circuits the other checks and inserts the nsTextFrame.
Status: NEW → ASSIGNED
After further discussion with tnikkel and yzen, I believe we can fix the tests simply by removing the extra whitespace. Layout produced a valid tree with and without the extra whitespace, it is just an optimization when it chooses to remove it, and so when validating the accessibility tree, it shouldn't expect those optimizations to be applied consistently, because in this case it is indirectly controlled by the image cache state.

try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=dab24372c1067032d885f891a5ec44bed4411aed
Depends on: 1296784
Attachment #8947804 - Attachment is obsolete: true
Attachment #8948664 - Flags: review?(yzenevich)
Comment on attachment 8948664 [details] [diff] [review]
0004-Bug-1408636-Ensure-accessibility-tests-pass-regardle.patch, v3

Review of attachment 8948664 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks

::: accessible/tests/mochitest/name/markuprules.xml
@@ +234,5 @@
>                    title="no name from title"/>
>      </markup>
>  
> +    <!--
> +      Disabled due to intermittent failures (bug 1296784) which became more

Let's open a bug for this disabled test.

::: accessible/tests/mochitest/treeupdate/test_whitespace.html
@@ +169,5 @@
>    <div id="content" style="display: none"></div>
>    <pre id="test">
>    </pre>
>  
> +  <div id="container1"><img src="../moz.png">  <img id="img1" src="../moz.png">  <img src="../moz.png"></div>

Could you add the same comment here too?
Attachment #8948664 - Flags: review?(yzenevich) → review+
Blocks: 1436323
Pushed by aosmond@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/7d098669f8cb
Ensure accessibility tests pass regardless of image caching affecting whitespace. r=yzen
https://hg.mozilla.org/mozilla-central/rev/7d098669f8cb
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
No longer depends on: 1523555
You need to log in before you can comment on or make changes to this bug.