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

Side by Side Diff: Source/core/rendering/RenderObject.cpp

Issue 404343002: Introduce DEFINE_CONTENT_DATA_TYPE_CASTS, and use it (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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/rendering/RenderBlock.cpp ('k') | Source/core/rendering/style/ContentData.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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // Minimal support for content properties replacing an entire element. 151 // Minimal support for content properties replacing an entire element.
152 // Works only if we have exactly one piece of content and it's a URL. 152 // Works only if we have exactly one piece of content and it's a URL.
153 // Otherwise acts as if we didn't support this feature. 153 // Otherwise acts as if we didn't support this feature.
154 const ContentData* contentData = style->contentData(); 154 const ContentData* contentData = style->contentData();
155 if (contentData && !contentData->next() && contentData->isImage() && !elemen t->isPseudoElement()) { 155 if (contentData && !contentData->next() && contentData->isImage() && !elemen t->isPseudoElement()) {
156 RenderImage* image = new RenderImage(element); 156 RenderImage* image = new RenderImage(element);
157 // RenderImageResourceStyleImage requires a style being present on the i mage but we don't want to 157 // RenderImageResourceStyleImage requires a style being present on the i mage but we don't want to
158 // trigger a style change now as the node is not fully attached. Moving this code to style change 158 // trigger a style change now as the node is not fully attached. Moving this code to style change
159 // doesn't make sense as it should be run once at renderer creation. 159 // doesn't make sense as it should be run once at renderer creation.
160 image->setStyleInternal(style); 160 image->setStyleInternal(style);
161 if (const StyleImage* styleImage = static_cast<const ImageContentData*>( contentData)->image()) { 161 if (const StyleImage* styleImage = toImageContentData(contentData)->imag e()) {
162 image->setImageResource(RenderImageResourceStyleImage::create(const_ cast<StyleImage*>(styleImage))); 162 image->setImageResource(RenderImageResourceStyleImage::create(const_ cast<StyleImage*>(styleImage)));
163 image->setIsGeneratedContent(); 163 image->setIsGeneratedContent();
164 } else 164 } else
165 image->setImageResource(RenderImageResource::create()); 165 image->setImageResource(RenderImageResource::create());
166 image->setStyleInternal(nullptr); 166 image->setStyleInternal(nullptr);
167 return image; 167 return image;
168 } 168 }
169 169
170 switch (style->display()) { 170 switch (style->display()) {
171 case NONE: 171 case NONE:
(...skipping 3273 matching lines...) Expand 10 before | Expand all | Expand 10 after
3445 { 3445 {
3446 if (object1) { 3446 if (object1) {
3447 const blink::RenderObject* root = object1; 3447 const blink::RenderObject* root = object1;
3448 while (root->parent()) 3448 while (root->parent())
3449 root = root->parent(); 3449 root = root->parent();
3450 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3450 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3451 } 3451 }
3452 } 3452 }
3453 3453
3454 #endif 3454 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBlock.cpp ('k') | Source/core/rendering/style/ContentData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698