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

Unified Diff: Source/core/layout/LayoutTheme.cpp

Issue 1266723004: Revert of Delete AuthorStyleInfo and move its data into ComputedStyle.RareNonInheritedData. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/layout/LayoutTheme.h ('k') | Source/core/layout/LayoutThemeMac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutTheme.cpp
diff --git a/Source/core/layout/LayoutTheme.cpp b/Source/core/layout/LayoutTheme.cpp
index a652646e1c67866af971b466596dd1f5bb537e06..48c070c059dbd403cf10de807f5a3a06c815acec 100644
--- a/Source/core/layout/LayoutTheme.cpp
+++ b/Source/core/layout/LayoutTheme.cpp
@@ -45,6 +45,7 @@
#include "core/html/shadow/TextControlInnerElements.h"
#include "core/page/FocusController.h"
#include "core/page/Page.h"
+#include "core/style/AuthorStyleInfo.h"
#include "core/style/ComputedStyle.h"
#include "platform/FileMetadata.h"
#include "platform/FloatConversion.h"
@@ -75,7 +76,7 @@
{
}
-void LayoutTheme::adjustStyle(ComputedStyle& style, Element* e)
+void LayoutTheme::adjustStyle(ComputedStyle& style, Element* e, const AuthorStyleInfo& authorStyle)
{
ASSERT(style.hasAppearance());
@@ -89,15 +90,17 @@
else if (style.display() == LIST_ITEM || style.display() == TABLE)
style.setDisplay(BLOCK);
- if (isControlStyled(style)) {
+ if (isControlStyled(style, authorStyle)) {
if (part == MenulistPart) {
style.setAppearance(MenulistButtonPart);
part = MenulistButtonPart;
} else {
style.setAppearance(NoControlPart);
- return;
}
}
+
+ if (!style.hasAppearance())
+ return;
if (shouldUseFallbackTheme(style)) {
adjustStyleUsingFallbackTheme(style);
@@ -365,7 +368,7 @@
return appearance != CheckboxPart && appearance != RadioPart;
}
-bool LayoutTheme::isControlStyled(const ComputedStyle& style) const
+bool LayoutTheme::isControlStyled(const ComputedStyle& style, const AuthorStyleInfo& authorStyle) const
{
switch (style.appearance()) {
case PushButtonPart:
@@ -377,13 +380,13 @@
case ContinuousCapacityLevelIndicatorPart:
case DiscreteCapacityLevelIndicatorPart:
case RatingLevelIndicatorPart:
- return style.hasAuthorBackground() || style.hasAuthorBorder();
+ return authorStyle.specifiesBackground() || authorStyle.specifiesBorder();
case MenulistPart:
case SearchFieldPart:
case TextAreaPart:
case TextFieldPart:
- return style.hasAuthorBackground() || style.hasAuthorBorder() || style.boxShadow();
+ return authorStyle.specifiesBackground() || authorStyle.specifiesBorder() || style.boxShadow();
case SliderHorizontalPart:
case SliderVerticalPart:
« no previous file with comments | « Source/core/layout/LayoutTheme.h ('k') | Source/core/layout/LayoutThemeMac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698