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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 2876973003: Rename *Focus*-methods of FrameSelection to clarify its public API (Closed)
Patch Set: Created 3 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2009 Google Inc. All rights reserved. 8 * Copyright (C) 2009 Google Inc. All rights reserved.
9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after
1396 Style()->UserModify() == READ_ONLY); 1396 Style()->UserModify() == READ_ONLY);
1397 } 1397 }
1398 1398
1399 Color LayoutObject::SelectionBackgroundColor() const { 1399 Color LayoutObject::SelectionBackgroundColor() const {
1400 if (!IsSelectable()) 1400 if (!IsSelectable())
1401 return Color::kTransparent; 1401 return Color::kTransparent;
1402 1402
1403 if (RefPtr<ComputedStyle> pseudo_style = GetUncachedSelectionStyle()) 1403 if (RefPtr<ComputedStyle> pseudo_style = GetUncachedSelectionStyle())
1404 return ResolveColor(*pseudo_style, CSSPropertyBackgroundColor) 1404 return ResolveColor(*pseudo_style, CSSPropertyBackgroundColor)
1405 .BlendWithWhite(); 1405 .BlendWithWhite();
1406 return GetFrame()->Selection().IsFocusedAndActive() 1406 return GetFrame()->Selection().FrameIsFocusedAndActive()
1407 ? LayoutTheme::GetTheme().ActiveSelectionBackgroundColor() 1407 ? LayoutTheme::GetTheme().ActiveSelectionBackgroundColor()
1408 : LayoutTheme::GetTheme().InactiveSelectionBackgroundColor(); 1408 : LayoutTheme::GetTheme().InactiveSelectionBackgroundColor();
1409 } 1409 }
1410 1410
1411 Color LayoutObject::SelectionColor( 1411 Color LayoutObject::SelectionColor(
1412 int color_property, 1412 int color_property,
1413 const GlobalPaintFlags global_paint_flags) const { 1413 const GlobalPaintFlags global_paint_flags) const {
1414 // If the element is unselectable, or we are only painting the selection, 1414 // If the element is unselectable, or we are only painting the selection,
1415 // don't override the foreground color with the selection foreground color. 1415 // don't override the foreground color with the selection foreground color.
1416 if (!IsSelectable() || (global_paint_flags & kGlobalPaintSelectionOnly)) 1416 if (!IsSelectable() || (global_paint_flags & kGlobalPaintSelectionOnly))
1417 return ResolveColor(color_property); 1417 return ResolveColor(color_property);
1418 1418
1419 if (RefPtr<ComputedStyle> pseudo_style = GetUncachedSelectionStyle()) 1419 if (RefPtr<ComputedStyle> pseudo_style = GetUncachedSelectionStyle())
1420 return ResolveColor(*pseudo_style, color_property); 1420 return ResolveColor(*pseudo_style, color_property);
1421 if (!LayoutTheme::GetTheme().SupportsSelectionForegroundColors()) 1421 if (!LayoutTheme::GetTheme().SupportsSelectionForegroundColors())
1422 return ResolveColor(color_property); 1422 return ResolveColor(color_property);
1423 return GetFrame()->Selection().IsFocusedAndActive() 1423 return GetFrame()->Selection().FrameIsFocusedAndActive()
1424 ? LayoutTheme::GetTheme().ActiveSelectionForegroundColor() 1424 ? LayoutTheme::GetTheme().ActiveSelectionForegroundColor()
1425 : LayoutTheme::GetTheme().InactiveSelectionForegroundColor(); 1425 : LayoutTheme::GetTheme().InactiveSelectionForegroundColor();
1426 } 1426 }
1427 1427
1428 Color LayoutObject::SelectionForegroundColor( 1428 Color LayoutObject::SelectionForegroundColor(
1429 const GlobalPaintFlags global_paint_flags) const { 1429 const GlobalPaintFlags global_paint_flags) const {
1430 return SelectionColor(CSSPropertyWebkitTextFillColor, global_paint_flags); 1430 return SelectionColor(CSSPropertyWebkitTextFillColor, global_paint_flags);
1431 } 1431 }
1432 1432
1433 Color LayoutObject::SelectionEmphasisMarkColor( 1433 Color LayoutObject::SelectionEmphasisMarkColor(
(...skipping 2212 matching lines...) Expand 10 before | Expand all | Expand 10 after
3646 const blink::LayoutObject* root = object1; 3646 const blink::LayoutObject* root = object1;
3647 while (root->Parent()) 3647 while (root->Parent())
3648 root = root->Parent(); 3648 root = root->Parent();
3649 root->ShowLayoutTreeAndMark(object1, "*", object2, "-", 0); 3649 root->ShowLayoutTreeAndMark(object1, "*", object2, "-", 0);
3650 } else { 3650 } else {
3651 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3651 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3652 } 3652 }
3653 } 3653 }
3654 3654
3655 #endif 3655 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698