OLD | NEW |
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 Loading... |
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/LayoutHTMLCanvas.h" |
52 #include "core/layout/LayoutImage.h" | 53 #include "core/layout/LayoutImage.h" |
53 #include "core/layout/LayoutTextControlSingleLine.h" | 54 #include "core/layout/LayoutTextControlSingleLine.h" |
54 #include "core/loader/ProgressTracker.h" | 55 #include "core/loader/ProgressTracker.h" |
55 #include "core/page/Page.h" | 56 #include "core/page/Page.h" |
56 #include "core/rendering/RenderFieldset.h" | 57 #include "core/rendering/RenderFieldset.h" |
57 #include "core/rendering/RenderFileUploadControl.h" | 58 #include "core/rendering/RenderFileUploadControl.h" |
58 #include "core/rendering/RenderHTMLCanvas.h" | |
59 #include "core/rendering/RenderInline.h" | 59 #include "core/rendering/RenderInline.h" |
60 #include "core/rendering/RenderListMarker.h" | 60 #include "core/rendering/RenderListMarker.h" |
61 #include "core/rendering/RenderMenuList.h" | 61 #include "core/rendering/RenderMenuList.h" |
62 #include "core/rendering/RenderPart.h" | 62 #include "core/rendering/RenderPart.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" |
68 #include "modules/accessibility/AXImageMapLink.h" | 68 #include "modules/accessibility/AXImageMapLink.h" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 return StaticTextRole; | 288 return StaticTextRole; |
289 if (cssBox && isImageOrAltText(cssBox, node)) { | 289 if (cssBox && isImageOrAltText(cssBox, node)) { |
290 if (node && node->isLink()) | 290 if (node && node->isLink()) |
291 return ImageMapRole; | 291 return ImageMapRole; |
292 if (isHTMLInputElement(node)) | 292 if (isHTMLInputElement(node)) |
293 return ariaHasPopup() ? PopUpButtonRole : ButtonRole; | 293 return ariaHasPopup() ? PopUpButtonRole : ButtonRole; |
294 if (isSVGImage()) | 294 if (isSVGImage()) |
295 return SVGRootRole; | 295 return SVGRootRole; |
296 return ImageRole; | 296 return ImageRole; |
297 } | 297 } |
298 // Note: if JavaScript is disabled, the renderer won't be a RenderHTMLCanvas
. | 298 // Note: if JavaScript is disabled, the renderer won't be a LayoutHTMLCanvas
. |
299 if (isHTMLCanvasElement(node) && m_renderer->isCanvas()) | 299 if (isHTMLCanvasElement(node) && m_renderer->isCanvas()) |
300 return CanvasRole; | 300 return CanvasRole; |
301 | 301 |
302 if (cssBox && cssBox->isRenderView()) | 302 if (cssBox && cssBox->isRenderView()) |
303 return WebAreaRole; | 303 return WebAreaRole; |
304 | 304 |
305 if (m_renderer->isSVGImage()) | 305 if (m_renderer->isSVGImage()) |
306 return ImageRole; | 306 return ImageRole; |
307 if (m_renderer->isSVGRoot()) | 307 if (m_renderer->isSVGRoot()) |
308 return SVGRootRole; | 308 return SVGRootRole; |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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; |
716 } | 716 } |
717 | 717 |
718 if (isCanvas()) { | 718 if (isCanvas()) { |
719 if (canvasHasFallbackContent()) | 719 if (canvasHasFallbackContent()) |
720 return false; | 720 return false; |
721 RenderHTMLCanvas* canvas = toRenderHTMLCanvas(m_renderer); | 721 LayoutHTMLCanvas* canvas = toLayoutHTMLCanvas(m_renderer); |
722 if (canvas->size().height() <= 1 || canvas->size().width() <= 1) | 722 if (canvas->size().height() <= 1 || canvas->size().width() <= 1) |
723 return true; | 723 return true; |
724 // Otherwise fall through; use presence of help text, title, or descript
ion to decide. | 724 // Otherwise fall through; use presence of help text, title, or descript
ion to decide. |
725 } | 725 } |
726 | 726 |
727 if (isWebArea() || m_renderer->isListMarker()) | 727 if (isWebArea() || m_renderer->isListMarker()) |
728 return false; | 728 return false; |
729 | 729 |
730 // Using the help text, title or accessibility description (so we | 730 // Using the help text, title or accessibility description (so we |
731 // check if there's some kind of accessible name for the element) | 731 // check if there's some kind of accessible name for the element) |
(...skipping 1679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |