OLD | NEW |
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) 2001 Peter Kelly (pmk@post.com) | 4 * (C) 2001 Peter Kelly (pmk@post.com) |
5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
6 * (C) 2007 David Smith (catfish.man@gmail.com) | 6 * (C) 2007 David Smith (catfish.man@gmail.com) |
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. | 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. |
8 * All rights reserved. | 8 * All rights reserved. |
9 * (C) 2007 Eric Seidel (eric@webkit.org) | 9 * (C) 2007 Eric Seidel (eric@webkit.org) |
10 * | 10 * |
(...skipping 3239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3250 layout_parent_style = parent_layout_object->Style(); | 3250 layout_parent_style = parent_layout_object->Style(); |
3251 } | 3251 } |
3252 | 3252 |
3253 RefPtr<ComputedStyle> result = | 3253 RefPtr<ComputedStyle> result = |
3254 GetDocument().EnsureStyleResolver().PseudoStyleForElement( | 3254 GetDocument().EnsureStyleResolver().PseudoStyleForElement( |
3255 this, | 3255 this, |
3256 PseudoStyleRequest(pseudo_element_specifier, | 3256 PseudoStyleRequest(pseudo_element_specifier, |
3257 PseudoStyleRequest::kForComputedStyle), | 3257 PseudoStyleRequest::kForComputedStyle), |
3258 element_style, layout_parent_style); | 3258 element_style, layout_parent_style); |
3259 DCHECK(result); | 3259 DCHECK(result); |
3260 return element_style->AddCachedPseudoStyle(result.Release()); | 3260 return element_style->AddCachedPseudoStyle(std::move(result)); |
3261 } | 3261 } |
3262 | 3262 |
3263 const ComputedStyle* Element::NonLayoutObjectComputedStyle() const { | 3263 const ComputedStyle* Element::NonLayoutObjectComputedStyle() const { |
3264 if (GetLayoutObject() || !HasRareData()) | 3264 if (GetLayoutObject() || !HasRareData()) |
3265 return nullptr; | 3265 return nullptr; |
3266 | 3266 |
3267 return GetElementRareData()->GetComputedStyle(); | 3267 return GetElementRareData()->GetComputedStyle(); |
3268 } | 3268 } |
3269 | 3269 |
3270 bool Element::HasDisplayContentsStyle() const { | 3270 bool Element::HasDisplayContentsStyle() const { |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3432 if (!style || (request.pseudo_id < kFirstInternalPseudoId && | 3432 if (!style || (request.pseudo_id < kFirstInternalPseudoId && |
3433 !style->HasPseudoStyle(request.pseudo_id))) { | 3433 !style->HasPseudoStyle(request.pseudo_id))) { |
3434 return nullptr; | 3434 return nullptr; |
3435 } | 3435 } |
3436 | 3436 |
3437 if (ComputedStyle* cached = style->GetCachedPseudoStyle(request.pseudo_id)) | 3437 if (ComputedStyle* cached = style->GetCachedPseudoStyle(request.pseudo_id)) |
3438 return cached; | 3438 return cached; |
3439 | 3439 |
3440 RefPtr<ComputedStyle> result = GetUncachedPseudoStyle(request, parent_style); | 3440 RefPtr<ComputedStyle> result = GetUncachedPseudoStyle(request, parent_style); |
3441 if (result) | 3441 if (result) |
3442 return style->AddCachedPseudoStyle(result.Release()); | 3442 return style->AddCachedPseudoStyle(std::move(result)); |
3443 return nullptr; | 3443 return nullptr; |
3444 } | 3444 } |
3445 | 3445 |
3446 PassRefPtr<ComputedStyle> Element::GetUncachedPseudoStyle( | 3446 PassRefPtr<ComputedStyle> Element::GetUncachedPseudoStyle( |
3447 const PseudoStyleRequest& request, | 3447 const PseudoStyleRequest& request, |
3448 const ComputedStyle* parent_style) { | 3448 const ComputedStyle* parent_style) { |
3449 const ComputedStyle* style = GetComputedStyle(); | 3449 const ComputedStyle* style = GetComputedStyle(); |
3450 const bool is_before_or_after = request.pseudo_id == kPseudoIdBefore || | 3450 const bool is_before_or_after = request.pseudo_id == kPseudoIdBefore || |
3451 request.pseudo_id == kPseudoIdAfter; | 3451 request.pseudo_id == kPseudoIdAfter; |
3452 | 3452 |
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4348 } | 4348 } |
4349 | 4349 |
4350 DEFINE_TRACE_WRAPPERS(Element) { | 4350 DEFINE_TRACE_WRAPPERS(Element) { |
4351 if (HasRareData()) { | 4351 if (HasRareData()) { |
4352 visitor->TraceWrappers(GetElementRareData()); | 4352 visitor->TraceWrappers(GetElementRareData()); |
4353 } | 4353 } |
4354 ContainerNode::TraceWrappers(visitor); | 4354 ContainerNode::TraceWrappers(visitor); |
4355 } | 4355 } |
4356 | 4356 |
4357 } // namespace blink | 4357 } // namespace blink |
OLD | NEW |