summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/Color.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge WebKit at r75315: Initial merge by git.Steve Block2011-05-121-189/+0
| | | | Change-Id: I570314b346ce101c935ed22a626b48c2af266b84
* Fix bug 3299946 - Holo-fy focus and selection color scheme.Adam Powell2011-01-261-5/+5
| | | | | | | | * Honeycomb-themed selection ring * Match text selection color scheme to framework assets Change-Id: I8a4817c7998d7009f1b00d6ad548d54545de0c78
* Merge WebKit at r70209: Initial merge by GitBen Murdoch2010-10-261-2/+3
| | | | Change-Id: Id23a68efa36e9d1126bcce0b137872db00892c8e
* Add CSS cursor ring definitionsCary Clark2010-08-181-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows web pages to have fine-grain control over the appearance of the rings drawn around nodes. Generated links (email, addresses, phone numbers) are no longer given unique colors. To preserve this feature, a separate change could add an HTML extension similar to vlink to provide the cursor ring defintions for theses links. The mechanism implemented below isn't appropriate since these links don't necessarily correspond to single DOM nodes or other DOM elements. ------------ CSS examples ------------ The CSS to specify the ring looks like: -webkit-ring-fill-color:rgba(0,0,255,0.4); -webkit-ring-inner-width:2 px; -webkit-ring-outer-width:3.5 px; -webkit-ring-outset: 8 px; -webkit-ring-pressed-inner-color:rgba(0,0,255,0.8); -webkit-ring-pressed-outer-color:rgba(0,0,127,0.3); -webkit-ring-radius: 10 px; -webkit-ring-selected-inner-color:rgba(63,63,255,0.8); -webkit-ring-selected-outer-color:rgba(63,63,127,0.3); and may be alternately defined with a property shortcut: -webkit-ring:rgba(255,0,0,0.4) 5px 7px rgba(255,0,0,0.8) rgba(127,0,0,0.3) 20px rgba(255,63,63,0.8) rgba(127,63,63,0.3); -------------------- Property definitions -------------------- A vertical cross-section of the ring corresponds to these parameters as shown: ______ R / ___O_ R = corner radius / / __I_ o I = inner ring / / / _O_ ^ O = outer ring | | | / F | F = fill |O|I|O| L o = outset | | | \_F_ | L = original link \ \ \__O_ V \ \___I_ o R \____O_ The fill color specifies what to draw inside the ring when the link is followed. The fill area consists of the original link area plus the outset. The inner and outer widths specify the stoke width of the inner and outer rings, respectively. The widths may be specified in fractional pixels. The implementation captures 4 bits of the fraction. The outset specifies the distance from the edge of the original link to the rings' center. Both rings are drawn at the same center location. The radius specifies the curvature of the corners at the center of the rings. ------------- Data lifetime ------------- The selected colors specify the colors of the inner and outer rings when the trackball or D-pad hovers over the link. The pressed colors specify the colors of the rings when the trackball center is pressed or the link is tapped. The CSS data is recorded in the RenderStyle when the DOM is parsed. The widths are scaled up by 16 to preserve the fraction. When the nav cache is built, the CSS style information is recorded in the CachedColor class. Only unique style sets are recorded; many CachedNode instances can share the same CachedColor instance. When the cursor ring is drawn, the CachedColor is retrieved by getting the index from the CachedNode, and looking up the entry in the CachedFrame. The widths are scaled down by 16 since Lengths are stored by the webkit as integers. ---------- File Edits ---------- WebCore/Android.derived.mk - Build the CSS data property tables by concatentating Android specific data and optionally SVG data. WebCore/config.h - Add switch for these rings. This switch is meant as a convenience for finding the code in WebKit that was added to enable this feature. Since the old code in DrawCursor has been removed, it does not revert to the old behavior if the switch is turned off. WebCore/css/AndroidCSSPropertyNames.in - The new ring properties, plus an old one we added before. WebCore/css/CSSComputedStyleDeclaration.cpp WebCore/css/CSSMutableStyleDeclaration.cpp WebCore/css/CSSParser.cpp WebCore/css/CSSStyleSelector.cpp - I can guess what these functions are for as well as anyone, but I really don't know. Do I need all of them? Do I need to modify Mutable at all? WebCore/css/CSSPropertyNames.in - Moved Android addition to AndroidCSSPropertyNames.in WebCore/platform/graphics/Color.h - Added initial color values here. WebCore/platform/graphics/android/android_graphics.* - This draws the cursor ring. The code that draws 'synthetic' links has been discarded. WebCore/rendering/style/RenderStyle.h - Functions to get, set, and initialize the style data. WebCore/rendering/style/StyleRareInheritedData.* - The storage for the style data and an equivalence function. WebKit/Android.mk - Added CachedColor to the build. WebKit/android/nav/CacheBuilder.cpp - Record the color from the DOM into the cache. WebKit/android/nav/CachedColor.* - Store the cached color info. WebKit/android/nav/CachedFrame.* - Where the array of colors is stored. WebKit/android/nav/CachedNode.* - Where the index to the colors is stored. Change-Id: Ia3a931f41d6545e47678e245aafe7c84d4658f94 http://b/2603197
* Merge WebKit at r65072 : Initial merge by git.Ben Murdoch2010-08-121-1/+1
| | | | Change-Id: Ibcf418498376b2660aacb7f8d46ea7085ef91585
* Revert "Add CSS cursor ring definitions"Cary Clark2010-07-301-7/+0
| | | | This reverts commit 0ed6485271097ecf1b4cf4e790f9cfdbb57d921c.
* Add CSS cursor ring definitionsCary Clark2010-07-301-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows web pages to have fine-grain control over the appearance of the rings drawn around nodes. Generated links (email, addresses, phone numbers) are no longer given unique colors. To preserve this feature, a separate change could add an HTML extension similar to vlink to provide the cursor ring defintions for theses links. The mechanism implemented below isn't appropriate since these links don't necessarily correspond to single DOM nodes or other DOM elements. ------------ CSS examples ------------ The CSS to specify the ring looks like: -webkit-ring-fill-color:rgba(0,0,255,0.4); -webkit-ring-inner-width:2 px; -webkit-ring-outer-width:3.5 px; -webkit-ring-outset: 8 px; -webkit-ring-pressed-inner-color:rgba(0,0,255,0.8); -webkit-ring-pressed-outer-color:rgba(0,0,127,0.3); -webkit-ring-radius: 10 px; -webkit-ring-selected-inner-color:rgba(63,63,255,0.8); -webkit-ring-selected-outer-color:rgba(63,63,127,0.3); and may be alternately defined with a property shortcut: -webkit-ring:rgba(255,0,0,0.4) 5px 7px rgba(255,0,0,0.8) rgba(127,0,0,0.3) 20px rgba(255,63,63,0.8) rgba(127,63,63,0.3); -------------------- Property definitions -------------------- A vertical cross-section of the ring corresponds to these parameters as shown: ______ R / ___O_ R = corner radius / / __I_ o I = inner ring / / / _O_ ^ O = outer ring | | | / F | F = fill |O|I|O| L o = outset | | | \_F_ | L = original link \ \ \__O_ V \ \___I_ o R \____O_ The fill color specifies what to draw inside the ring when the link is followed. The fill area consists of the original link area the outset. The inner and outer widths specify the stoke width of the inner and outer rings, respectively. The widths may be specified in fractional pixels. The implementation captures 4 bits of the fraction. The outset specifies the distance from the edge of the original link to the rings' center. Both rings are drawn at the same center location. The radius specifies the curvature of the corners at the center of the rings. ------------- Data lifetime ------------- The selected colors specify the colors of the inner and outer rings when the trackball or D-pad hovers over the link. The pressed colors specify the colors of the rings when the trackball center is pressed or the link is tapped. The CSS data is recorded in the RenderStyle when the DOM is parsed. The widths are scaled up by 16 to preserve the fraction. When the nav cache is built, the CSS style information is recorded in the CachedColor class. Only unique style sets are recorded; many CachedNode instances can share the same CachedColor instance. When the cursor ring is drawn, the CachedColor is retrieved by getting the index from the CachedNode, and looking up the entry in the CachedFrame. The widths are scaled down by 16 since Lengths are stored by the webkit as integers. ---------- File Edits ---------- WebCore/Android.derived.mk - Build the CSS data property tables by concatentating Android specific data and optionally SVG data. WebCore/config.h - Add switch for these rings. This switch is meant as a convenience for finding the code in WebKit that was added to enable this feature. Since the old code in DrawCursor has been removed, it does not revert to the old behavior if the switch is turned off. WebCore/css/AndroidCSSPropertyNames.in - The new ring properties, plus an old one we added before. WebCore/css/CSSComputedStyleDeclaration.cpp WebCore/css/CSSMutableStyleDeclaration.cpp WebCore/css/CSSParser.cpp WebCore/css/CSSStyleSelector.cpp - I can guess what these functions are for as well as anyone, but I really don't know. Do I need all of them? Do I need to modify Mutable at all? WebCore/css/CSSPropertyNames.in - Moved Android addition to AndroidCSSPropertyNames.in WebCore/platform/graphics/Color.h - Added initial color values here. WebCore/platform/graphics/android/android_graphics.* - This draws the cursor ring. The code that draws 'synthetic' links has been discarded. WebCore/rendering/style/RenderStyle.h - Functions to get, set, and initialize the style data. WebCore/rendering/style/StyleRareInheritedData.* - The storage for the style data and an equivalence function. WebKit/Android.mk - Added CachedColor to the build. WebKit/android/nav/CacheBuilder.cpp - Record the color from the DOM into the cache. WebKit/android/nav/CachedColor.* - Store the cached color info. WebKit/android/nav/CachedFrame.* - Where the array of colors is stored. WebKit/android/nav/CachedNode.* - Where the index to the colors is stored. Change-Id: Ia3a931f41d6545e47678e245aafe7c84d4658f94 http://b/2603197
* Merge WebKit at r63859 : Initial merge by git.Ben Murdoch2010-07-271-4/+9
| | | | Change-Id: Ie8096c63ec7c991c9a9cba8bdd9c3b74a3b8ed62
* Merge WebKit at r63173 : Initial merge by git.Leon Clarke2010-07-201-1/+3
| | | | Change-Id: Ife5af0c7c6261fbbc8ae6bc08c390efa9ef10b44
* Merge WebKit at r60074: Initial merge by gitSteve Block2010-05-271-1/+5
| | | | Change-Id: I18a2dc5439e36c928351ea829d8fb4e39b062fc7
* Merge webkit.org at r58033 : Initial merge by gitSteve Block2010-05-111-1/+0
| | | | Change-Id: If006c38561af287c50cd578d251629b51e4d8cd1
* Merge webkit.org at r51976 : Initial merge by git.Steve Block2009-12-171-1/+2
| | | | Change-Id: Ib0e7e2f0fb4bee5a186610272edf3186f0986b43
* Merge webkit.org at R49305 : Automatic merge by git.Steve Block2009-10-201-0/+9
| | | | Change-Id: I8968561bc1bfd72b8923b7118d3728579c6dbcc7
* Revert "Merge WebKit r47420"Andrei Popescu2009-08-191-9/+0
| | | | This reverts commit d227fc870c7a697500a3c900c31baf05fb9a8524.
* Merge WebKit r47420Ben Murdoch2009-08-181-0/+9
|
* Merge in WebKit r47029.Ben Murdoch2009-08-111-1/+0
|
* Get WebKit r44544.Feng Qian2009-06-171-0/+1
|
* AI 145796: Land the WebKit merge @r42026.Feng Qian2009-04-101-1/+6
| | | | Automated import of CL 145796
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+156
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-156/+0
|
* Code drop from //branches/cupcake/...@124589The Android Open Source Project2008-12-171-2/+9
|
* Initial ContributionThe Android Open Source Project2008-10-211-0/+4
|
* external/webkit r30707Upstream1970-01-121-0/+145