| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
| 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. |
| 6 * All rights reserved. | 6 * All rights reserved. |
| 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
| 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
| 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 10 * (http://www.torchmobile.com/) | 10 * (http://www.torchmobile.com/) |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 #include "platform/instrumentation/tracing/TraceEvent.h" | 54 #include "platform/instrumentation/tracing/TraceEvent.h" |
| 55 #include "wtf/HashSet.h" | 55 #include "wtf/HashSet.h" |
| 56 #include "wtf/text/AtomicString.h" | 56 #include "wtf/text/AtomicString.h" |
| 57 | 57 |
| 58 namespace blink { | 58 namespace blink { |
| 59 | 59 |
| 60 using namespace HTMLNames; | 60 using namespace HTMLNames; |
| 61 | 61 |
| 62 inline ComputedStyle* getElementStyle(Element& element) { | 62 inline ComputedStyle* getElementStyle(Element& element) { |
| 63 if (element.needsReattachLayoutTree()) { | 63 if (element.needsReattachLayoutTree()) { |
| 64 StyleReattachData styleReattachData = | 64 if (ComputedStyle* computedStyle = |
| 65 element.document().getStyleReattachData(element); | 65 element.document().getNonAttachedStyle(element)) |
| 66 if (styleReattachData.computedStyle) | 66 return computedStyle; |
| 67 return styleReattachData.computedStyle.get(); | |
| 68 } | 67 } |
| 69 return element.mutableComputedStyle(); | 68 return element.mutableComputedStyle(); |
| 70 } | 69 } |
| 71 | 70 |
| 72 bool SharedStyleFinder::canShareStyleWithControl(Element& candidate) const { | 71 bool SharedStyleFinder::canShareStyleWithControl(Element& candidate) const { |
| 73 if (!isHTMLInputElement(candidate) || !isHTMLInputElement(element())) | 72 if (!isHTMLInputElement(candidate) || !isHTMLInputElement(element())) |
| 74 return false; | 73 return false; |
| 75 | 74 |
| 76 HTMLInputElement& candidateInput = toHTMLInputElement(candidate); | 75 HTMLInputElement& candidateInput = toHTMLInputElement(candidate); |
| 77 HTMLInputElement& thisInput = toHTMLInputElement(element()); | 76 HTMLInputElement& thisInput = toHTMLInputElement(element()); |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 if (!element().parentElementOrShadowRoot()->childrenSupportStyleSharing()) { | 413 if (!element().parentElementOrShadowRoot()->childrenSupportStyleSharing()) { |
| 415 INCREMENT_STYLE_STATS_COUNTER(document().styleEngine(), | 414 INCREMENT_STYLE_STATS_COUNTER(document().styleEngine(), |
| 416 sharedStyleRejectedByParent, 1); | 415 sharedStyleRejectedByParent, 1); |
| 417 return nullptr; | 416 return nullptr; |
| 418 } | 417 } |
| 419 | 418 |
| 420 return getElementStyle(*shareElement); | 419 return getElementStyle(*shareElement); |
| 421 } | 420 } |
| 422 | 421 |
| 423 } // namespace blink | 422 } // namespace blink |
| OLD | NEW |