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

Side by Side Diff: Source/modules/accessibility/AXRenderObject.cpp

Issue 923953002: Move rendering/RenderImage* to layout/LayoutImage* (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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/svg/SVGImageElement.cpp ('k') | no next file » | 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) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "core/frame/LocalFrame.h" 42 #include "core/frame/LocalFrame.h"
43 #include "core/frame/Settings.h" 43 #include "core/frame/Settings.h"
44 #include "core/html/HTMLImageElement.h" 44 #include "core/html/HTMLImageElement.h"
45 #include "core/html/HTMLLabelElement.h" 45 #include "core/html/HTMLLabelElement.h"
46 #include "core/html/HTMLOptionElement.h" 46 #include "core/html/HTMLOptionElement.h"
47 #include "core/html/HTMLSelectElement.h" 47 #include "core/html/HTMLSelectElement.h"
48 #include "core/html/HTMLTextAreaElement.h" 48 #include "core/html/HTMLTextAreaElement.h"
49 #include "core/html/shadow/ShadowElementNames.h" 49 #include "core/html/shadow/ShadowElementNames.h"
50 #include "core/layout/HitTestResult.h" 50 #include "core/layout/HitTestResult.h"
51 #include "core/layout/Layer.h" 51 #include "core/layout/Layer.h"
52 #include "core/layout/LayoutImage.h"
52 #include "core/loader/ProgressTracker.h" 53 #include "core/loader/ProgressTracker.h"
53 #include "core/page/Page.h" 54 #include "core/page/Page.h"
54 #include "core/rendering/RenderFieldset.h" 55 #include "core/rendering/RenderFieldset.h"
55 #include "core/rendering/RenderFileUploadControl.h" 56 #include "core/rendering/RenderFileUploadControl.h"
56 #include "core/rendering/RenderHTMLCanvas.h" 57 #include "core/rendering/RenderHTMLCanvas.h"
57 #include "core/rendering/RenderImage.h"
58 #include "core/rendering/RenderInline.h" 58 #include "core/rendering/RenderInline.h"
59 #include "core/rendering/RenderListMarker.h" 59 #include "core/rendering/RenderListMarker.h"
60 #include "core/rendering/RenderMenuList.h" 60 #include "core/rendering/RenderMenuList.h"
61 #include "core/rendering/RenderPart.h" 61 #include "core/rendering/RenderPart.h"
62 #include "core/rendering/RenderTextControlSingleLine.h" 62 #include "core/rendering/RenderTextControlSingleLine.h"
63 #include "core/rendering/RenderTextFragment.h" 63 #include "core/rendering/RenderTextFragment.h"
64 #include "core/rendering/RenderView.h" 64 #include "core/rendering/RenderView.h"
65 #include "core/svg/SVGDocumentExtensions.h" 65 #include "core/svg/SVGDocumentExtensions.h"
66 #include "core/svg/SVGSVGElement.h" 66 #include "core/svg/SVGSVGElement.h"
67 #include "core/svg/graphics/SVGImage.h" 67 #include "core/svg/graphics/SVGImage.h"
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 // don't ignore an image that has an alt tag 695 // don't ignore an image that has an alt tag
696 if (!alt.string().containsOnlyWhitespace()) 696 if (!alt.string().containsOnlyWhitespace())
697 return false; 697 return false;
698 // informal standard is to ignore images with zero-length alt string s 698 // informal standard is to ignore images with zero-length alt string s
699 if (!alt.isNull()) 699 if (!alt.isNull())
700 return true; 700 return true;
701 } 701 }
702 702
703 if (isNativeImage() && m_renderer->isImage()) { 703 if (isNativeImage() && m_renderer->isImage()) {
704 // check for one-dimensional image 704 // check for one-dimensional image
705 RenderImage* image = toRenderImage(m_renderer); 705 LayoutImage* image = toLayoutImage(m_renderer);
706 if (image->size().height() <= 1 || image->size().width() <= 1) 706 if (image->size().height() <= 1 || image->size().width() <= 1)
707 return true; 707 return true;
708 708
709 // check whether rendered image was stretched from one-dimensional f ile image 709 // check whether rendered image was stretched from one-dimensional f ile image
710 if (image->cachedImage()) { 710 if (image->cachedImage()) {
711 LayoutSize imageSize = image->cachedImage()->imageSizeForRendere r(m_renderer, image->view()->zoomFactor()); 711 LayoutSize imageSize = image->cachedImage()->imageSizeForRendere r(m_renderer, image->view()->zoomFactor());
712 return imageSize.height() <= 1 || imageSize.width() <= 1; 712 return imageSize.height() <= 1 || imageSize.width() <= 1;
713 } 713 }
714 } 714 }
715 return false; 715 return false;
(...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after
2217 2217
2218 AXSpinButton* axSpinButton = toAXSpinButton(axObjectCache()->getOrCreate(Spi nButtonRole)); 2218 AXSpinButton* axSpinButton = toAXSpinButton(axObjectCache()->getOrCreate(Spi nButtonRole));
2219 axSpinButton->setSpinButtonElement(toSpinButtonElement(spinButtonElement)); 2219 axSpinButton->setSpinButtonElement(toSpinButtonElement(spinButtonElement));
2220 axSpinButton->setParent(this); 2220 axSpinButton->setParent(this);
2221 m_children.append(axSpinButton); 2221 m_children.append(axSpinButton);
2222 } 2222 }
2223 2223
2224 void AXRenderObject::addImageMapChildren() 2224 void AXRenderObject::addImageMapChildren()
2225 { 2225 {
2226 RenderBoxModelObject* cssBox = renderBoxModelObject(); 2226 RenderBoxModelObject* cssBox = renderBoxModelObject();
2227 if (!cssBox || !cssBox->isRenderImage()) 2227 if (!cssBox || !cssBox->isLayoutImage())
2228 return; 2228 return;
2229 2229
2230 HTMLMapElement* map = toRenderImage(cssBox)->imageMap(); 2230 HTMLMapElement* map = toLayoutImage(cssBox)->imageMap();
2231 if (!map) 2231 if (!map)
2232 return; 2232 return;
2233 2233
2234 for (HTMLAreaElement& area : Traversal<HTMLAreaElement>::descendantsOf(*map) ) { 2234 for (HTMLAreaElement& area : Traversal<HTMLAreaElement>::descendantsOf(*map) ) {
2235 // add an <area> element for this child if it has a link 2235 // add an <area> element for this child if it has a link
2236 if (area.isLink()) { 2236 if (area.isLink()) {
2237 AXImageMapLink* areaObject = toAXImageMapLink(axObjectCache()->getOr Create(ImageMapLinkRole)); 2237 AXImageMapLink* areaObject = toAXImageMapLink(axObjectCache()->getOr Create(ImageMapLinkRole));
2238 areaObject->setHTMLAreaElement(&area); 2238 areaObject->setHTMLAreaElement(&area);
2239 areaObject->setHTMLMapElement(map); 2239 areaObject->setHTMLMapElement(map);
2240 areaObject->setParent(this); 2240 areaObject->setParent(this);
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
2411 if (label && label->renderer()) { 2411 if (label && label->renderer()) {
2412 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect(); 2412 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect();
2413 result.unite(labelRect); 2413 result.unite(labelRect);
2414 } 2414 }
2415 } 2415 }
2416 2416
2417 return result; 2417 return result;
2418 } 2418 }
2419 2419
2420 } // namespace blink 2420 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/svg/SVGImageElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698