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

Side by Side Diff: sky/engine/core/rendering/RenderImage.h

Issue 715963003: Remove alt text from images. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: minor improvement Created 6 years, 1 month 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 | « sky/engine/core/html/HTMLImageElement.cpp ('k') | sky/engine/core/rendering/RenderImage.cpp » ('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) 2006 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 26 matching lines...) Expand all
37 virtual void destroy() override; 37 virtual void destroy() override;
38 38
39 static RenderImage* createAnonymous(Document*); 39 static RenderImage* createAnonymous(Document*);
40 40
41 void setImageResource(PassOwnPtr<RenderImageResource>); 41 void setImageResource(PassOwnPtr<RenderImageResource>);
42 42
43 RenderImageResource* imageResource() { return m_imageResource.get(); } 43 RenderImageResource* imageResource() { return m_imageResource.get(); }
44 const RenderImageResource* imageResource() const { return m_imageResource.ge t(); } 44 const RenderImageResource* imageResource() const { return m_imageResource.ge t(); }
45 ImageResource* cachedImage() const { return m_imageResource ? m_imageResourc e->cachedImage() : 0; } 45 ImageResource* cachedImage() const { return m_imageResource ? m_imageResourc e->cachedImage() : 0; }
46 46
47 bool setImageSizeForAltText(ImageResource* newImage = 0);
48
49 void updateAltText();
50
51 void highQualityRepaintTimerFired(Timer<RenderImage>*); 47 void highQualityRepaintTimerFired(Timer<RenderImage>*);
52 48
53 String altText() const { return m_altText; }
54
55 inline void setImageDevicePixelRatio(float factor) { m_imageDevicePixelRatio = factor; } 49 inline void setImageDevicePixelRatio(float factor) { m_imageDevicePixelRatio = factor; }
56 float imageDevicePixelRatio() const { return m_imageDevicePixelRatio; } 50 float imageDevicePixelRatio() const { return m_imageDevicePixelRatio; }
57 51
58 virtual void intrinsicSizeChanged() override 52 virtual void intrinsicSizeChanged() override
59 { 53 {
60 if (m_imageResource) 54 if (m_imageResource)
61 imageChanged(m_imageResource->imagePtr()); 55 imageChanged(m_imageResource->imagePtr());
62 } 56 }
63 57
64 protected: 58 protected:
(...skipping 17 matching lines...) Expand all
82 virtual bool foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect, unsigned maxDepthToTest) const override final; 76 virtual bool foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect, unsigned maxDepthToTest) const override final;
83 virtual bool computeBackgroundIsKnownToBeObscured() override final; 77 virtual bool computeBackgroundIsKnownToBeObscured() override final;
84 78
85 virtual LayoutUnit minimumReplacedHeight() const override; 79 virtual LayoutUnit minimumReplacedHeight() const override;
86 80
87 virtual void notifyFinished(Resource*) override final; 81 virtual void notifyFinished(Resource*) override final;
88 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) override final; 82 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) override final;
89 83
90 virtual bool boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance, InlineFlowBox*) const override final; 84 virtual bool boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance, InlineFlowBox*) const override final;
91 85
92 IntSize imageSizeForError(ImageResource*) const; 86 void paintInvalidationOrMarkForLayout(const IntRect* = 0);
93 void paintInvalidationOrMarkForLayout(bool imageSizeChanged, const IntRect* = 0);
94 void updateIntrinsicSizeIfNeeded(const LayoutSize&); 87 void updateIntrinsicSizeIfNeeded(const LayoutSize&);
95 // Update the size of the image to be rendered. Object-fit may cause this to be different from the CSS box's content rect. 88 // Update the size of the image to be rendered. Object-fit may cause this to be different from the CSS box's content rect.
96 void updateInnerContentRect(); 89 void updateInnerContentRect();
97 90
98 void paintAreaElementFocusRing(PaintInfo&); 91 void paintAreaElementFocusRing(PaintInfo&);
99 92
100 // Text to display as long as the image isn't available.
101 String m_altText;
102 OwnPtr<RenderImageResource> m_imageResource; 93 OwnPtr<RenderImageResource> m_imageResource;
103 float m_imageDevicePixelRatio; 94 float m_imageDevicePixelRatio;
104 95
105 friend class RenderImageScaleObserver; 96 friend class RenderImageScaleObserver;
106 }; 97 };
107 98
108 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderImage, isRenderImage()); 99 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderImage, isRenderImage());
109 100
110 } // namespace blink 101 } // namespace blink
111 102
112 #endif // RenderImage_h 103 #endif // RenderImage_h
OLDNEW
« no previous file with comments | « sky/engine/core/html/HTMLImageElement.cpp ('k') | sky/engine/core/rendering/RenderImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698