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

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

Issue 975933002: Return reference from styleEngine() accessor. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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/LayoutInline.cpp ('k') | Source/core/layout/LayoutObjectInlines.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) 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. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 2628 matching lines...) Expand 10 before | Expand all | Expand 10 after
2639 return rendererForFirstLineStyle->getCachedPseudoStyle(FIRST_LIN E_INHERITED, parentStyle); 2639 return rendererForFirstLineStyle->getCachedPseudoStyle(FIRST_LIN E_INHERITED, parentStyle);
2640 } 2640 }
2641 return rendererForFirstLineStyle->getUncachedPseudoStyle(PseudoStyle Request(FIRST_LINE_INHERITED), parentStyle, style); 2641 return rendererForFirstLineStyle->getUncachedPseudoStyle(PseudoStyle Request(FIRST_LINE_INHERITED), parentStyle, style);
2642 } 2642 }
2643 } 2643 }
2644 return nullptr; 2644 return nullptr;
2645 } 2645 }
2646 2646
2647 PassRefPtr<LayoutStyle> LayoutObject::uncachedFirstLineStyle(LayoutStyle* style) const 2647 PassRefPtr<LayoutStyle> LayoutObject::uncachedFirstLineStyle(LayoutStyle* style) const
2648 { 2648 {
2649 if (!document().styleEngine()->usesFirstLineRules()) 2649 if (!document().styleEngine().usesFirstLineRules())
2650 return nullptr; 2650 return nullptr;
2651 2651
2652 ASSERT(!isText()); 2652 ASSERT(!isText());
2653 2653
2654 return firstLineStyleForCachedUncachedType(Uncached, this, style); 2654 return firstLineStyleForCachedUncachedType(Uncached, this, style);
2655 } 2655 }
2656 2656
2657 LayoutStyle* LayoutObject::cachedFirstLineStyle() const 2657 LayoutStyle* LayoutObject::cachedFirstLineStyle() const
2658 { 2658 {
2659 ASSERT(document().styleEngine()->usesFirstLineRules()); 2659 ASSERT(document().styleEngine().usesFirstLineRules());
2660 2660
2661 if (RefPtr<LayoutStyle> style = firstLineStyleForCachedUncachedType(Cached, isText() ? parent() : this, m_style.get())) 2661 if (RefPtr<LayoutStyle> style = firstLineStyleForCachedUncachedType(Cached, isText() ? parent() : this, m_style.get()))
2662 return style.get(); 2662 return style.get();
2663 2663
2664 return m_style.get(); 2664 return m_style.get();
2665 } 2665 }
2666 2666
2667 LayoutStyle* LayoutObject::getCachedPseudoStyle(PseudoId pseudo, LayoutStyle* pa rentStyle) const 2667 LayoutStyle* LayoutObject::getCachedPseudoStyle(PseudoId pseudo, LayoutStyle* pa rentStyle) const
2668 { 2668 {
2669 if (pseudo < FIRST_INTERNAL_PSEUDOID && !style()->hasPseudoStyle(pseudo)) 2669 if (pseudo < FIRST_INTERNAL_PSEUDOID && !style()->hasPseudoStyle(pseudo))
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
3193 { 3193 {
3194 if (object1) { 3194 if (object1) {
3195 const blink::LayoutObject* root = object1; 3195 const blink::LayoutObject* root = object1;
3196 while (root->parent()) 3196 while (root->parent())
3197 root = root->parent(); 3197 root = root->parent();
3198 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3198 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3199 } 3199 }
3200 } 3200 }
3201 3201
3202 #endif 3202 #endif
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutInline.cpp ('k') | Source/core/layout/LayoutObjectInlines.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698