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

Side by Side Diff: Source/core/layout/LayoutThemeChromiumMac.mm

Issue 895383002: Let StyleResolver figure out differences between UA style and resolved style. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: I mean *remove* assert. Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « Source/core/layout/LayoutThemeChromiumMac.h ('k') | Source/core/layout/style/AuthorStyleInfo.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Google, Inc. 3 * Copyright (C) 2008, 2009 Google, Inc.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 18 matching lines...) Expand all
29 #import "core/fileapi/FileList.h" 29 #import "core/fileapi/FileList.h"
30 #import "core/frame/FrameView.h" 30 #import "core/frame/FrameView.h"
31 #import "core/html/HTMLInputElement.h" 31 #import "core/html/HTMLInputElement.h"
32 #import "core/html/HTMLMediaElement.h" 32 #import "core/html/HTMLMediaElement.h"
33 #import "core/html/HTMLMeterElement.h" 33 #import "core/html/HTMLMeterElement.h"
34 #import "core/html/TimeRanges.h" 34 #import "core/html/TimeRanges.h"
35 #import "core/html/shadow/MediaControlElements.h" 35 #import "core/html/shadow/MediaControlElements.h"
36 #import "core/layout/Layer.h" 36 #import "core/layout/Layer.h"
37 #import "core/layout/LayoutSlider.h" 37 #import "core/layout/LayoutSlider.h"
38 #import "core/layout/PaintInfo.h" 38 #import "core/layout/PaintInfo.h"
39 #import "core/layout/style/AuthorStyleInfo.h"
39 #import "core/layout/style/ShadowList.h" 40 #import "core/layout/style/ShadowList.h"
40 #import "core/rendering/RenderMedia.h" 41 #import "core/rendering/RenderMedia.h"
41 #import "core/rendering/RenderMediaControls.h" 42 #import "core/rendering/RenderMediaControls.h"
42 #import "core/rendering/RenderMeter.h" 43 #import "core/rendering/RenderMeter.h"
43 #import "core/rendering/RenderProgress.h" 44 #import "core/rendering/RenderProgress.h"
44 #import "core/rendering/RenderView.h" 45 #import "core/rendering/RenderView.h"
45 #import "platform/LayoutTestSupport.h" 46 #import "platform/LayoutTestSupport.h"
46 #import "platform/PlatformResourceLoader.h" 47 #import "platform/PlatformResourceLoader.h"
47 #import "platform/SharedBuffer.h" 48 #import "platform/SharedBuffer.h"
48 #import "platform/geometry/FloatRoundedRect.h" 49 #import "platform/geometry/FloatRoundedRect.h"
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 } 463 }
463 464
464 if (needsFallback) 465 if (needsFallback)
465 color = LayoutTheme::systemColor(cssValueId); 466 color = LayoutTheme::systemColor(cssValueId);
466 467
467 m_systemColorCache.set(cssValueId, color.rgb()); 468 m_systemColorCache.set(cssValueId, color.rgb());
468 469
469 return color; 470 return color;
470 } 471 }
471 472
472 bool LayoutThemeChromiumMac::isControlStyled(const LayoutStyle& style, const Cac hedUAStyle* uaStyle) const 473 bool LayoutThemeChromiumMac::isControlStyled(const LayoutStyle& style, const Aut horStyleInfo& authorStyle) const
473 { 474 {
474 ASSERT(uaStyle);
475 if (style.appearance() == TextFieldPart || style.appearance() == TextAreaPar t) 475 if (style.appearance() == TextFieldPart || style.appearance() == TextAreaPar t)
476 return style.border() != uaStyle->border || style.boxShadow(); 476 return authorStyle.specifiesBorder() || style.boxShadow();
477 477
478 // FIXME: This is horrible, but there is not much else that can be done. 478 // FIXME: This is horrible, but there is not much else that can be done.
479 // Menu lists cannot draw properly when scaled. They can't really draw 479 // Menu lists cannot draw properly when scaled. They can't really draw
480 // properly when transformed either. We can't detect the transform case at 480 // properly when transformed either. We can't detect the transform case at
481 // style adjustment time so that will just have to stay broken. We can 481 // style adjustment time so that will just have to stay broken. We can
482 // however detect that we're zooming. If zooming is in effect we treat it 482 // however detect that we're zooming. If zooming is in effect we treat it
483 // like the control is styled. 483 // like the control is styled.
484 if (style.appearance() == MenulistPart && style.effectiveZoom() != 1.0f) 484 if (style.appearance() == MenulistPart && style.effectiveZoom() != 1.0f)
485 return true; 485 return true;
486 // FIXME: NSSearchFieldCell doesn't work well when scaled. 486 // FIXME: NSSearchFieldCell doesn't work well when scaled.
487 if (style.appearance() == SearchFieldPart && style.effectiveZoom() != 1) 487 if (style.appearance() == SearchFieldPart && style.effectiveZoom() != 1)
488 return true; 488 return true;
489 489
490 return LayoutTheme::isControlStyled(style, uaStyle); 490 return LayoutTheme::isControlStyled(style, authorStyle);
491 } 491 }
492 492
493 const int sliderThumbShadowBlur = 1; 493 const int sliderThumbShadowBlur = 1;
494 494
495 void LayoutThemeChromiumMac::adjustPaintInvalidationRect(const LayoutObject* o, IntRect& r) 495 void LayoutThemeChromiumMac::adjustPaintInvalidationRect(const LayoutObject* o, IntRect& r)
496 { 496 {
497 ControlPart part = o->style()->appearance(); 497 ControlPart part = o->style()->appearance();
498 498
499 #if USE(NEW_THEME) 499 #if USE(NEW_THEME)
500 switch (part) { 500 switch (part) {
(...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after
1844 1844
1845 bool LayoutThemeChromiumMac::shouldUseFallbackTheme(const LayoutStyle& style) co nst 1845 bool LayoutThemeChromiumMac::shouldUseFallbackTheme(const LayoutStyle& style) co nst
1846 { 1846 {
1847 ControlPart part = style.appearance(); 1847 ControlPart part = style.appearance();
1848 if (part == CheckboxPart || part == RadioPart) 1848 if (part == CheckboxPart || part == RadioPart)
1849 return style.effectiveZoom() != 1; 1849 return style.effectiveZoom() != 1;
1850 return false; 1850 return false;
1851 } 1851 }
1852 1852
1853 } // namespace blink 1853 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutThemeChromiumMac.h ('k') | Source/core/layout/style/AuthorStyleInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698