Commit f3d36175 authored by Abigail Klein's avatar Abigail Klein Committed by Commit Bot

Revert "webvtt: Add background opacity in mac"

This reverts commit 8e606757.

Reason for revert: Caused crbug.com/964244

Original change's description:
> webvtt: Add background opacity in mac
>
> To test, open a video that has a WebVTT captions file. For example, https://www.iandevlin.com/html5test/webvtt/html5-video-webvtt-sample.html is a nice example.
>
> Introduce new background opacity text track property for webvtt captions and wire it to apply opacity to the WebVTT caption HTML element.
>
> Bug: 897730
> Change-Id: Ic8dabc2279117b7ff12eb75a9daa8d26c9d9bb25
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1592622
> Commit-Queue: Abigail Klein <abigailbklein@google.com>
> Auto-Submit: Abigail Klein <abigailbklein@google.com>
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#659116}

Bug: 964244
Change-Id: I76ce88cee600ed98d48426b49d1d88a40d95e507
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1622433
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Auto-Submit: Abigail Klein <abigailbklein@google.com>
Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662163}
parent 4713e659
...@@ -47,14 +47,12 @@ std::string GetMAForegroundColorAndOpacityAsCSSColor() { ...@@ -47,14 +47,12 @@ std::string GetMAForegroundColorAndOpacityAsCSSColor() {
return color_utils::SkColorToRgbaString(rgba_color); return color_utils::SkColorToRgbaString(rgba_color);
} }
std::string GetMABackgroundColorAndOpacityAsCSSColor() { std::string GetMABackgroundColorAsCSSColor() {
base::ScopedCFTypeRef<CGColorRef> cg_color( base::ScopedCFTypeRef<CGColorRef> cg_color(
MACaptionAppearanceCopyBackgroundColor(kUserDomain, nullptr)); MACaptionAppearanceCopyBackgroundColor(kUserDomain, nullptr));
float opacity = MACaptionAppearanceGetBackgroundOpacity(kUserDomain, nullptr);
SkColor rgba_color = return color_utils::SkColorToRgbaString(
SkColorSetA(skia::CGColorRefToSkColor(cg_color.get()), 0xff * opacity); skia::CGColorRefToSkColor(cg_color.get()));
return color_utils::SkColorToRgbaString(rgba_color);
} }
// The MA text scale is a float between 0.0 and 2.0; this function converts it // The MA text scale is a float between 0.0 and 2.0; this function converts it
...@@ -127,7 +125,7 @@ CaptionStyle CaptionStyle::FromSystemSettings() { ...@@ -127,7 +125,7 @@ CaptionStyle CaptionStyle::FromSystemSettings() {
CaptionStyle style; CaptionStyle style;
style.text_color = GetMAForegroundColorAndOpacityAsCSSColor(); style.text_color = GetMAForegroundColorAndOpacityAsCSSColor();
style.background_color = GetMABackgroundColorAndOpacityAsCSSColor(); style.background_color = GetMABackgroundColorAsCSSColor();
style.text_size = GetMATextScaleAsCSSPercent(); style.text_size = GetMATextScaleAsCSSPercent();
style.text_shadow = GetMATextEdgeStyleAsCSSShadow(); style.text_shadow = GetMATextEdgeStyleAsCSSShadow();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment