-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50e6165
commit f7295bc
Showing
254 changed files
with
40,825 additions
and
0 deletions.
There are no files selected for viewing
457 changes: 457 additions & 0 deletions
457
...30.0a2bca2cbfc754632edf0ca64f1c5c0c1e77ce88/093014d4a09e94c29881edb97478c3e30cfa6c69.diff
Large diffs are not rendered by default.
Oops, something went wrong.
668 changes: 668 additions & 0 deletions
668
...30.0a2bca2cbfc754632edf0ca64f1c5c0c1e77ce88/0ad3c6a678815e38b506b4a95bb65a58046bfd75.diff
Large diffs are not rendered by default.
Oops, something went wrong.
121 changes: 121 additions & 0 deletions
121
...30.0a2bca2cbfc754632edf0ca64f1c5c0c1e77ce88/0cc423b3e32c32214331a420d1a53d7370d311b6.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
diff --git a/layout/style/test/test_non_content_accessible_values.html b/layout/style/test/test_non_content_accessible_values.html | ||
index 633427f8e12f..7ba1cf9f05e1 100644 | ||
--- a/layout/style/test/test_non_content_accessible_values.html | ||
+++ b/layout/style/test/test_non_content_accessible_values.html | ||
@@ -45,6 +45,7 @@ const NON_CONTENT_ACCESSIBLE_VALUES = { | ||
"menucheckbox", | ||
"menuradio", | ||
"menuseparator", | ||
+ "menuarrow", | ||
"menuimage", | ||
"-moz-menulist-arrow-button", | ||
"checkbox-container", | ||
diff --git a/servo/components/style/values/specified/box.rs b/servo/components/style/values/specified/box.rs | ||
index 177e288cd221..859685fca099 100644 | ||
--- a/servo/components/style/values/specified/box.rs | ||
+++ b/servo/components/style/values/specified/box.rs | ||
@@ -1491,6 +1491,9 @@ pub enum Appearance { | ||
/// Menu Popup background. | ||
#[parse(condition = "ParserContext::chrome_rules_enabled")] | ||
Menupopup, | ||
+ /// Menu item arrow. | ||
+ #[parse(condition = "ParserContext::chrome_rules_enabled")] | ||
+ Menuarrow, | ||
/// The meter bar's meter indicator. | ||
#[parse(condition = "ParserContext::chrome_rules_enabled")] | ||
Meterchunk, | ||
diff --git a/widget/Theme.cpp b/widget/Theme.cpp | ||
index daeb09785056..042412bb7cbd 100644 | ||
--- a/widget/Theme.cpp | ||
+++ b/widget/Theme.cpp | ||
@@ -761,17 +761,25 @@ enum class PhysicalArrowDirection { | ||
Bottom, | ||
}; | ||
|
||
-void Theme::PaintMenulistArrow(nsIFrame* aFrame, DrawTarget& aDrawTarget, | ||
- const LayoutDeviceRect& aRect) { | ||
+void Theme::PaintMenuArrow(StyleAppearance aAppearance, nsIFrame* aFrame, | ||
+ DrawTarget& aDrawTarget, | ||
+ const LayoutDeviceRect& aRect) { | ||
// not const: these may be negated in-place below | ||
float polygonX[] = {-4.0f, -0.5f, 0.5f, 4.0f, 4.0f, | ||
3.0f, 0.0f, 0.0f, -3.0f, -4.0f}; | ||
float polygonY[] = {-1, 3.0f, 3.0f, -1.0f, -2.0f, | ||
-2.0f, 1.5f, 1.5f, -2.0f, -2.0f}; | ||
|
||
+ const bool isMenuList = | ||
+ aAppearance == StyleAppearance::MozMenulistArrowButton; | ||
const float kPolygonSize = kMinimumDropdownArrowButtonWidth; | ||
+ | ||
const auto direction = [&] { | ||
const auto wm = aFrame->GetWritingMode(); | ||
+ if (!isMenuList) { | ||
+ return wm.IsPhysicalRTL() ? PhysicalArrowDirection::Left | ||
+ : PhysicalArrowDirection::Right; | ||
+ } | ||
switch (wm.GetBlockDir()) { | ||
case WritingMode::BlockDir::LR: | ||
return PhysicalArrowDirection::Right; | ||
@@ -1217,12 +1225,13 @@ bool Theme::DoDrawWidgetBackground(PaintBackendData& aPaintData, | ||
case StyleAppearance::Menulist: | ||
PaintMenulist(aPaintData, devPxRect, elementState, colors, dpiRatio); | ||
break; | ||
+ case StyleAppearance::Menuarrow: | ||
case StyleAppearance::MozMenulistArrowButton: | ||
if constexpr (std::is_same_v<PaintBackendData, WebRenderBackendData>) { | ||
// TODO: Need to figure out how to best draw this using WR. | ||
return false; | ||
} else { | ||
- PaintMenulistArrow(aFrame, aPaintData, devPxRect); | ||
+ PaintMenuArrow(aAppearance, aFrame, aPaintData, devPxRect); | ||
} | ||
break; | ||
case StyleAppearance::Tooltip: { | ||
@@ -1687,6 +1696,7 @@ bool Theme::ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* aFrame, | ||
case StyleAppearance::MenulistButton: | ||
case StyleAppearance::NumberInput: | ||
case StyleAppearance::PasswordInput: | ||
+ case StyleAppearance::Menuarrow: | ||
case StyleAppearance::MozMenulistArrowButton: | ||
case StyleAppearance::SpinnerUpbutton: | ||
case StyleAppearance::SpinnerDownbutton: | ||
diff --git a/widget/Theme.h b/widget/Theme.h | ||
index f107b7488da4..0c28d66b4090 100644 | ||
--- a/widget/Theme.h | ||
+++ b/widget/Theme.h | ||
@@ -171,7 +171,8 @@ class Theme : protected nsNativeTheme, public nsITheme { | ||
template <typename PaintBackendData> | ||
void PaintMenulist(PaintBackendData&, const LayoutDeviceRect&, | ||
const ElementState&, const Colors&, DPIRatio); | ||
- void PaintMenulistArrow(nsIFrame*, DrawTarget&, const LayoutDeviceRect&); | ||
+ void PaintMenuArrow(StyleAppearance, nsIFrame*, DrawTarget&, | ||
+ const LayoutDeviceRect&); | ||
void PaintSpinnerButton(nsIFrame*, DrawTarget&, const LayoutDeviceRect&, | ||
const ElementState&, StyleAppearance, const Colors&, | ||
DPIRatio); | ||
diff --git a/widget/nsNativeTheme.cpp b/widget/nsNativeTheme.cpp | ||
index 4c78d3fa5387..bb83cf4cad11 100644 | ||
--- a/widget/nsNativeTheme.cpp | ||
+++ b/widget/nsNativeTheme.cpp | ||
@@ -572,5 +572,6 @@ bool nsNativeTheme::IsWidgetAlwaysNonNative(nsIFrame* aFrame, | ||
StyleAppearance aAppearance) { | ||
return IsWidgetScrollbarPart(aAppearance) || | ||
aAppearance == StyleAppearance::FocusOutline || | ||
+ aAppearance == StyleAppearance::Menuarrow || | ||
(aFrame && aFrame->StyleUI()->mMozTheme == StyleMozTheme::NonNative); | ||
} | ||
diff --git a/widget/windows/nsNativeThemeWin.cpp b/widget/windows/nsNativeThemeWin.cpp | ||
index 1a8af27882e5..466df9ffef9e 100644 | ||
--- a/widget/windows/nsNativeThemeWin.cpp | ||
+++ b/widget/windows/nsNativeThemeWin.cpp | ||
@@ -1554,6 +1554,10 @@ LayoutDeviceIntSize nsNativeThemeWin::ClassicGetMinimumWidgetSize( | ||
nsIFrame* aFrame, StyleAppearance aAppearance) { | ||
LayoutDeviceIntSize result; | ||
switch (aAppearance) { | ||
+ case StyleAppearance::Menuarrow: | ||
+ result.width = ::GetSystemMetrics(SM_CXMENUCHECK); | ||
+ result.height = ::GetSystemMetrics(SM_CYMENUCHECK); | ||
+ break; | ||
case StyleAppearance::RangeThumb: { | ||
if (IsRangeHorizontal(aFrame)) { | ||
result.width = 12; |
35 changes: 35 additions & 0 deletions
35
...30.0a2bca2cbfc754632edf0ca64f1c5c0c1e77ce88/114d7ff3449897d16070c36f67858a5ae75a1b8b.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
diff --git a/widget/windows/nsWindowGfx.cpp b/widget/windows/nsWindowGfx.cpp | ||
index e9e5ee63c1f5..cf07794300de 100644 | ||
--- a/widget/windows/nsWindowGfx.cpp | ||
+++ b/widget/windows/nsWindowGfx.cpp | ||
@@ -209,19 +209,19 @@ bool nsWindow::OnPaint(uint32_t aNestingLevel) { | ||
translucentRegion.SubOut(mOpaqueRegion); | ||
region.OrWith(translucentRegion); | ||
} | ||
+ } | ||
|
||
- if (mNeedsNCAreaClear || | ||
- (didResize && mTransparencyMode == TransparencyMode::Transparent)) { | ||
- // We need to clear the non-client-area region, and the transparent parts | ||
- // of the window to black (once). | ||
- auto black = reinterpret_cast<HBRUSH>(::GetStockObject(BLACK_BRUSH)); | ||
- nsAutoRegion regionToClear(ComputeNonClientHRGN()); | ||
- if (!translucentRegion.IsEmpty()) { | ||
- nsAutoRegion translucent(WinUtils::RegionToHRGN(translucentRegion)); | ||
- ::CombineRgn(regionToClear, regionToClear, translucent, RGN_OR); | ||
- } | ||
- ::FillRgn(hDC, regionToClear, black); | ||
+ if (!usingMemoryDC && (mNeedsNCAreaClear || didResize)) { | ||
+ // We need to clear the non-client-area region, and the transparent parts | ||
+ // of the window to black (once). | ||
+ auto black = reinterpret_cast<HBRUSH>(::GetStockObject(BLACK_BRUSH)); | ||
+ nsAutoRegion regionToClear(ComputeNonClientHRGN()); | ||
+ if (mTransparencyMode == TransparencyMode::Transparent && | ||
+ !translucentRegion.IsEmpty()) { | ||
+ nsAutoRegion translucent(WinUtils::RegionToHRGN(translucentRegion)); | ||
+ ::CombineRgn(regionToClear, regionToClear, translucent, RGN_OR); | ||
} | ||
+ ::FillRgn(hDC, regionToClear, black); | ||
} | ||
mNeedsNCAreaClear = false; | ||
|
27 changes: 27 additions & 0 deletions
27
...30.0a2bca2cbfc754632edf0ca64f1c5c0c1e77ce88/1791eb68d018001c7b22cc3f2af32a2191c589cf.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
diff --git a/gfx/2d/HelpersD2D.h b/gfx/2d/HelpersD2D.h | ||
index 1c24edeaf0cd..440202cec4ab 100644 | ||
--- a/gfx/2d/HelpersD2D.h | ||
+++ b/gfx/2d/HelpersD2D.h | ||
@@ -12,6 +12,7 @@ | ||
#include <vector> | ||
|
||
#include <dwrite.h> | ||
+#include <versionhelpers.h> | ||
#include <float.h> | ||
#include "2D.h" | ||
#include "Logging.h" | ||
@@ -282,10 +283,11 @@ static inline D2D1_BLEND_MODE D2DBlendMode(CompositionOp aOp) { | ||
static inline bool D2DSupportsPrimitiveBlendMode(CompositionOp aOp) { | ||
switch (aOp) { | ||
case CompositionOp::OP_OVER: | ||
- // case CompositionOp::OP_SOURCE: | ||
- // case CompositionOp::OP_DARKEN: | ||
- case CompositionOp::OP_ADD: | ||
+ // case CompositionOp::OP_SOURCE: | ||
return true; | ||
+ // case CompositionOp::OP_DARKEN: | ||
+ case CompositionOp::OP_ADD: | ||
+ return IsWindows8Point1OrGreater(); | ||
default: | ||
return false; | ||
} |
Oops, something went wrong.
f7295bc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#8 136.0.0.2340