Bug 28718 - REGRESSION: Images May Disappear if inside an element that is position:relative and display:inline
Summary: REGRESSION: Images May Disappear if inside an element that is position:relati...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Dave Hyatt
URL: http://www.creativenotice.com/html-5-...
Keywords: InRadar, Regression
Depends on:
Blocks:
 
Reported: 2009-08-25 14:33 PDT by Joseph Pecoraro
Modified: 2009-08-26 15:34 PDT (History)
4 users (show)

See Also:


Attachments
Resize the Browser to be Shorter then the Image and it disappears (1.86 KB, text/html)
2009-08-25 14:33 PDT, Joseph Pecoraro
no flags Details
Patch (2.73 KB, patch)
2009-08-26 13:30 PDT, Dave Hyatt
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2009-08-25 14:33:06 PDT
Created attachment 38570 [details]
Resize the Browser to be Shorter then the Image and it disappears

If an image is itself position:relative or contained inside an element that is position:relative it may not paint if the browser's view port doesn't contain the full image.  This can cause weird painting issues on a regular webpage such as http://www.creativenotice.com/html-5-humor

View of the attached regression in Safari 4.0.3 (Expected Behavior):
http://tr.im/x6r4?grabup

View of the attached reduction in WebKit r47686 (Bad Behavior):
http://tr.im/x6qV?grabup
Comment 1 mitz 2009-08-25 14:38:45 PDT
<rdar://problem/7169310>
Comment 2 Joseph Pecoraro 2009-08-25 14:45:51 PDT
Refined even further, it seems as though it may also be specific to an <a> tag.  My latest tests showed that:

Displays Correctly:

  <div style="position:relative">
    <img ... />
  </div>

Displays Incorrectly:

  <a style="position:relative">
    <img ... />
  </a>
Comment 3 Joseph Pecoraro 2009-08-25 14:50:40 PDT
Arg, spoke too soon!  It fails in a span, and so I tried display:inline and indeed this fails too:

  <div style="display:inline;position:relative">
    <img ... />
  </div>

"inline-block" and "block" both worked correctly, so hopefully this is specific to  inline.
Comment 4 Dave Hyatt 2009-08-26 13:30:37 PDT
Created attachment 38636 [details]
Patch
Comment 5 Simon Fraser (smfr) 2009-08-26 13:44:10 PDT
Is bug 28700 the same issue?
Comment 6 Dave Hyatt 2009-08-26 13:59:13 PDT
No, that bug actually occurs on Snow Leopard.
Comment 7 Eric Seidel (no email) 2009-08-26 14:18:55 PDT
Comment on attachment 38636 [details]
Patch

Can't we make a test for this?  It seems the test is more important than the code change in this sort of bug.
Comment 8 Dave Hyatt 2009-08-26 14:50:00 PDT
Comment on attachment 38636 [details]
Patch

Dan reviewed this.
Comment 9 Dave Hyatt 2009-08-26 15:34:06 PDT
Fixed in r47798.