Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Issue 1170583002: Recalc style or reattach when adding or removing the audio controls attribute (Closed)

Created:
5 years, 6 months ago by philipj_slow
Modified:
5 years, 6 months ago
CC:
blink-reviews, blink-reviews-html_chromium.org, mlamouri+watch-blink_chromium.org, gasubic, fs, eric.carlson_apple.com, feature-media-reviews_chromium.org, dglazkov+blink, nessy, vcarbune.chromium
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Recalc style or reattach when adding or removing the audio controls attribute In label-contains-other-interactive-content.html there is an audio element which is clicked twice, first without the controls attribute and then again after adding it. When there is no controls attribute the element doesn't have a layout object, so that amounted to clicking at (0,0). Due to the bug addressed here, adding the controls attribute also didn't cause the layout object to be created when it should, so the second click was also at (0,0). These two clicks add up to a double click, triggering a selection in the page. This is the cause of the test failure in a seemingly unrelated change: https://codereview.chromium.org/838003005/ Change label-contains-other-interactive-content.html to not (fail to) click on the audio element with no controls attribute, as it's far from obvious that clickElement(element) will click (0,0) instead. BUG=497120

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -13 lines) Patch
M LayoutTests/fast/forms/label/label-contains-other-interactive-content.html View 1 chunk +1 line, -1 line 0 comments Download
A LayoutTests/media/audio-controls-style-invalidation.html View 1 chunk +25 lines, -0 lines 0 comments Download
M Source/core/html/HTMLAudioElement.h View 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/html/HTMLAudioElement.cpp View 1 chunk +17 lines, -0 lines 0 comments Download
M Source/core/html/HTMLMediaElement.h View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/html/HTMLMediaElement.cpp View 1 chunk +0 lines, -5 lines 0 comments Download
M Source/core/html/HTMLVideoElement.h View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/html/HTMLVideoElement.cpp View 1 chunk +0 lines, -5 lines 0 comments Download

Messages

Total messages: 8 (3 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1170583002/1
5 years, 6 months ago (2015-06-05 12:44:53 UTC) #2
philipj_slow
PTAL. I'm actually not at all happy with how HTMLAudioElement::parseAttribute() looks, is there no better ...
5 years, 6 months ago (2015-06-05 12:48:01 UTC) #4
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 6 months ago (2015-06-05 14:39:25 UTC) #6
rune
The HTML spec says: "The audio element, when it is exposing a user interface, is ...
5 years, 6 months ago (2015-06-08 07:45:40 UTC) #7
philipj_slow
5 years, 6 months ago (2015-06-08 11:33:59 UTC) #8
On 2015/06/08 07:45:40, rune wrote:
> The HTML spec says:
> 
> "The audio element, when it is exposing a user interface, is expected to be
> treated as a replaced element about one line high, as wide as is necessary to
> expose the user agent's user interface features. When an audio element is not
> exposing a user interface, the user agent is expected to force its 'display'
> property to compute to 'none', irrespective of CSS rules."
> 
> Couldn't we just add a UA rule saying:
> 
> audio:not([controls]) { display: none !important }

That is excellent, I wanted to do exactly that but didn't think there was a way
to express a negative attribute selector. Live and learn:
https://codereview.chromium.org/1166743004/

Powered by Google App Engine
This is Rietveld 408576698