1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
d592e9155bb1ceb2b977abd5008e7474b214a2b2Eric FerraiuoloWidget Change History
d592e9155bb1ceb2b977abd5008e7474b214a2b2Eric Ferraiuolo=====================
cb0353f4e7db5a407bdeb3f32d6b6dbfd360ac18Satyen Desai * Refactored some of the box stamping code, to avoid Node references
f6d82be2d21a67d071b1d7a3d95a90f561d46c77Satyen Desai until render. Changed caching mechanism for Y.Widget.getByNode to use node.get("id")
ae03b489c1ce3defbcd9db6c72c68f0dc3a14b37Satyen Desai * Patched after listeners in Widget with a if (e.target === this), so that homogenous
ae03b489c1ce3defbcd9db6c72c68f0dc3a14b37Satyen Desai bubbles don't end up changing state at both the source and the target. Broader
ae03b489c1ce3defbcd9db6c72c68f0dc3a14b37Satyen Desai fix needs to go into Event/EventTarget
ac48c237b873665da5469d5f830ae97892c15d48Satyen Desai * Optimized focus handler registration, by only registering a single document focus
ac48c237b873665da5469d5f830ae97892c15d48Satyen Desai listener and using Widget.getByNode to ship out handling to the specific widget
6b7baaa39136d411805ffeac06cc81f3af043085Satyen Desai * Widget will now default to an empty object config, if one isn't passed in,
6b7baaa39136d411805ffeac06cc81f3af043085Satyen Desai so that HTML_PARSER can work with a static ATTRS srcNode definition.
6b7baaa39136d411805ffeac06cc81f3af043085Satyen Desai It's not possible to address this just at the HTML_PARSER level, since the config
6b7baaa39136d411805ffeac06cc81f3af043085Satyen Desai object gets used by reference, so we need to make sure everything is updating the
6b7baaa39136d411805ffeac06cc81f3af043085Satyen Desai config object which is passed to Base's initialization chain.
feb1dc670b0d4e1c6fcff58b35b36da3dfc5f18cJenny Donnelly * No changes.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Added workaround in destructor for single box widgets (contentBox === boundingBox)
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai Also extracted DOM removal into separate method, which can be overridden
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai if custom widgets don't want rendered DOM removed.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Fixed UI_EVENTS js exception when dealing with nested widgets rendered
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai by different Y instances.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Fixed UI_EVENTS invoking nested widget listeners more than once (also
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai fixed regression to Parent-Child as a result of this change).
154d19ea3947daf4c50b30c3e8e6951737c4569egeorge puckett * Added support for destroy(true) to Widget, which will remove and
154d19ea3947daf4c50b30c3e8e6951737c4569egeorge puckett destroy all child nodes (not just the boundingBox and contentBox)
154d19ea3947daf4c50b30c3e8e6951737c4569egeorge puckett contained within the Widget's boundingBox in order to help control
e9e2c43ee5d305c730cf09cd65c497ff9db1a8e8Satyen Desai Node cache size over long-running applications.
e9e2c43ee5d305c730cf09cd65c497ff9db1a8e8Satyen Desai destroy() will maintain its current behavior due to the potentially
e9e2c43ee5d305c730cf09cd65c497ff9db1a8e8Satyen Desai high run-time cost of destroying all child nodes.
e9e2c43ee5d305c730cf09cd65c497ff9db1a8e8Satyen Desai Widget developers still need to continue with the best practice of
e9e2c43ee5d305c730cf09cd65c497ff9db1a8e8Satyen Desai destroying explicit node references they create, in their destructors
e9e2c43ee5d305c730cf09cd65c497ff9db1a8e8Satyen Desai to support the destroy() case.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * HTML_PARSER now return null instead of an empty node list, if no nodes
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai are found, when using the [selector] syntax, so that the default value
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai will be applied for the attribute.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * UI_EVENTS support and skin util methods (only getSkinName currently)
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai broken out of widget-base into separate submodules, widget-uievents and
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai widget-skin.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * widget-base-ie broken out as conditional module.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Fixed widget-locale support. Needed lazyAdd:false, for strings attribute
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Changed widget UI_EVENTS type parsing, to use EventTarget.parseType and
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai removed after() override, since everything ends up going through on()
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Minimized widget dependencies from the complete node, base rollups,
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai to only the node and base submodules widget actually uses
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Fixed issue in UI_EVENTS handling, where removing the last listener for
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai a ui event, didn't clear out the _delegates hash even though the handler
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai was detached (for example, in tabview, if you remove all tabs, and then
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai add a new tab, clicking on the new tab didn't work.)
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Fixed ticket #2528758 : using widget's DOM event facade ends with error during destroy
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Fixed ticket #2528760 : _applyParsedConfig merges arrays, instead of letting user config win
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * "init, render and destroy listeners now called synchronously, if event already fired (see Event README)"
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * "render" event now published with the defaultTargetOnly set to true.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Added support for MyWidget.CSS_PREFIX static property
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai to let developers define their own CSS PREFIX instead of
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Changed default value for the tabIndex attribute to null, meaning by default
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai a Widget's bounding box will not be a focusable element.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Widget now has built-in support for Progressive Enhancement.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai 1. The document element (HTML) is now stamped with a class name
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai (yui-js-enabled) indicating that JS is enabled allowing for the
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai creation of JS-aware Widget CSS style rules for Progressive Enhancement.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai 2. Widget has support for a class name representing the "loading"
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai state that can be used in combination with the "yui-js-enabled" class name
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai to create style rules for widgets that are in the process of loading.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai There is support for use of both a generic Widget and type-specific
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai Widget class name by default (for example: "yui-widget-loading" and
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai "yui-tabview-loading").
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai 3. Widget's renderer will remove the "loading" class names from the
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai bounding box allowing the fully rendered and functional widget to be
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai Developer Usage / Requirements
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai Developers can take advantage of the system by following two steps:
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai 1. Simply stamping the bounding box of their widgets with the
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai corresponding "loading" state class name. The idea being that the markup
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai for this widget is already on the page, and the JS components required
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai to transform/bring the widget to life are in the process of loading.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai 2. Providing the definition of the loading style for the widget(s).
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Removed parentNode.inDoc() check from render, to allow implementations
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai to render to parentNodes which are document fragments. If rendering to
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai a document fragment, the implementation is responsible for adding the
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai document fragment to the document during the render lifecycle phase.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Split widget module into the following sub-modules
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai 1. widget-base : Core lifecycle and API support.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai 2. widget-htmlparser : HTML parser support.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai The "widget" module, is a roll up of the widget-base and widget-htmlparser
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai The widget-locale is a standalone module, which contains the deprecated
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai Internationalization support and has been replaced by the Y.Intl language
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai pack support, to allow strings to be defined separately from code.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Removed moveStyles support for 3.1. Can be re-added if required, but
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai currently does not seem to be in use.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Made render event fireOnce (along with init and destroy in Base)
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Widget will now fire user-generated events like DOM elements do (e.g.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai 'click', 'mouseover'). Like all other Widget events, these events are
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai prefixed with the Widget name (e.g. 'menuitem:click') and the default
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai context of the event listener will be the Widget that fired the event.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai The goals/purpose of the Widget UI events are:
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai 1. Provide developers with the ability to listen for UI events as though the
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai Widget is an atomic element, as opposed to DOM events that will bubble up
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai through all of the elements that compose a Widget's UI.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai 2. These are events that many Widget instances are going to want to publish
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai and fire, so Widget does this by default to ensure that these events are
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai fired in a performant, consistent way across Widget implementations.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai Additional info:
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai 1. Widget developers don't have to explicitly publish a given UI event in
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai order for Widget consumers to listen for them. By default UI events are
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai only published and fired if someone is listening for them.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai 2. Widget developers can choose to publish a given UI event in order to
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai explicitly control some aspect of the event. The most likely use case
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai is the desire to provide the default implementation/handler for a given
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai event. For example: a developer might want to publish a click event
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai for a Menu Widget with the goal of providing the default click
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai implementation/function (what gets canceled if a listener calls
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai the preventDefault() method.)
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai 3. The set of user-generated events published by widget is defined by the
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai UI_EVENTS prototype property. Widget developers can use this property
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai to pair down or extend the number of events that are published and
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai fired automatically.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai 4. For performance, these events are only created when someone is
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai listening, and the actual firing of these events is facilitated by a
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai single, delegated DOM event listener.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * content box now expands to fill bounding box. CSS is used for browsers
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai which support box-sizing:border-box. Expansion is handled programmatically
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai for others (currently IE6 & IE7). Maybe some edge cases which need
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Added an "id" attribute.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Added support for auto-rendering of widgets at the end of construction,
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai using the "render" attribute.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Added support for single-box widgets (contentBox and boundingBox can
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai point to same node).
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai Widget developers can set CONTENT_TEMPLATE to null if they have a
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai widget which doesn't need dual-box support.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Added _bindAttrUI and _syncAttrUI sugar methods, to bind after listeners
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai and sync methods, by attribute name.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * The widget's bounding box is now removed from the DOM and destroyed
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai when the widget it destroyed.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Added "srcNode" attribute, which acts as the root for HTML_PARSER.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai This allows widgets to support progressive enhancement, without having
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai to put the burden on the user to create and point to bounding boxes,
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai or content boxes.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Added protected _getSrcNode and _applyParsedConfig methods to allow for
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai HTML_PARSER customization, by allowing Widget developers to customize
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai the node passed into _parseNode on the input side, and the final merged
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai configuration on the output side of the srcNode parsing process.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai The default Widget _getSrcNode implementation uses "srcNode" if set,
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai otherwise falls back to "contentBox", for 3.0.0 compatibility.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai The default Widget _applyParsedConfig implementation aggregates the user
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai configuration literal, with the configuration output from parsed node,
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai with the user configuration taking precedence.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai NOTE: All HTML_PARSER related changes are backward compatible.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai Existing Widget implementations should still work. However HTML_PARSER
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai implementations based on contentBox being the root node should be
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai modified to work off of srcNode before the 3.1.0 release.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * No Changes
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * PluginHost moved down to Base.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Render event args added to event facade instead of being passed
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai across separately (e.parentNode).
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * "hasFocus" attribute renamed to "focused"
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * "focused" attribute is read only
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * "focused" attribute is set via:
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai 1. user interaction
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai 2. the "focus" and "blur" methods
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * Only one DOM focus event handler is used now (two for WebKit) and it is
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai bound to the widget's ownerDocument. This allows modal widgets to maintain
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai a reference to the element in the document that previously had focus and
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai to be able to restore that focus when the modal widget is hidden.
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai * "tabIndex" attribute was updated
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai 1. accepts a number or null
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai 2. more documentation
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai3.0.0PR2 - Initial release
4755330936ed4336fc1b7e6d61a980be39d4452fSatyen Desai--------------------------