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

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

Issue 2614883007: Change computed style enums to be prefixed with 'k'. (Closed)
Patch Set: Rebase on ToT. Created 3 years, 11 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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 } else { 319 } else {
320 table = LayoutTable::createAnonymousWithParent(this); 320 table = LayoutTable::createAnonymousWithParent(this);
321 children->insertChildNode(this, table, beforeChild); 321 children->insertChildNode(this, table, beforeChild);
322 } 322 }
323 table->addChild(newChild); 323 table->addChild(newChild);
324 } else { 324 } else {
325 children->insertChildNode(this, newChild, beforeChild); 325 children->insertChildNode(this, newChild, beforeChild);
326 } 326 }
327 327
328 if (newChild->isText() && 328 if (newChild->isText() &&
329 newChild->style()->textTransform() == ETextTransform::Capitalize) 329 newChild->style()->textTransform() == ETextTransform::kCapitalize)
330 toLayoutText(newChild)->transformText(); 330 toLayoutText(newChild)->transformText();
331 331
332 // SVG creates layoutObjects for <g display="none">, as SVG requires children 332 // SVG creates layoutObjects for <g display="none">, as SVG requires children
333 // of hidden <g>s to have layoutObjects - at least that's how our 333 // of hidden <g>s to have layoutObjects - at least that's how our
334 // implementation works. 334 // implementation works.
335 // Consider: 335 // Consider:
336 // <g display="none"><foreignObject><body style="position: relative">FOO... 336 // <g display="none"><foreignObject><body style="position: relative">FOO...
337 // - layerTypeRequired() would return true for the <body>, creating a new 337 // - layerTypeRequired() would return true for the <body>, creating a new
338 // Layer 338 // Layer
339 // - when the document is painted, both layers are painted. The <body> layer 339 // - when the document is painted, both layers are painted. The <body> layer
(...skipping 2333 matching lines...) Expand 10 before | Expand all | Expand 10 after
2673 // don't have any children and don't have a layer attached to ourselves. 2673 // don't have any children and don't have a layer attached to ourselves.
2674 PaintLayer* layer = nullptr; 2674 PaintLayer* layer = nullptr;
2675 if (slowFirstChild() || hasLayer()) { 2675 if (slowFirstChild() || hasLayer()) {
2676 layer = parent()->enclosingLayer(); 2676 layer = parent()->enclosingLayer();
2677 addLayers(layer); 2677 addLayers(layer);
2678 } 2678 }
2679 2679
2680 // If |this| is visible but this object was not, tell the layer it has some 2680 // If |this| is visible but this object was not, tell the layer it has some
2681 // visible content that needs to be drawn and layer visibility optimization 2681 // visible content that needs to be drawn and layer visibility optimization
2682 // can't be used 2682 // can't be used
2683 if (parent()->style()->visibility() != EVisibility::Visible && 2683 if (parent()->style()->visibility() != EVisibility::kVisible &&
2684 style()->visibility() == EVisibility::Visible && !hasLayer()) { 2684 style()->visibility() == EVisibility::kVisible && !hasLayer()) {
2685 if (!layer) 2685 if (!layer)
2686 layer = parent()->enclosingLayer(); 2686 layer = parent()->enclosingLayer();
2687 if (layer) 2687 if (layer)
2688 layer->dirtyVisibleContentStatus(); 2688 layer->dirtyVisibleContentStatus();
2689 } 2689 }
2690 2690
2691 if (parent()->childrenInline()) 2691 if (parent()->childrenInline())
2692 parent()->dirtyLinesFromChangedChild(this); 2692 parent()->dirtyLinesFromChangedChild(this);
2693 2693
2694 if (LayoutFlowThread* flowThread = flowThreadContainingBlock()) 2694 if (LayoutFlowThread* flowThread = flowThreadContainingBlock())
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
2732 return found; 2732 return found;
2733 } 2733 }
2734 2734
2735 void LayoutObject::willBeRemovedFromTree() { 2735 void LayoutObject::willBeRemovedFromTree() {
2736 // FIXME: We should ASSERT(isRooted()) but we have some out-of-order removals 2736 // FIXME: We should ASSERT(isRooted()) but we have some out-of-order removals
2737 // which would need to be fixed first. 2737 // which would need to be fixed first.
2738 2738
2739 // If we remove a visible child from an invisible parent, we don't know the 2739 // If we remove a visible child from an invisible parent, we don't know the
2740 // layer visibility any more. 2740 // layer visibility any more.
2741 PaintLayer* layer = nullptr; 2741 PaintLayer* layer = nullptr;
2742 if (parent()->style()->visibility() != EVisibility::Visible && 2742 if (parent()->style()->visibility() != EVisibility::kVisible &&
2743 style()->visibility() == EVisibility::Visible && !hasLayer()) { 2743 style()->visibility() == EVisibility::kVisible && !hasLayer()) {
2744 layer = parent()->enclosingLayer(); 2744 layer = parent()->enclosingLayer();
2745 if (layer) 2745 if (layer)
2746 layer->dirtyVisibleContentStatus(); 2746 layer->dirtyVisibleContentStatus();
2747 } 2747 }
2748 2748
2749 // Keep our layer hierarchy updated. 2749 // Keep our layer hierarchy updated.
2750 if (slowFirstChild() || hasLayer()) { 2750 if (slowFirstChild() || hasLayer()) {
2751 if (!layer) 2751 if (!layer)
2752 layer = parent()->enclosingLayer(); 2752 layer = parent()->enclosingLayer();
2753 removeLayers(layer); 2753 removeLayers(layer);
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
3113 PseudoStyleRequest(PseudoIdSelection)); 3113 PseudoStyleRequest(PseudoIdSelection));
3114 } 3114 }
3115 } 3115 }
3116 } 3116 }
3117 3117
3118 return getUncachedPseudoStyle(PseudoStyleRequest(PseudoIdSelection)); 3118 return getUncachedPseudoStyle(PseudoStyleRequest(PseudoIdSelection));
3119 } 3119 }
3120 3120
3121 void LayoutObject::addAnnotatedRegions(Vector<AnnotatedRegionValue>& regions) { 3121 void LayoutObject::addAnnotatedRegions(Vector<AnnotatedRegionValue>& regions) {
3122 // Convert the style regions to absolute coordinates. 3122 // Convert the style regions to absolute coordinates.
3123 if (style()->visibility() != EVisibility::Visible || !isBox()) 3123 if (style()->visibility() != EVisibility::kVisible || !isBox())
3124 return; 3124 return;
3125 3125
3126 if (style()->getDraggableRegionMode() == DraggableRegionNone) 3126 if (style()->getDraggableRegionMode() == DraggableRegionNone)
3127 return; 3127 return;
3128 3128
3129 LayoutBox* box = toLayoutBox(this); 3129 LayoutBox* box = toLayoutBox(this);
3130 FloatRect localBounds(FloatPoint(), FloatSize(box->size())); 3130 FloatRect localBounds(FloatPoint(), FloatSize(box->size()));
3131 FloatRect absBounds = localToAbsoluteQuad(localBounds).boundingBox(); 3131 FloatRect absBounds = localToAbsoluteQuad(localBounds).boundingBox();
3132 3132
3133 AnnotatedRegionValue region; 3133 AnnotatedRegionValue region;
3134 region.draggable = style()->getDraggableRegionMode() == DraggableRegionDrag; 3134 region.draggable = style()->getDraggableRegionMode() == DraggableRegionDrag;
3135 region.bounds = LayoutRect(absBounds); 3135 region.bounds = LayoutRect(absBounds);
3136 regions.append(region); 3136 regions.append(region);
3137 } 3137 }
3138 3138
3139 bool LayoutObject::willRenderImage() { 3139 bool LayoutObject::willRenderImage() {
3140 // Without visibility we won't render (and therefore don't care about 3140 // Without visibility we won't render (and therefore don't care about
3141 // animation). 3141 // animation).
3142 if (style()->visibility() != EVisibility::Visible) 3142 if (style()->visibility() != EVisibility::kVisible)
3143 return false; 3143 return false;
3144 3144
3145 // We will not render a new image when SuspendableObjects is suspended 3145 // We will not render a new image when SuspendableObjects is suspended
3146 if (document().isContextSuspended()) 3146 if (document().isContextSuspended())
3147 return false; 3147 return false;
3148 3148
3149 // If we're not in a window (i.e., we're dormant from being in a background 3149 // If we're not in a window (i.e., we're dormant from being in a background
3150 // tab) then we don't want to render either. 3150 // tab) then we don't want to render either.
3151 return document().view()->isVisible(); 3151 return document().view()->isVisible();
3152 } 3152 }
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
3540 const blink::LayoutObject* root = object1; 3540 const blink::LayoutObject* root = object1;
3541 while (root->parent()) 3541 while (root->parent())
3542 root = root->parent(); 3542 root = root->parent();
3543 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3543 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3544 } else { 3544 } else {
3545 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3545 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3546 } 3546 }
3547 } 3547 }
3548 3548
3549 #endif 3549 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/layout/LayoutPart.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698