Bug 129686

Summary: <audio> element takes space even with display:none
Product: WebKit Reporter: andreyklinger+webkit
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WORKSFORME    
Severity: Normal CC: dbates, eric.carlson, jer.noble, tonikitoo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: iPhone / iPad   
OS: iOS 7.0   
URL: http://jsbin.com/iphonebug/1

Description andreyklinger+webkit 2014-03-04 08:58:56 PST
Tested on Safari on iOS 7.06

<div style="border: 1px solid red">
  a<audio style="display:none; border: 1px solid green"></audio>b
</div>
Comment 1 Daniel Bates 2015-02-18 21:11:37 PST
I am neither able to reproduce this issue using the iOS Simulator to simulate an iPhone 5s running iOS 8.1 (12B411) with system WebKit nor using the same simulator device with a debug build of WebKit r180217. That is, the <audio> element is not displayed and takes no visual space such that there is no whitespace between the characters 'a' and 'b' in the text rendered on the page described by the markup in comment 0.
Comment 2 Eric Carlson 2015-02-19 10:41:55 PST
(In reply to comment #0)
> Tested on Safari on iOS 7.06
> 
> <div style="border: 1px solid red">
>   a<audio style="display:none; border: 1px solid green"></audio>b
> </div>

This was fixed in iOS8 when the media element backend was completely rewritten.