Positioned Floats: Assertion hit in fast/block/positioning/positioned-float-layout...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2011-12-18  Dan Bernstein  <mitz@apple.com>
2
3         Positioned Floats: Assertion hit in fast/block/positioning/positioned-float-layout-after-image-load.html
4         https://bugs.webkit.org/show_bug.cgi?id=67759
5
6         Reviewed by Darin Adler.
7
8         Test: fast/block/positioning/positioned-float-layout-after-image-load.html
9
10         Positioned floats are both floating and positioned. Made the following functions treat them as
11         positioned rather than as floats by reordering code.
12
13         * rendering/RenderBlockLineLayout.cpp:
14         (WebCore::RenderBlock::LineBreaker::skipTrailingWhitespace):
15         (WebCore::RenderBlock::LineBreaker::skipLeadingWhitespace):
16         (WebCore::RenderBlock::LineBreaker::nextLineBreak):
17
18 2011-12-18  Benjamin Poulain  <bpoulain@apple.com>
19
20         Add support for 8 bits strings to Document::isValidName()
21         https://bugs.webkit.org/show_bug.cgi?id=74784
22
23         Reviewed by Andreas Kling.
24
25         The valid name has a fast path for ASCII, and a slow path
26         taking Unicode characters into account.
27
28         For 8-bit strings, we don't need to take the non-ASCII path
29         as it could never succeed if the ASCII path didn't.
30
31         * dom/Document.cpp:
32         (WebCore::isValidNameASCII):
33         (WebCore::Document::isValidName):
34
35 2011-12-18  Huang Dongsung  <luxtella@company100.net>
36
37         [Qt] Remove redundant m_glWidget->makeCurrent() calls in GraphicsContext3DQt.
38         https://bugs.webkit.org/show_bug.cgi?id=73814
39
40         It causes a performance hit.
41         Moved the redundant function calls to makeContextCurrent().
42
43         Reviewed by Noam Rosenthal.
44
45         * platform/graphics/qt/GraphicsContext3DQt.cpp:
46         (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
47         (WebCore::GraphicsContext3DPrivate::paintToTextureMapper):
48         (WebCore::GraphicsContext3DPrivate::paint):
49         (WebCore::GraphicsContext3DPrivate::makeCurrentIfNeeded):
50         (WebCore::GraphicsContext3D::~GraphicsContext3D):
51         (WebCore::GraphicsContext3D::makeContextCurrent):
52         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
53         (WebCore::GraphicsContext3D::reshape):
54         (WebCore::GraphicsContext3D::activeTexture):
55         (WebCore::GraphicsContext3D::attachShader):
56         (WebCore::GraphicsContext3D::getAttachedShaders):
57         (WebCore::GraphicsContext3D::bindAttribLocation):
58         (WebCore::GraphicsContext3D::bindBuffer):
59         (WebCore::GraphicsContext3D::bindFramebuffer):
60         (WebCore::GraphicsContext3D::bindRenderbuffer):
61         (WebCore::GraphicsContext3D::bindTexture):
62         (WebCore::GraphicsContext3D::blendColor):
63         (WebCore::GraphicsContext3D::blendEquation):
64         (WebCore::GraphicsContext3D::blendEquationSeparate):
65         (WebCore::GraphicsContext3D::blendFunc):
66         (WebCore::GraphicsContext3D::blendFuncSeparate):
67         (WebCore::GraphicsContext3D::bufferData):
68         (WebCore::GraphicsContext3D::bufferSubData):
69         (WebCore::GraphicsContext3D::checkFramebufferStatus):
70         (WebCore::GraphicsContext3D::clearColor):
71         (WebCore::GraphicsContext3D::clear):
72         (WebCore::GraphicsContext3D::clearDepth):
73         (WebCore::GraphicsContext3D::clearStencil):
74         (WebCore::GraphicsContext3D::colorMask):
75         (WebCore::GraphicsContext3D::compileShader):
76         (WebCore::GraphicsContext3D::compressedTexImage2D):
77         (WebCore::GraphicsContext3D::compressedTexSubImage2D):
78         (WebCore::GraphicsContext3D::copyTexImage2D):
79         (WebCore::GraphicsContext3D::copyTexSubImage2D):
80         (WebCore::GraphicsContext3D::cullFace):
81         (WebCore::GraphicsContext3D::depthFunc):
82         (WebCore::GraphicsContext3D::depthMask):
83         (WebCore::GraphicsContext3D::depthRange):
84         (WebCore::GraphicsContext3D::detachShader):
85         (WebCore::GraphicsContext3D::disable):
86         (WebCore::GraphicsContext3D::disableVertexAttribArray):
87         (WebCore::GraphicsContext3D::drawArrays):
88         (WebCore::GraphicsContext3D::drawElements):
89         (WebCore::GraphicsContext3D::enable):
90         (WebCore::GraphicsContext3D::enableVertexAttribArray):
91         (WebCore::GraphicsContext3D::finish):
92         (WebCore::GraphicsContext3D::flush):
93         (WebCore::GraphicsContext3D::framebufferRenderbuffer):
94         (WebCore::GraphicsContext3D::framebufferTexture2D):
95         (WebCore::GraphicsContext3D::frontFace):
96         (WebCore::GraphicsContext3D::generateMipmap):
97         (WebCore::GraphicsContext3D::getActiveAttrib):
98         (WebCore::GraphicsContext3D::getActiveUniform):
99         (WebCore::GraphicsContext3D::getAttribLocation):
100         (WebCore::GraphicsContext3D::getError):
101         (WebCore::GraphicsContext3D::getString):
102         (WebCore::GraphicsContext3D::hint):
103         (WebCore::GraphicsContext3D::isBuffer):
104         (WebCore::GraphicsContext3D::isEnabled):
105         (WebCore::GraphicsContext3D::isFramebuffer):
106         (WebCore::GraphicsContext3D::isProgram):
107         (WebCore::GraphicsContext3D::isRenderbuffer):
108         (WebCore::GraphicsContext3D::isShader):
109         (WebCore::GraphicsContext3D::isTexture):
110         (WebCore::GraphicsContext3D::lineWidth):
111         (WebCore::GraphicsContext3D::linkProgram):
112         (WebCore::GraphicsContext3D::pixelStorei):
113         (WebCore::GraphicsContext3D::polygonOffset):
114         (WebCore::GraphicsContext3D::readPixels):
115         (WebCore::GraphicsContext3D::releaseShaderCompiler):
116         (WebCore::GraphicsContext3D::renderbufferStorage):
117         (WebCore::GraphicsContext3D::sampleCoverage):
118         (WebCore::GraphicsContext3D::scissor):
119         (WebCore::GraphicsContext3D::shaderSource):
120         (WebCore::GraphicsContext3D::stencilFunc):
121         (WebCore::GraphicsContext3D::stencilFuncSeparate):
122         (WebCore::GraphicsContext3D::stencilMask):
123         (WebCore::GraphicsContext3D::stencilMaskSeparate):
124         (WebCore::GraphicsContext3D::stencilOp):
125         (WebCore::GraphicsContext3D::stencilOpSeparate):
126         (WebCore::GraphicsContext3D::texParameterf):
127         (WebCore::GraphicsContext3D::texParameteri):
128         (WebCore::GraphicsContext3D::uniform1f):
129         (WebCore::GraphicsContext3D::uniform1fv):
130         (WebCore::GraphicsContext3D::uniform2f):
131         (WebCore::GraphicsContext3D::uniform2fv):
132         (WebCore::GraphicsContext3D::uniform3f):
133         (WebCore::GraphicsContext3D::uniform3fv):
134         (WebCore::GraphicsContext3D::uniform4f):
135         (WebCore::GraphicsContext3D::uniform4fv):
136         (WebCore::GraphicsContext3D::uniform1i):
137         (WebCore::GraphicsContext3D::uniform1iv):
138         (WebCore::GraphicsContext3D::uniform2i):
139         (WebCore::GraphicsContext3D::uniform2iv):
140         (WebCore::GraphicsContext3D::uniform3i):
141         (WebCore::GraphicsContext3D::uniform3iv):
142         (WebCore::GraphicsContext3D::uniform4i):
143         (WebCore::GraphicsContext3D::uniform4iv):
144         (WebCore::GraphicsContext3D::uniformMatrix2fv):
145         (WebCore::GraphicsContext3D::uniformMatrix3fv):
146         (WebCore::GraphicsContext3D::uniformMatrix4fv):
147         (WebCore::GraphicsContext3D::useProgram):
148         (WebCore::GraphicsContext3D::validateProgram):
149         (WebCore::GraphicsContext3D::vertexAttrib1f):
150         (WebCore::GraphicsContext3D::vertexAttrib1fv):
151         (WebCore::GraphicsContext3D::vertexAttrib2f):
152         (WebCore::GraphicsContext3D::vertexAttrib2fv):
153         (WebCore::GraphicsContext3D::vertexAttrib3f):
154         (WebCore::GraphicsContext3D::vertexAttrib3fv):
155         (WebCore::GraphicsContext3D::vertexAttrib4f):
156         (WebCore::GraphicsContext3D::vertexAttrib4fv):
157         (WebCore::GraphicsContext3D::vertexAttribPointer):
158         (WebCore::GraphicsContext3D::viewport):
159         (WebCore::GraphicsContext3D::getBooleanv):
160         (WebCore::GraphicsContext3D::getBufferParameteriv):
161         (WebCore::GraphicsContext3D::getFloatv):
162         (WebCore::GraphicsContext3D::getFramebufferAttachmentParameteriv):
163         (WebCore::GraphicsContext3D::getIntegerv):
164         (WebCore::GraphicsContext3D::getProgramiv):
165         (WebCore::GraphicsContext3D::getProgramInfoLog):
166         (WebCore::GraphicsContext3D::getRenderbufferParameteriv):
167         (WebCore::GraphicsContext3D::getShaderiv):
168         (WebCore::GraphicsContext3D::getShaderInfoLog):
169         (WebCore::GraphicsContext3D::getShaderSource):
170         (WebCore::GraphicsContext3D::getTexParameterfv):
171         (WebCore::GraphicsContext3D::getTexParameteriv):
172         (WebCore::GraphicsContext3D::getUniformfv):
173         (WebCore::GraphicsContext3D::getUniformiv):
174         (WebCore::GraphicsContext3D::getUniformLocation):
175         (WebCore::GraphicsContext3D::getVertexAttribfv):
176         (WebCore::GraphicsContext3D::getVertexAttribiv):
177         (WebCore::GraphicsContext3D::getVertexAttribOffset):
178         (WebCore::GraphicsContext3D::texImage2D):
179         (WebCore::GraphicsContext3D::texSubImage2D):
180         (WebCore::GraphicsContext3D::createBuffer):
181         (WebCore::GraphicsContext3D::createFramebuffer):
182         (WebCore::GraphicsContext3D::createProgram):
183         (WebCore::GraphicsContext3D::createRenderbuffer):
184         (WebCore::GraphicsContext3D::createShader):
185         (WebCore::GraphicsContext3D::createTexture):
186         (WebCore::GraphicsContext3D::deleteBuffer):
187         (WebCore::GraphicsContext3D::deleteFramebuffer):
188         (WebCore::GraphicsContext3D::deleteProgram):
189         (WebCore::GraphicsContext3D::deleteRenderbuffer):
190         (WebCore::GraphicsContext3D::deleteShader):
191         (WebCore::GraphicsContext3D::deleteTexture):
192
193 2011-12-18  Andreas Kling  <kling@webkit.org>
194
195         Removing unrelated printf() that slipped into my last commit.
196
197         * platform/ScrollableArea.cpp:
198         (WebCore::ScrollableArea::scrollToOffsetWithoutAnimation):
199
200 2011-12-18  Andreas Kling  <kling@webkit.org>
201
202         KURL::protocolIs() should handle 8-bit strings.
203         <http://webkit.org/b/74827>
204
205         Reviewed by Antti Koivisto.
206
207         * platform/KURL.cpp:
208         (WebCore::isLetterMatchIgnoringCase):
209
210             Turned this into a template method so it can be used for both UChar and LChar.
211
212         (WebCore::charactersAreProtocol):
213         (WebCore::protocolIs):
214
215             Handle 8/16 bit strings separately to avoid conversion.
216
217 2011-12-18  Alice Boxhall  <aboxhall@chromium.org>
218
219         Make AccessibilityObject::lineForPosition return the correct value for cases where the position is not within the current object.
220         https://bugs.webkit.org/show_bug.cgi?id=71348
221
222         Reviewed by Chris Fleizach.
223
224         * accessibility/AccessibilityObject.cpp:
225         (WebCore::AccessibilityObject::lineForPosition):
226         * accessibility/mac/WebAccessibilityObjectWrapper.mm:
227         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
228
229 2011-12-18  Sam Weinig  <sam@webkit.org>
230
231         Make EventHandler::handleWheelEvent take const PlatformWheelEvent&
232         https://bugs.webkit.org/show_bug.cgi?id=74824
233
234         Reviewed by Anders Carlsson.
235
236         * WebCore.exp.in:
237         * page/EventHandler.cpp:
238         (WebCore::EventHandler::handleWheelEvent):
239         * page/EventHandler.h:
240         * page/blackberry/EventHandlerBlackBerry.cpp:
241         (WebCore::EventHandler::passWheelEventToWidget):
242         * page/chromium/EventHandlerChromium.cpp:
243         (WebCore::EventHandler::passWheelEventToWidget):
244         * page/efl/EventHandlerEfl.cpp:
245         (WebCore::EventHandler::passWheelEventToWidget):
246         * page/gtk/EventHandlerGtk.cpp:
247         (WebCore::EventHandler::passWheelEventToWidget):
248         * page/mac/EventHandlerMac.mm:
249         (WebCore::EventHandler::passWheelEventToWidget):
250         * page/qt/EventHandlerQt.cpp:
251         (WebCore::EventHandler::passWheelEventToWidget):
252         * page/win/EventHandlerWin.cpp:
253         (WebCore::EventHandler::passWheelEventToWidget):
254         * page/wx/EventHandlerWx.cpp:
255         (WebCore::EventHandler::passWheelEventToWidget):
256         * platform/PlatformWheelEvent.h:
257         (WebCore::PlatformWheelEvent::copyTurningVerticalTicksIntoHorizontalTicks):
258
259 2011-12-18  James Kozianski  <koz@chromium.org>
260
261         [chromium] Add worldId parameter to allowScriptExtension()
262         https://bugs.webkit.org/show_bug.cgi?id=74214
263
264         Chromium uses the worldId to determine what extension is running in a
265         v8 context and knowing that at the time allowScriptExtension() is
266         called allows us to conditionally inject extension APIs.
267
268         Reviewed by Darin Fisher.
269
270         * bindings/v8/V8DOMWindowShell.cpp:
271         (WebCore::V8DOMWindowShell::initContextIfNeeded):
272         (WebCore::V8DOMWindowShell::createNewContext):
273         * bindings/v8/V8DOMWindowShell.h:
274         * bindings/v8/V8IsolatedContext.cpp:
275         (WebCore::V8IsolatedContext::V8IsolatedContext):
276         * loader/EmptyClients.h:
277         (WebCore::EmptyFrameLoaderClient::allowScriptExtension):
278         * loader/FrameLoaderClient.h:
279
280 2011-12-18  Adam Barth  <abarth@webkit.org>
281
282         Adoption agency iteration limits in HTML parser don't match HTML5 spec
283         https://bugs.webkit.org/show_bug.cgi?id=74822
284
285         Reviewed by Eric Seidel.
286
287         Previously, we were using the iteration limits from the old tree
288         builder.  Now we use the iteration limits from the HTML5 specification.
289
290         Tests: html5lib/runner.html
291
292         * html/parser/HTMLTreeBuilder.cpp:
293         (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
294
295 2011-12-18  Antti Koivisto  <antti@apple.com>
296
297         https://bugs.webkit.org/show_bug.cgi?id=73954
298         REGRESSION (r97745): Transitions don't work on links
299
300         Reviewed by Andreas Kling.
301
302         Test: transitions/visited-link-color.html
303         
304         Since visited link colors are now part of the RenderStyle, they need to be transitioned
305         along with the corresponding regular colors.
306
307         * page/animation/AnimationBase.cpp:
308         (WebCore::PropertyWrapperVisitedAffectedColor::PropertyWrapperVisitedAffectedColor):
309         (WebCore::PropertyWrapperVisitedAffectedColor::equals):
310         (WebCore::PropertyWrapperVisitedAffectedColor::blend):
311         (WebCore::AnimationBase::ensurePropertyMap):
312         
313             Add new wrapper class that applies both regular and visited color.
314         
315         * rendering/style/RenderStyle.h:
316         (WebCore::InheritedFlags::visitedLinkColor):
317         (WebCore::InheritedFlags::visitedLinkBackgroundColor):
318         (WebCore::InheritedFlags::visitedLinkBorderLeftColor):
319         (WebCore::InheritedFlags::visitedLinkBorderRightColor):
320         (WebCore::InheritedFlags::visitedLinkBorderBottomColor):
321         (WebCore::InheritedFlags::visitedLinkBorderTopColor):
322         (WebCore::InheritedFlags::visitedLinkOutlineColor):
323         (WebCore::InheritedFlags::visitedLinkColumnRuleColor):
324         (WebCore::InheritedFlags::visitedLinkTextEmphasisColor):
325         (WebCore::InheritedFlags::visitedLinkTextFillColor):
326         (WebCore::InheritedFlags::visitedLinkTextStrokeColor):
327         
328             Add accessors.
329         
330         * rendering/style/StyleRareNonInheritedData.cpp:
331         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
332         
333             Opportunistic fix. Don't know how to test.
334
335 2011-12-18  Anders Carlsson  <andersca@apple.com>
336
337         Set the main frame view scroll position asynchronously
338         https://bugs.webkit.org/show_bug.cgi?id=74823
339
340         Reviewed by Sam Weinig.
341
342         * page/ScrollingCoordinator.cpp:
343         (WebCore::ScrollingCoordinator::ScrollingCoordinator):
344         Initialize m_didDispatchDidUpdateMainFrameScrollPosition to false.
345
346         (WebCore::ScrollingCoordinator::didUpdateMainFrameScrollPosition):
347         Get the scroll position, reset m_didDispatchDidUpdateMainFrameScrollPosition to false and
348         then call FrameView::setScrollOffset to update the scroll position.
349
350         * page/ScrollingCoordinator.h:
351         * page/mac/ScrollingCoordinatorMac.mm:
352         (WebCore::ScrollingCoordinator::scrollByOnScrollingThread):
353         Update the scroll position and dispatch ScrollingCoordinator::didUpdateMainFrameScrollPosition on
354         the main thread if needed.
355
356 2011-12-18  Andreas Kling  <kling@webkit.org>
357
358         JSC/HTMLCollection: Optimize canGetItemsForName().
359         <http://webkit.org/b/74806>
360
361         Reviewed by Sam Weinig.
362
363         Add HTMLCollection::hasNamedItem(name) and use that in the JSC bindings'
364         canGetItemsForName() instead of fetching the list of named items just to
365         check if it's empty or not.
366
367         * bindings/js/JSHTMLAllCollectionCustom.cpp:
368         (WebCore::JSHTMLAllCollection::canGetItemsForName):
369         * bindings/js/JSHTMLCollectionCustom.cpp:
370         (WebCore::JSHTMLCollection::canGetItemsForName):
371         * html/HTMLCollection.cpp:
372         (WebCore::HTMLCollection::hasNamedItem):
373         * html/HTMLCollection.h:
374
375 2011-12-18  Sam Weinig  <sam@webkit.org>
376
377         Spruce up PlatformWheelEvent a bit
378         https://bugs.webkit.org/show_bug.cgi?id=74821
379
380         Reviewed by Dan Bernstein.
381
382         * dom/WheelEvent.cpp:
383         (WebCore::WheelEventDispatchMediator::WheelEventDispatchMediator):
384         * platform/PlatformWheelEvent.h:
385         (WebCore::PlatformWheelEvent::directionInvertedFromDevice):
386         Remove x/y getters in favor of direct access to the IntPoints, and rename 
387         webkitDirectionInvertedFromDevice() to directionInvertedFromDevice() since
388         it is not an exposed API.
389
390 2011-12-18  Anders Carlsson  <andersca@apple.com>
391
392         Scroll the main frame on the scrolling thread
393         https://bugs.webkit.org/show_bug.cgi?id=74820
394
395         Reviewed by Andreas Kling.
396
397         * page/ScrollingCoordinator.cpp:
398         (WebCore::ScrollingCoordinator::handleWheelEvent):
399         Compute a scroll offset from the wheel event and tell the scrolling thread to scroll by the given offset.
400
401         * page/ScrollingCoordinator.h:
402         * page/mac/ScrollingCoordinatorMac.mm:
403         (WebCore::ScrollingCoordinator::scrollByOnScrollingThread):
404         Clamp the updated position to the minimum and maximum scrollable position.
405
406         (WebCore::ScrollingCoordinator::updateMainFrameScrollLayerPositionOnScrollingThread):
407         Actually reposition the layer.
408
409 2011-12-18  Andreas Kling  <kling@webkit.org>
410
411         HTMLAllCollection: Get rid of stateful namedItem traversal.
412         <http://webkit.org/b/74803>
413
414         Reviewed by Sam Weinig.
415
416         Add a namedItemWithIndex() function to HTMLAllCollection to cover the
417         document.all(name, index) use-case. This moves the collection traversal
418         into WebCore and allows us to remove some complexity.
419
420         This incidentally fixes a bug where the CollectionCache would point to
421         the last node returned by document.all(name, index) without the correct
422         associated node index (because info()->current was getting set without
423         updating info()->position.) Added a layout test for that.
424
425         Test: fast/dom/htmlallcollection-call-with-index-caching-bug.html
426
427         * bindings/js/JSHTMLAllCollectionCustom.cpp:
428         (WebCore::callHTMLAllCollection):
429         * bindings/v8/custom/V8HTMLAllCollectionCustom.cpp:
430         (WebCore::V8HTMLAllCollection::callAsFunctionCallback):
431
432             Replace collection traversal by calls to namedItemWithIndex().
433
434         * html/HTMLCollection.h:
435
436             Promoted updateNameCache() to protected (for HTMLAllCollection.)
437             Demoted checkForNameMatch() to private.
438
439         * html/HTMLAllCollection.cpp:
440         (WebCore::HTMLAllCollection::namedItemWithIndex):
441
442             Added for document.all(name, index). Uses the name/id cache.
443
444         * html/HTMLAllCollection.cpp:
445         * html/HTMLAllCollection.h:
446         (WebCore::HTMLAllCollection::HTMLAllCollection):
447
448             Removed m_idsDone, HTMLAllCollection is now stateless.
449
450
451 2011-12-18  Anders Carlsson  <andersca@apple.com>
452
453         The scrolling coordinator should know about the main frame scroll layer
454         https://bugs.webkit.org/show_bug.cgi?id=74817
455
456         Reviewed by Andreas Kling.
457
458         * page/ScrollingCoordinator.h:
459         * page/mac/ScrollingCoordinatorMac.mm:
460         (WebCore::ScrollingThread::threadCallback):
461         Move the * to where it belongs.
462
463         (WebCore::ScrollingCoordinator::setFrameScrollLayer):
464         Keep track of the underlying CALayer of the frame scroll layer.
465
466         * rendering/RenderLayerCompositor.cpp:
467         (WebCore::RenderLayerCompositor::ensureRootLayer):
468         Call ScrollingCoordinator::setFrameScrollLayer.
469
470 2011-12-18  Andreas Kling  <kling@webkit.org>
471
472         Interacting with GMail message lists is sluggish.
473         <http://webkit.org/b/74813>
474
475         Reviewed by Dan Bernstein.
476
477         Add an argument to collapsed*Border() to control whether the border
478         color is computed or not. This allows us to avoid expensive work when
479         we're only interested in the metrics.
480
481         RenderStyle::visitedDependentColor() was very hot (4.5%) when hit-testing
482         on GMail and this removes its usage altogether.
483         This should be an improvement for table rendering as well, since it was
484         all happening below RenderBox::overflowClipRect().
485
486         * rendering/RenderTableCell.h:
487         * rendering/RenderTableCell.cpp:
488         (WebCore::RenderTableCell::collapsedLeftBorder):
489         (WebCore::RenderTableCell::collapsedRightBorder):
490         (WebCore::RenderTableCell::collapsedTopBorder):
491         (WebCore::RenderTableCell::collapsedBottomBorder):
492
493             Add and propagate an IncludeBorderColorOrNot argument that decides
494             whether we compute the CollapsedBorderValue's color.
495
496         (WebCore::RenderTableCell::collapsedStartBorder):
497         (WebCore::RenderTableCell::collapsedEndBorder):
498
499             Renamed start & end to startColorProperty & endColorProperty
500             for clarity. Also same modifications as the above functions.
501
502         (WebCore::RenderTableCell::collapsedBeforeBorder):
503         (WebCore::RenderTableCell::collapsedAfterBorder):
504
505             Renamed before & after to beforeColorProperty & afterColorProperty
506             for clarity. Also same modifications as the above functions.
507
508         (WebCore::RenderTableCell::borderHalfStart):
509         (WebCore::RenderTableCell::borderHalfEnd):
510         (WebCore::RenderTableCell::borderHalfBefore):
511         (WebCore::RenderTableCell::borderHalfAfter):
512
513             Pass DoNotIncludeBorderColor to collapsed*Border() since we only care
514             about the metrics here.
515
516 2011-12-18  Anders Carlsson  <andersca@apple.com>
517
518         The scrolling coordinator should keep track of the main frame geometry
519         https://bugs.webkit.org/show_bug.cgi?id=74816
520
521         Reviewed by Andreas Kling.
522
523         * page/ScrollingCoordinator.cpp:
524         (WebCore::ScrollingCoordinator::syncFrameGeometry):
525         Update the frame geometry accordingly when it changes.
526
527         * page/ScrollingCoordinator.h:
528         * rendering/RenderLayerCompositor.cpp:
529         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
530         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
531         Call ScrollingCoordinator::syncFrameGeometry.
532
533         (WebCore::RenderLayerCompositor::scrollingCoordinator):
534         Add new getter.
535
536 2011-12-17  Sam Weinig  <sam@webkit.org>
537
538         Move timestamp down from PlatformEvent subclasses to the base class
539         https://bugs.webkit.org/show_bug.cgi?id=74805
540
541         Reviewed by Anders Carlsson.
542
543         * platform/PlatformEvent.h:
544         (WebCore::PlatformEvent::type):
545         (WebCore::PlatformEvent::timestamp):
546         (WebCore::PlatformEvent::PlatformEvent):
547         * platform/PlatformGestureEvent.h:
548         (WebCore::PlatformGestureEvent::PlatformGestureEvent):
549         * platform/PlatformMouseEvent.h:
550         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
551         (WebCore::PlatformMouseEvent::clickCount):
552         * platform/PlatformTouchEvent.h:
553         (WebCore::PlatformTouchEvent::PlatformTouchEvent):
554         * platform/PlatformWheelEvent.h:
555         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
556         * platform/efl/PlatformKeyboardEventEfl.cpp:
557         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
558         * platform/efl/PlatformMouseEventEfl.cpp:
559         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
560         * platform/efl/PlatformTouchEventEfl.cpp:
561         (WebCore::PlatformTouchEvent::PlatformTouchEvent):
562         * platform/efl/PlatformWheelEventEfl.cpp:
563         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
564         * platform/gtk/PlatformKeyboardEventGtk.cpp:
565         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
566         * platform/gtk/PlatformWheelEventGtk.cpp:
567         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
568         * platform/mac/KeyEventMac.mm:
569         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
570         * platform/mac/PlatformMouseEventMac.mm:
571         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
572         * platform/mac/WheelEventMac.mm:
573         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
574         * platform/qt/PlatformKeyboardEventQt.cpp:
575         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
576         * platform/qt/WheelEventQt.cpp:
577         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
578         * platform/win/KeyEventWin.cpp:
579         (WebCore::singleCharacterString):
580         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
581         * platform/win/PlatformMouseEventWin.cpp:
582         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
583         * platform/win/WheelEventWin.cpp:
584         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
585         * platform/wx/KeyboardEventWx.cpp:
586         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
587         * platform/wx/MouseEventWx.cpp:
588         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
589         * platform/wx/MouseWheelEventWx.cpp:
590         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
591
592 2011-12-18  Anders Carlsson  <andersca@apple.com>
593
594         Add a scrolling thread to the scrolling coordinator
595         https://bugs.webkit.org/show_bug.cgi?id=74814
596
597         Reviewed by Andreas Kling.
598
599         * WebCore.exp.in:
600         Export ScrollingCoordinator::handleWheelEvent.
601
602         * WebCore.xcodeproj/project.pbxproj:
603         Add ScrollingCoordinatorMac.mm
604
605         * page/ScrollingCoordinator.cpp:
606         (WebCore::ScrollingCoordinator::handleWheelEvent):
607         Add a stub function.
608
609         * page/ScrollingCoordinator.h:
610         * page/mac/ScrollingCoordinatorMac.mm: Added.
611         Add a ScrollingThread object which creates a thread and attaches a run loop source
612         to it, allowing for functions to be dispatched and run on said thread.
613
614         (WebCore::ScrollingCoordinator::isScrollingThread):
615         Call ScrollingThread::isCurrentThread.
616
617         (WebCore::ScrollingCoordinator::dispatchOnScrollingThread):
618         Call ScrollingThread::dispatch.
619
620 2011-12-18  Anders Carlsson  <andersca@apple.com>
621
622         EventDispatcher should keep track of all scrolling coordinators
623         https://bugs.webkit.org/show_bug.cgi?id=74810
624
625         Reviewed by Andreas Kling.
626
627         Export symbols needed by WebKit2.
628
629         * WebCore.exp.in:
630
631 2011-12-18  Raul Hudea  <rhudea@adobe.com>
632
633         Add transform function completion to web-inspector
634
635         Web Inspector: Auto-complete transform functions for -webkit-transform
636         https://bugs.webkit.org/show_bug.cgi?id=74730
637
638         Reviewed by Pavel Feldman.
639
640         No new test. Trivial change.
641
642         * inspector/front-end/CSSKeywordCompletions.js:
643
644 2011-12-18  Ilya Tikhonovsky  <loislo@chromium.org>
645
646         Web Inspector: chromium profiler: change default root type for retaining paths from GC Roots to DOMWindow.
647         https://bugs.webkit.org/show_bug.cgi?id=74697
648
649         Reviewed by Pavel Feldman.
650
651         * inspector/front-end/DetailedHeapshotView.js:
652         (WebInspector.DetailedHeapshotView.prototype.get isTracingToWindowObjects):
653
654 2011-12-18  Peter Rybin  <peter.rybin@gmail.com>
655
656         Web Inspector: Switch to type-safe JSON ConsoleMessage.cpp, InspectorDOMAgent.cpp, InspectorDebuggerAgent.cpp, ScriptCallFrame.cpp
657         https://bugs.webkit.org/show_bug.cgi?id=74549
658
659         Reviewed by Pavel Feldman.
660
661         Work with InspectorObject is replaced with type-safe generated API
662         usage.
663         Inspector.json and Inspector-0.1.json are also changed to better
664         reflect data types that are actually being transmitted.
665
666         * inspector/ConsoleMessage.cpp:
667         (WebCore::ConsoleMessage::addToFrontend):
668         * inspector/Inspector-0.1.json:
669         * inspector/Inspector.json:
670         * inspector/InspectorDOMAgent.cpp:
671         (WebCore::InspectorDOMAgent::buildObjectForNode):
672         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
673         * inspector/InspectorDebuggerAgent.cpp:
674         (WebCore::InspectorDebuggerAgent::resolveBreakpoint):
675         * inspector/ScriptCallFrame.cpp:
676         (WebCore::ScriptCallFrame::buildInspectorObject):
677
678 2011-12-18  Peter Rybin  <peter.rybin@gmail.com>
679
680         Web Inspector: CodeGeneratorInspector.py: use generated types in method parameters
681         https://bugs.webkit.org/show_bug.cgi?id=74661
682
683         Reviewed by Pavel Feldman.
684
685         Type binding object is added to raw_type object.
686
687         * inspector/CodeGeneratorInspector.py:
688         (TypeBindings.create_for_named_type_declaration.EnumBinding.generate_type_builder):
689         (TypeBindings.create_for_named_type_declaration.EnumBinding.get_in_c_type_text):
690         (TypeBindings.create_for_named_type_declaration.EnumBinding):
691         (TypeBindings.create_for_named_type_declaration.EnumBinding.reduce_to_raw_type):
692         (TypeBindings.create_for_named_type_declaration.PlainString.generate_type_builder):
693         (TypeBindings.create_for_named_type_declaration.PlainString.reduce_to_raw_type):
694         (TypeBindings.create_for_named_type_declaration.PlainString):
695         (TypeBindings.create_for_named_type_declaration.PlainString.get_in_c_type_text):
696         (TypeBindings):
697         (TypeBindings.create_for_named_type_declaration.ClassBinding):
698         (get_in_c_type_text):
699         (reduce_to_raw_type):
700         (PlainObjectBinding.generate_type_builder):
701         (PlainObjectBinding.get_in_c_type_text):
702         (PlainObjectBinding):
703         (PlainObjectBinding.reduce_to_raw_type):
704         (RawTypesBinding.generate_type_builder):
705         (RawTypesBinding.get_in_c_type_text):
706         (RawTypesBinding):
707         (RawTypesBinding.reduce_to_raw_type):
708         (resolve_param_type.RawTypeBinding.reduce_to_raw_type):
709         (resolve_param_type.RawTypeBinding):
710         (resolve_param_type.RawTypeBinding.get_in_c_type_text):
711         (resolve_param_type):
712         (Generator.process_event):
713
714 2011-12-18  Sheriff Bot  <webkit.review.bot@gmail.com>
715
716         Unreviewed, rolling out r103169.
717         http://trac.webkit.org/changeset/103169
718         https://bugs.webkit.org/show_bug.cgi?id=74809
719
720         it broke compilation on many platforms (Requested by loislo_
721         on #webkit).
722
723         * WebCore.gypi:
724         * platform/ColorChooser.cpp: Renamed from Source/WebKit/chromium/src/ColorChooserProxy.h.
725         (WebCore::ColorChooserClient::~ColorChooserClient):
726         (WebCore::ColorChooserClient::newColorChooser):
727         (WebCore::ColorChooserClient::discardChooser):
728         (WebCore::ColorChooser::ColorChooser):
729         (WebCore::ColorChooser::create):
730         (WebCore::ColorChooser::~ColorChooser):
731         (WebCore::ColorChooser::didChooseColor):
732         (WebCore::ColorChooser::didCleanup):
733
734 2011-12-18  Alexandru Chiculita  <achicu@adobe.com>
735
736         [CSS Shaders] Add FECustomFilter that renders custom filters
737         https://bugs.webkit.org/show_bug.cgi?id=73317
738
739         Using a GraphicsContext3D to render the shaders in GPU, read the
740         result back and use it in the software filters pipeline.
741
742         Reviewed by Chris Marrin.
743
744         Test: css3/filters/effect-custom.html
745
746         * CMakeLists.txt:
747         * GNUmakefile.list.am:
748         * Target.pri:
749         * WebCore.gypi:
750         * WebCore.vcproj/WebCore.vcproj:
751         * WebCore.xcodeproj/project.pbxproj:
752         * loader/cache/CachedShader.cpp:
753         (WebCore::CachedShader::CachedShader):
754         (WebCore::CachedShader::shaderString):
755         (WebCore::CachedShader::data):
756         * loader/cache/CachedShader.h:
757         * platform/graphics/filters/CustomFilterMesh.cpp: Added.
758         (WebCore::MeshGenerator::MeshGenerator):
759         (WebCore::MeshGenerator::vertices):
760         (WebCore::MeshGenerator::indices):
761         (WebCore::MeshGenerator::points):
762         (WebCore::MeshGenerator::pointsCount):
763         (WebCore::MeshGenerator::tiles):
764         (WebCore::MeshGenerator::tilesCount):
765         (WebCore::MeshGenerator::indicesCount):
766         (WebCore::MeshGenerator::floatsPerVertex):
767         (WebCore::MeshGenerator::vertexCount):
768         (WebCore::MeshGenerator::addTile):
769         (WebCore::MeshGenerator::addAttachedMeshIndex):
770         (WebCore::MeshGenerator::generateAttachedMesh):
771         (WebCore::MeshGenerator::addDetachedMeshVertexAndIndex):
772         (WebCore::MeshGenerator::generateDetachedMesh):
773         (WebCore::MeshGenerator::addPositionAttribute):
774         (WebCore::MeshGenerator::addTexCoordAttribute):
775         (WebCore::MeshGenerator::addMeshCoordAttribute):
776         (WebCore::MeshGenerator::addTriangleCoordAttribute):
777         (WebCore::MeshGenerator::addAttachedMeshVertexAttributes):
778         (WebCore::MeshGenerator::addDetachedMeshVertexAttributes):
779         (WebCore::MeshGenerator::dumpBuffers):
780         (WebCore::CustomFilterMesh::CustomFilterMesh):
781         (WebCore::CustomFilterMesh::~CustomFilterMesh):
782         * platform/graphics/filters/CustomFilterMesh.h: Added.
783         (WebCore::CustomFilterMesh::create):
784         (WebCore::CustomFilterMesh::verticesBufferObject):
785         (WebCore::CustomFilterMesh::bytesPerVertex):
786         (WebCore::CustomFilterMesh::elementsBufferObject):
787         (WebCore::CustomFilterMesh::indicesCount):
788         (WebCore::CustomFilterMesh::meshBox):
789         (WebCore::CustomFilterMesh::meshType):
790         * platform/graphics/filters/CustomFilterShader.cpp: Added.
791         (WebCore::CustomFilterShader::defaultVertexShaderString):
792         (WebCore::CustomFilterShader::defaultFragmentShaderString):
793         (WebCore::CustomFilterShader::CustomFilterShader):
794         (WebCore::CustomFilterShader::~CustomFilterShader):
795         * platform/graphics/filters/CustomFilterShader.h: Added.
796         * platform/graphics/filters/FECustomFilter.cpp: Added.
797         (WebCore::orthoMatrix):
798         (WebCore::FECustomFilter::FECustomFilter):
799         (WebCore::FECustomFilter::create):
800         (WebCore::FECustomFilter::platformApplySoftware):
801         (WebCore::FECustomFilter::dump):
802         (WebCore::FECustomFilter::externalRepresentation):
803         * platform/graphics/filters/FECustomFilter.h: Added.
804         * platform/graphics/gpu/Texture.cpp:
805         * platform/graphics/transforms/TransformationMatrix.cpp:
806         (WebCore::TransformationMatrix::toColumnMajorFloatArray):
807         * platform/graphics/transforms/TransformationMatrix.h:
808         * rendering/FilterEffectObserver.h: Copied from Source/WebCore/loader/cache/CachedShader.cpp.
809         (WebCore::FilterEffectObserver::~FilterEffectObserver):
810         * rendering/FilterEffectRenderer.cpp:
811         (WebCore::isWebGLEnabled):
812         (WebCore::FilterEffectRenderer::FilterEffectRenderer):
813         (WebCore::FilterEffectRenderer::build):
814         (WebCore::FilterEffectRenderer::notifyFinished):
815         * rendering/FilterEffectRenderer.h:
816         (WebCore::FilterEffectRenderer::create):
817         * rendering/RenderLayer.cpp:
818         (WebCore::RenderLayer::updateOrRemoveFilterEffect):
819         (WebCore::RenderLayer::filterNeedsRepaint):
820         * rendering/RenderLayer.h:
821         * rendering/style/StyleCachedShader.h:
822         (WebCore::StyleCachedShader::cachedShader):
823         * rendering/style/StyleShader.h:
824         (WebCore::StyleShader::cachedShader):
825
826 2011-12-18  Keishi Hattori  <keishi@webkit.org>
827
828         Implement <input type=color> UI WebKit chromium part
829         https://bugs.webkit.org/show_bug.cgi?id=65897
830
831         Reviewed by Darin Fisher.
832
833         * WebCore.gypi: Added ColorChooser.h and ColorChooserClient.h
834
835 2011-12-17  Keishi Hattori  <keishi@webkit.org>
836
837         Refactor input type color WebCore part
838         https://bugs.webkit.org/show_bug.cgi?id=74591
839
840         Reviewed by Kent Tamura.
841
842         Changing ColorChooser to address issues raised in Bug 65897.
843         Chrome::createColorChooser will return a WebCore::ColorChooser instance
844         so the WebCore side (ColorInputType) and call the WebKit side. We pass the ColorChooserClient as an argument
845         to Chrome::createColorChooser so the WebKit side can call callbacks, didEndChooser and didChooseColor.
846
847         * html/ColorInputType.cpp:
848         (WebCore::ColorInputType::~ColorInputType):
849         (WebCore::ColorInputType::setValue):
850         (WebCore::ColorInputType::handleDOMActivateEvent): Calls createColorChooser to open the color chooser.
851         (WebCore::ColorInputType::detach):
852         (WebCore::ColorInputType::didEndChooser): Release the ColorChooser object.
853         (WebCore::ColorInputType::endColorChooser):
854         (WebCore::ColorInputType::updateColorSwatch): Added argument so it will compile again.
855         * html/ColorInputType.h:
856         * html/HTMLInputElement.cpp:
857         (WebCore::HTMLInputElement::selectColorInColorChooser):
858         * loader/EmptyClients.h:
859         (WebCore::EmptyChromeClient::createColorChooser):
860         * loader/FrameLoader.cpp:
861         * page/Chrome.cpp:
862         (WebCore::Chrome::createColorChooser): Opens the color chooser. Returns a ColorChooser PassOwnPtr.
863         * page/Chrome.h:
864         * page/ChromeClient.h:
865         * platform/ColorChooser.h:
866         (WebCore::ColorChooser::~ColorChooser):
867         (WebCore::ColorChooser::setSelectedColor):
868         (WebCore::ColorChooser::endChooser):
869         * platform/ColorChooserClient.h: Added.
870
871 2011-12-17  Sam Weinig  <sam@webkit.org>
872
873         Make PlatformTouchEvent inherit from PlatformEvent
874         https://bugs.webkit.org/show_bug.cgi?id=74777
875
876         Reviewed by Andreas Kling.
877
878         * platform/PlatformEvent.h:
879         Add TouchEvent types.
880
881         * platform/PlatformTouchEvent.h:
882         (WebCore::PlatformTouchEvent::PlatformTouchEvent):
883         Make inherit from PlatformEvent.
884
885         * platform/blackberry/PlatformTouchEventBlackBerry.cpp:
886         (WebCore::touchEventType):
887         (WebCore::PlatformTouchEvent::PlatformTouchEvent):
888         * platform/efl/PlatformTouchEventEfl.cpp:
889         (WebCore::PlatformTouchEvent::PlatformTouchEvent):
890         * platform/qt/PlatformTouchEventQt.cpp:
891         (WebCore::PlatformTouchEvent::PlatformTouchEvent):
892         Make necessary changes to work with new base class.
893
894 2011-12-17  Andreas Kling  <kling@webkit.org>
895
896         Cache and reuse the HTMLAllCollection returned by document.all.
897         <http://webkit.org/b/74768>
898
899         Reviewed by Antti Koivisto.
900
901         Let Document cache the document.all collection, just like we do for
902         the other collections (.links, .images, etc.)
903         This is primarily a memory optimization, as repeated calls to
904         document.all will no longer cause collection objects to stack up.
905
906         Tests: fast/dom/document-collection-idempotence.html
907                fast/dom/gc-9.html
908
909         * dom/Document.h:
910         * dom/Document.cpp:
911         (WebCore::Document::all):
912
913             Cache the HTMLAllCollection and reuse it across calls instead of
914             creating a new one each time.
915
916         * html/HTMLAllCollection.h:
917         * html/HTMLAllCollection.cpp:
918         (WebCore::HTMLAllCollection::create):
919         (WebCore::HTMLAllCollection::HTMLAllCollection):
920
921             Make the HTMLAllCollection constructor take a Document* to enforce
922             the fact that it's the only way it should ever be created.
923
924         * html/HTMLAllCollection.idl:
925         * bindings/scripts/CodeGeneratorJS.pm:
926         (GenerateImplementation):
927
928             Custom reachability code for JSC, same as HTMLCollection.
929
930 2011-12-17  Andreas Kling  <kling@webkit.org>
931
932         HTMLCollection: Simplify itemAfter().
933         <http://webkit.org/b/74795>
934
935         Reviewed by Antti Koivisto.
936
937         Whether to do deep traversal of children depends on m_type which
938         doesn't change after construction, so move that decision there
939         by caching it in a "m_includeChildren" bit.
940
941         Also factored out the big switch statement in itemAfter() into
942         an isAcceptableElement() function.
943
944         Last and least, use fastHasAttribute() to check for itempropAttr
945         since it's not SVG animatable.
946
947         * html/HTMLCollection.cpp:
948         (WebCore::HTMLCollection::HTMLCollection):
949         (WebCore::HTMLCollection::shouldIncludeChildren):
950         (WebCore::HTMLCollection::isAcceptableElement):
951         (WebCore::HTMLCollection::itemAfter):
952         * html/HTMLCollection.h:
953
954 2011-12-17  Andreas Kling  <kling@webkit.org>
955
956         TagNodeList: Optimize nodeMatches() for the common case.
957         <http://webkit.org/b/74796>
958
959         Reviewed by Antti Koivisto.
960
961         Reject based on tag name mismatch before comparing the namespaces,
962         as this case is vastly more common.
963
964         nodeMatches() is very hot on the DOM Query (Dojo) test on Dromaeo.
965         This change takes it from 8.3% to 7.7% on my MBP.
966
967         * dom/TagNodeList.cpp:
968         (WebCore::TagNodeList::nodeMatches):
969
970 2011-12-17  Andreas Kling  <kling@webkit.org>
971
972         NameNodeList: Use fastGetAttribute() in nodeMatches().
973         <http://webkit.org/b/74797>
974
975         Reviewed by Darin Adler.
976
977         It's safe and slightly more efficient to use fastGetAttribute()
978         for HTMLNames::nameAttr here.
979
980         * dom/NameNodeList.cpp:
981         (WebCore::NameNodeList::nodeMatches):
982
983 2011-12-17  Andreas Kling  <kling@webkit.org>
984
985         CSSPrimitiveValue: Inline getIdent().
986         <http://webkit.org/b/74793>
987
988         Reviewed by Antti Koivisto.
989
990         Inline the trivial getIdent(), the same as its getFoo() siblings.
991
992         * css/CSSPrimitiveValue.cpp:
993         * css/CSSPrimitiveValue.h:
994         (WebCore::CSSPrimitiveValue::getIdent):
995
996 2011-12-17  Andreas Kling  <kling@webkit.org>
997
998         CSSStyleSelector: Clean up matchRules().
999         <http://webkit.org/b/74794>
1000
1001         Reviewed by Antti Koivisto.
1002
1003         - Early return from the isCollectingRulesOnly() path to reduce nesting.
1004         - Move the creation of m_ruleList out of the loop that builds the list.
1005         - Removed some comments from the Captain Obvious department.
1006
1007         * css/CSSStyleSelector.cpp:
1008         (WebCore::CSSStyleSelector::matchRules):
1009
1010 2011-12-17  Andreas Kling  <kling@webkit.org>
1011
1012         RuleSet: Remove style sheet null-check in addRulesFromSheet().
1013         <http://webkit.org/b/74792>
1014
1015         Reviewed by Antti Koivisto.
1016
1017         Replace the "sheet" null-check in addRulesFromSheet() by an assertion.
1018         The only call-site where it could be null was when adding rules from
1019         an @import'ed sheet, so add a check there instead.
1020
1021         * css/CSSStyleSelector.cpp:
1022         (WebCore::RuleSet::addRulesFromSheet):
1023
1024 2011-12-17  Andreas Kling  <kling@webkit.org>
1025
1026         CSSStyleSelector: Clean up getColorFromPrimitiveValue().
1027         <http://webkit.org/b/74789>
1028
1029         Reviewed by Antti Koivisto.
1030
1031         Rename getColorFromPrimitiveValue() to colorFromPrimitiveValue() and rework
1032         it to be a bit more readable.
1033
1034         * css/CSSGradientValue.cpp:
1035         (WebCore::CSSGradientValue::addStops):
1036         * css/CSSStyleApplyProperty.cpp:
1037         (WebCore::ApplyPropertyColor::applyValue):
1038         * css/CSSStyleSelector.cpp:
1039         (WebCore::CSSStyleSelector::applyProperty):
1040         (WebCore::CSSStyleSelector::colorFromPrimitiveValue):
1041         (WebCore::CSSStyleSelector::createFilterOperations):
1042         * css/CSSStyleSelector.h:
1043         * css/SVGCSSStyleSelector.cpp:
1044         (WebCore::CSSStyleSelector::applySVGProperty):
1045
1046 2011-12-17  Kenichi Ishibashi  <bashi@chromium.org>
1047
1048         Text dispappear when SVG font has no latin character
1049         https://bugs.webkit.org/show_bug.cgi?id=71765
1050
1051         Reviewed by Nikolas Zimmermann.
1052
1053         Initialize SVG font metrics even if the font doesn't contain latin characters.
1054
1055         Test: svg/custom/svg-fonts-no-latin-glyph.html
1056
1057         * svg/SVGFontData.cpp:
1058         (WebCore::SVGFontData::initializeFontData): Initializes metrics even if the zeroGlyphPage doesn't exist.
1059
1060 2011-12-17  David Barton  <dbarton@mathscribe.com>
1061
1062         Radical sign drawn incorrectly due to refactoring typo
1063         https://bugs.webkit.org/show_bug.cgi?id=74780
1064
1065         Reviewed by Dan Bernstein.
1066
1067         LayoutTests/mathml/presentation/roots.xhtml shows the bug, but apparently its .png
1068         checksum is ok so run-webkit-tests can't detect the problem.
1069
1070         * rendering/mathml/RenderMathMLRoot.cpp:
1071         (WebCore::RenderMathMLRoot::paint):
1072         In revision 88250, one paintOffset should have been adjustedPaintOffset.
1073
1074 2011-12-17  Adrienne Walker  <enne@google.com>
1075
1076         [chromium] Reverting r103011, r103135 due to Aura test failures
1077
1078         Unreviewed gardening.
1079
1080         * platform/graphics/chromium/ContentLayerChromium.cpp:
1081         (WebCore::ContentLayerChromium::~ContentLayerChromium):
1082         * platform/graphics/chromium/GraphicsLayerChromium.cpp:
1083         (WebCore::GraphicsLayerChromium::notifySyncRequired):
1084         * platform/graphics/chromium/GraphicsLayerChromium.h:
1085         * platform/graphics/chromium/ImageLayerChromium.cpp:
1086         (WebCore::ImageLayerChromium::paintContentsIfDirty):
1087         * platform/graphics/chromium/LayerChromium.cpp:
1088         (WebCore::LayerChromium::setLayerTreeHost):
1089         (WebCore::LayerChromium::setNeedsCommit):
1090         (WebCore::LayerChromium::setParent):
1091         (WebCore::LayerChromium::setMaskLayer):
1092         * platform/graphics/chromium/LayerChromium.h:
1093         (WebCore::LayerChromium::setReplicaLayer):
1094         * platform/graphics/chromium/TiledLayerChromium.cpp:
1095         (WebCore::TiledLayerChromium::setLayerTreeHost):
1096         * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
1097         (WebCore::CCLayerTreeHost::~CCLayerTreeHost):
1098         (WebCore::CCLayerTreeHost::didRecreateGraphicsContext):
1099         (WebCore::CCLayerTreeHost::paintMaskAndReplicaForRenderSurface):
1100         (WebCore::CCLayerTreeHost::paintLayerContents):
1101         * platform/graphics/chromium/cc/CCLayerTreeHost.h:
1102         (WebCore::CCLayerTreeHost::setRootLayer):
1103
1104 2011-12-16  Chris Marrin  <cmarrin@apple.com>
1105
1106         Hardware acceleration of W3C Filter Effects
1107         https://bugs.webkit.org/show_bug.cgi?id=68479
1108
1109         Reviewed by Simon Fraser.
1110
1111         Tests: css3/filters/effect-blur-hw.html
1112                css3/filters/effect-combined-hw.html
1113                css3/filters/effect-drop-shadow-hw.html
1114                css3/filters/effect-grayscale-hw.html
1115                css3/filters/effect-hue-rotate-hw.html
1116                css3/filters/effect-invert-hw.html
1117                css3/filters/effect-opacity-hw.html
1118                css3/filters/effect-saturate-hw.html
1119                css3/filters/effect-sepia-hw.html
1120
1121         Implement hardware acceleration of filters. If a filter is
1122         on a RenderLayer and that layer has a GraphicsLayer, a test
1123         is done to see if the desired filter can be rendered in hardware.
1124         If so, skip rendering it when painting, and add the filters to the
1125         CALayer. Currently Mac only, using CoreImage. Animation is done in
1126         software, with the filters being recreated every frame. There are
1127         some fidelity issues with the software renderer, but those will
1128         be dealt with as bugs to be fixed.
1129
1130         * platform/graphics/GraphicsLayer.h: Pass down FilterOperations
1131         (WebCore::GraphicsLayer::filter):
1132         (WebCore::GraphicsLayer::setFilter):
1133         * platform/graphics/ca/GraphicsLayerCA.cpp: Deferred passdown of FilterOperations to PlatformCALayer
1134         (WebCore::GraphicsLayerCA::setFilter):
1135         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
1136         (WebCore::GraphicsLayerCA::updateFilter):
1137         (WebCore::GraphicsLayerCA::ensureStructuralLayer):
1138         (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
1139         * platform/graphics/ca/GraphicsLayerCA.h:
1140         * platform/graphics/ca/PlatformCALayer.h:
1141         * platform/graphics/ca/mac/PlatformCALayerMac.mm: Mac implementation using CI
1142         (PlatformCALayer::setFilter):
1143         (PlatformCALayer::filterCanBeComposited): Static function to tell GraphicsLayer if this Filter object can be rendered
1144         * platform/graphics/filters/FilterOperations.cpp:
1145         (WebCore::FilterOperations::operator=):
1146         * platform/graphics/filters/FilterOperations.h:
1147         (WebCore::FilterOperations::FilterOperations):
1148         * rendering/RenderLayer.cpp: Pass filter object to GraphicsLayer
1149         (WebCore::RenderLayer::rendersFilter):
1150         (WebCore::RenderLayer::paintLayer):
1151         (WebCore::RenderLayer::updateOrRemoveFilterEffect):
1152         * rendering/RenderLayer.h:
1153         * rendering/RenderLayerBacking.cpp:
1154         (WebCore::RenderLayerBacking::RenderLayerBacking):
1155         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
1156         (WebCore::RenderLayerBacking::updateLayerFilter):
1157         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
1158         * rendering/RenderLayerBacking.h:
1159         (WebCore::RenderLayerBacking::canCompositeFilter):
1160
1161 2011-12-17  Philippe Normand  <pnormand@igalia.com>
1162
1163         Unreviewed, GTK build fix after r103131.
1164
1165         * GNUmakefile.list.am: Fix typo... s/.cop/.cpp
1166
1167 2011-12-16  Benjamin Poulain  <bpoulain@apple.com>
1168
1169         FEComposite does not build when you disable filters on ARMv7
1170         https://bugs.webkit.org/show_bug.cgi?id=74772
1171
1172         Reviewed by David Kilzer.
1173
1174         Add the missing ENABLE(FILTERS).
1175
1176         * platform/graphics/filters/arm/FECompositeArithmeticNEON.cpp:
1177         * platform/graphics/filters/arm/FECompositeArithmeticNEON.h:
1178
1179 2011-12-16  Ryosuke Niwa  <rniwa@webkit.org>
1180
1181         Mac build fix after r103104.
1182
1183         * WebCore.xcodeproj/project.pbxproj:
1184
1185 2011-12-16  Adam Klein  <adamk@chromium.org>
1186
1187         Consolidate before-advice regarding attribute modification into a single method
1188         https://bugs.webkit.org/show_bug.cgi?id=74752
1189
1190         Reviewed by Ryosuke Niwa.
1191
1192         Adds a willModifyAttribute method to Element, meant to be called
1193         before an attribute on that Element is added/removed/changed.
1194
1195         Replace most calls to Element::updateId and all calls to
1196         Element::enqueueAttributesMutationRecordIfRequested with calls to
1197         willModifyAttribute. Moreover, enqueueAttributesMutation... can now
1198         be private since its only caller is willModifyAttribute.
1199
1200         The only remaining direct calls to updateId are in cases the entire
1201         NamedNodeMap is being replaced. These are implementation details of
1202         WebCore that shouldn't be exposed via MutationObservers.
1203
1204         No new tests, no expected change in behavior.
1205
1206         * dom/Attr.cpp:
1207         (WebCore::Attr::setValue):
1208         (WebCore::Attr::childrenChanged): Besides the above change, use a
1209         StringBuilder to build up value, and only do String -> AtomicString
1210         conversion once.
1211         * dom/Element.cpp:
1212         (WebCore::Element::setAttributeInternal):
1213         * dom/Element.h:
1214         (WebCore::Element::willModifyAttribute):
1215         * dom/NamedNodeMap.cpp:
1216         (WebCore::NamedNodeMap::setNamedItem):
1217         (WebCore::NamedNodeMap::removeNamedItem):
1218
1219 2011-12-16  James Robinson  <jamesr@chromium.org>
1220
1221         [chromium] CCLayerDelegate and WebLayerClient do not need notifySyncRequired
1222         https://bugs.webkit.org/show_bug.cgi?id=74376
1223
1224         Reviewed by Kenneth Russell.
1225
1226         CCLayerDelegate::notifySyncRequired is an odd bit of interface that we originally cargo-culted from the
1227         CoreAnimation compositor implementation. It is a mechanism by which a LayerChromium instance may request a new
1228         frame via its CCLayerDelegate, which in WebCore is always a GraphicsLayerClient. In practice, all
1229         implementations eventually ended up routing to CCLayerTreeHost::setNeedsCommit which then made the proper
1230         scheduling decision.
1231
1232         This patch routes all changes that would have gone through CCLayerDelegate::notifySyncRequired directly to
1233         CCLayerTreeHost::setNeedsCommit, which greatly simplifies the scheduling logic.
1234
1235         There is a large amount of unit test coverage for this change, largely in LayerChromiumTest
1236
1237         * platform/graphics/chromium/GraphicsLayerChromium.cpp:
1238         * platform/graphics/chromium/GraphicsLayerChromium.h:
1239         * platform/graphics/chromium/LayerChromium.cpp:
1240         (WebCore::LayerChromium::setNeedsCommit):
1241         (WebCore::LayerChromium::insertChild):
1242         * platform/graphics/chromium/LayerChromium.h:
1243         * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
1244         (WebCore::CCLayerTreeHost::~CCLayerTreeHost):
1245         (WebCore::CCLayerTreeHost::setRootLayer):
1246         * platform/graphics/chromium/cc/CCLayerTreeHost.h:
1247         * platform/graphics/chromium/cc/CCScopedThreadProxy.h:
1248         (WebCore::CCScopedThreadProxy::runTaskIfNotShutdown):
1249
1250 2011-12-16  Adam Klein  <adamk@chromium.org>
1251
1252         Fix typo in MarkupTokenBase: rename takeAtributes to takeAttributes
1253         https://bugs.webkit.org/show_bug.cgi?id=74766
1254
1255         Reviewed by Darin Adler.
1256
1257         * html/parser/HTMLConstructionSite.cpp:
1258         (WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML):
1259         (WebCore::HTMLConstructionSite::insertScriptElement):
1260         (WebCore::HTMLConstructionSite::createElement):
1261         (WebCore::HTMLConstructionSite::createHTMLElement):
1262         * html/parser/HTMLTreeBuilder.cpp:
1263         (WebCore::HTMLTreeBuilder::attributesForIsindexInput):
1264         * xml/parser/MarkupTokenBase.h:
1265         (WebCore::AtomicMarkupTokenBase::takeAttributes):
1266
1267 2011-12-16  Adam Barth  <abarth@webkit.org>
1268
1269         <option><span><option> doesn't parse correctly
1270         https://bugs.webkit.org/show_bug.cgi?id=74760
1271
1272         Reviewed by Eric Seidel.
1273
1274         The <option> start tag shouldn't be quite as aggressive in closing open
1275         <option> tags.  I'm not sure whether this was a change in the spec or a
1276         mistranscription, but this patch causes us to match the spec.  I've
1277         checked the other optionTag checks, and they all seem to be correct.
1278
1279         * html/parser/HTMLTreeBuilder.cpp:
1280
1281 2011-12-16  Rafael Weinstein  <rafaelw@chromium.org>
1282
1283         [MutationObservers] Remove platform-dependent code in Document.cpp resulting from Mutation Event histogram collection
1284         https://bugs.webkit.org/show_bug.cgi?id=73026
1285
1286         Reviewed by Ryosuke Niwa.
1287
1288         This patch adds platform/HistogramSupport which has an empty implementation for all ports
1289         except Chromium.
1290
1291         No tests need. This patch is just a refactor.
1292
1293         * GNUmakefile.list.am:
1294         * Target.pri:
1295         * WebCore.gypi:
1296         * WebCore.xcodeproj/project.pbxproj:
1297         * dom/Document.cpp:
1298         (WebCore::histogramMutationEventUsage):
1299         (WebCore::Document::~Document):
1300         * platform/HistogramSupport.h: Added.
1301         (WebCore::HistogramSupport::histogramEnumeration):
1302         * platform/chromium/HistogramSupportChromium.cpp: Added.
1303         (WebCore::HistogramSupport::histogramEnumeration):
1304
1305 2011-12-16  Brady Eidson  <beidson@apple.com>
1306
1307         <rdar://problem/10576732> and https://bugs.webkit.org/show_bug.cgi?id=74533
1308         REGRESSION(r102619): Reproducible crash closing window with video + poster image inside an object element
1309
1310         Reviewed by Darin Adler.
1311
1312         Test: media/crash-closing-page-with-media-as-plugin-fallback.html
1313
1314         At some point documentWillBecomeInactive() was overloaded to not only notify elements they were going in to the page
1315         cache but also do some other work that was necessary during Document teardown.
1316
1317         This crash occurs because we're notifying elements they're going in to the page cache at document teardown, so this
1318         patch breaks that work back out in to a separate function.
1319
1320         * dom/Document.cpp:
1321         (WebCore::Document::detach): Remove obsolete comment.
1322         (WebCore::Document::documentWillBecomeInactive): Handle only accelerated compositing cleanup.
1323         (WebCore::Document::documentWillSuspendForPageCache): Call documentWillBecomeInactive before notifying elements of suspension.
1324         (WebCore::Document::documentDidResumeFromPageCache):
1325         (WebCore::Document::registerForPageCacheSuspensionCallbacks):
1326         (WebCore::Document::unregisterForPageCacheSuspensionCallbacks):
1327         * dom/Document.h:
1328
1329         * history/CachedFrame.cpp:
1330         (WebCore::CachedFrameBase::restore): Call the renamed documentDidResumeFromPageCache.
1331         (WebCore::CachedFrame::CachedFrame): Call documentWillSuspendForPageCache instead of documentDidBecomeInactive.
1332
1333         * loader/FrameLoader.cpp:
1334         (WebCore::FrameLoader::commitProvisionalLoad): Call the renamed documentDidResumeFromPageCache.
1335
1336         * dom/Element.h:
1337         (WebCore::Element::documentWillSuspendForPageCache): Renamed from documentWillBecomeInactive()
1338         (WebCore::Element::documentDidResumeFromPageCache): Renamed from documentDidBecomeActive()
1339
1340         Change to the renamed registration and callbacks functions in the handful of classes that use them:
1341         * html/HTMLFormElement.cpp:
1342         (WebCore::HTMLFormElement::~HTMLFormElement):
1343         (WebCore::HTMLFormElement::parseMappedAttribute):
1344         (WebCore::HTMLFormElement::documentDidResumeFromPageCache):
1345         (WebCore::HTMLFormElement::willMoveToNewOwnerDocument):
1346         (WebCore::HTMLFormElement::didMoveToNewOwnerDocument):
1347         * html/HTMLFormElement.h:
1348
1349         * html/HTMLInputElement.cpp:
1350         (WebCore::HTMLInputElement::~HTMLInputElement):
1351         (WebCore::HTMLInputElement::updateType):
1352         (WebCore::HTMLInputElement::parseMappedAttribute):
1353         (WebCore::HTMLInputElement::needsSuspensionCallback):
1354         (WebCore::HTMLInputElement::registerForSuspensionCallbackIfNeeded):
1355         (WebCore::HTMLInputElement::unregisterForSuspensionCallbackIfNeeded):
1356         (WebCore::HTMLInputElement::documentDidResumeFromPageCache):
1357         (WebCore::HTMLInputElement::willMoveToNewOwnerDocument):
1358         (WebCore::HTMLInputElement::didMoveToNewOwnerDocument):
1359         * html/HTMLInputElement.h:
1360
1361         * html/HTMLPlugInImageElement.cpp:
1362         (WebCore::HTMLPlugInImageElement::~HTMLPlugInImageElement):
1363         (WebCore::HTMLPlugInImageElement::createRenderer):
1364         (WebCore::HTMLPlugInImageElement::willMoveToNewOwnerDocument):
1365         (WebCore::HTMLPlugInImageElement::didMoveToNewOwnerDocument):
1366         (WebCore::HTMLPlugInImageElement::documentWillSuspendForPageCache):
1367         (WebCore::HTMLPlugInImageElement::documentDidResumeFromPageCache):
1368         * html/HTMLPlugInImageElement.h:
1369
1370         * svg/SVGSVGElement.cpp:
1371         (WebCore::SVGSVGElement::SVGSVGElement):
1372         (WebCore::SVGSVGElement::~SVGSVGElement):
1373         (WebCore::SVGSVGElement::willMoveToNewOwnerDocument):
1374         (WebCore::SVGSVGElement::didMoveToNewOwnerDocument):
1375         (WebCore::SVGSVGElement::documentWillSuspendForPageCache):
1376         (WebCore::SVGSVGElement::documentDidResumeFromPageCache):
1377         * svg/SVGSVGElement.h:
1378
1379 2011-12-16  Eric Penner  <epenner@google.com>
1380
1381         [chromium] Need to prepaint tiles in TiledLayerChromium
1382         https://bugs.webkit.org/show_bug.cgi?id=72686
1383
1384         Reviewed by James Robinson.
1385
1386         Tests: TiledLayerChromiumTest (idlePaintOutOfMemory, pushIdlePaintTiles)
1387
1388         * platform/graphics/chromium/ContentLayerChromium.cpp:
1389         (WebCore::ContentLayerChromium::idlePaintContentsIfDirty): added idle paint function
1390         * platform/graphics/chromium/ContentLayerChromium.h: ditto
1391         * platform/graphics/chromium/LayerChromium.h: ditto
1392         (WebCore::LayerChromium::idlePaintContentsIfDirty): ditto
1393         * platform/graphics/chromium/TextureManager.cpp:
1394         (WebCore::TextureManager::protectTexture): removed assert for protecting a texture twice
1395         * platform/graphics/chromium/TiledLayerChromium.cpp:
1396         (WebCore::TiledLayerChromium::TiledLayerChromium):
1397         (WebCore::TiledLayerChromium::cleanupResources):
1398         (WebCore::TiledLayerChromium::updateCompositorResources): refactoring to use tile indices
1399         (WebCore::TiledLayerChromium::prepareToUpdateTiles): refactored common code and made idle/visible versions
1400         (WebCore::TiledLayerChromium::prepareToUpdate): ditto
1401         (WebCore::TiledLayerChromium::prepareToUpdateIdle): ditto
1402         (WebCore::TiledLayerChromium::needsIdlePaint): 
1403         (WebCore::TiledLayerChromium::idlePaintRect):
1404         * platform/graphics/chromium/TiledLayerChromium.h:
1405         * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
1406         (WebCore::CCLayerTreeHost::CCLayerTreeHost):
1407         (WebCore::CCLayerTreeHost::compositeAndReadback): set flag to avoid idle paint durring composite and readback
1408         (WebCore::CCLayerTreeHost::updateLayers): added idle flag parameter
1409         (WebCore::CCLayerTreeHost::paintContentsIfDirty): ditto
1410         (WebCore::CCLayerTreeHost::paintMaskAndReplicaForRenderSurface): ditto
1411         (WebCore::CCLayerTreeHost::paintLayerContents): chooses idle or visible paint
1412         * platform/graphics/chromium/cc/CCLayerTreeHost.h:
1413
1414 2011-12-16  Dean Jackson  <dino@apple.com>
1415
1416         Miscellaneous Filter updates to align with spec
1417         https://bugs.webkit.org/show_bug.cgi?id=74736
1418
1419         Reviewed by Simon Fraser.
1420
1421         Combine a bunch of small updates to filters where
1422         we were not compliant with the specification.
1423
1424         - blur() only takes one value, not two
1425         - blur() does not accept percentages. This allowed us
1426           to stop passing the borderBoxSize around while building
1427           the filter chain or calculating visual overflow.
1428         - gamma() and sharpen() removed
1429         - brightness() and contrast() added
1430
1431         Tests: css3/filters/effect-brightness.html
1432                css3/filters/effect-contrast.html
1433
1434         * css/CSSComputedStyleDeclaration.cpp:
1435         (WebCore::CSSComputedStyleDeclaration::valueForFilter): Create new
1436         variations on component transfer functions for brightness() and
1437         contrast() effects. Also remove sharpen() and gamma().
1438         * css/CSSParser.cpp:
1439         (WebCore::filterInfoForName):
1440         (WebCore::CSSParser::parseBuiltinFilterArguments): Ditto, and blur
1441         only takes one argument.
1442         * css/CSSStyleSelector.cpp:
1443         (WebCore::filterOperationForType):
1444         (WebCore::CSSStyleSelector::createFilterOperations): Ditto, and
1445         use ->isPercentage() to test rather than getting the type.
1446         * css/WebKitCSSFilterValue.cpp:
1447         (WebCore::WebKitCSSFilterValue::customCssText):
1448         * css/WebKitCSSFilterValue.h:
1449         * css/WebKitCSSFilterValue.idl: Remove sharpen and gamma, add
1450         brightness and contrast.
1451         * platform/graphics/filters/FilterOperation.cpp:
1452         (WebCore::BlurFilterOperation::blend): Blurs only need to blend
1453         between one standard deviation parameter.
1454         * platform/graphics/filters/FilterOperation.h: Remove sharpen and
1455         gamma, add brightness and contrast.
1456         (WebCore::BlurFilterOperation::create):
1457         (WebCore::BlurFilterOperation::stdDeviation):
1458         (WebCore::BlurFilterOperation::operator==):
1459         (WebCore::BlurFilterOperation::BlurFilterOperation): Blur only takes
1460         one standard deviation / radius parameter.
1461         * platform/graphics/filters/FilterOperations.cpp:
1462         (WebCore::outsetSizeForBlur):
1463         (WebCore::FilterOperations::getOutsets): No need for borderBox now.
1464         * platform/graphics/filters/FilterOperations.h:
1465         * rendering/FilterEffectRenderer.cpp:
1466         (WebCore::FilterEffectRenderer::build): Build new effect types.
1467         * rendering/FilterEffectRenderer.h:
1468         * rendering/RenderBox.cpp:
1469         (WebCore::RenderBox::addVisualEffectOverflow): No need to pass
1470         borderBox size when calculating overflow on filter.
1471         * rendering/RenderLayer.cpp:
1472         (WebCore::RenderLayer::updateOrRemoveFilterEffect):
1473         * rendering/style/RenderStyle.h:
1474         (WebCore::InheritedFlags::getFilterOutsets): Ditto.
1475
1476 2011-12-16  Andreas Kling  <kling@webkit.org>
1477
1478         Unreviewed debug build fix after r103115.
1479
1480         * dom/Document.cpp:
1481         (WebCore::Document::cachedCollection):
1482
1483 2011-12-16  Mark Hahnenberg  <mhahnenberg@apple.com>
1484
1485         Windows test fix
1486
1487         No new tests.
1488
1489         Unreviewed test fix. All Windows tests were crashing when objects who were pointing to 
1490         static data members across DLL boundaries were getting garbage in their pointers.
1491
1492         * WebCore.exp.in:
1493         * bindings/js/JSDOMWrapper.cpp:
1494         * bindings/js/JSDOMWrapper.h:
1495
1496 2011-12-16  Ryosuke Niwa  <rniwa@webkit.org>
1497
1498         Rename registerCommandFor(Undo|Redo) to register(Undo|Redo)Step
1499         https://bugs.webkit.org/show_bug.cgi?id=74748
1500
1501         Reviewed by Eric Seidel.
1502
1503         Renamed registerCommandForUndo and registerCommandForRedo to
1504         registerUndoStep and registerRedoStep respectively.
1505
1506         * editing/Editor.cpp:
1507         (WebCore::Editor::appliedEditing):
1508         (WebCore::Editor::unappliedEditing):
1509         (WebCore::Editor::reappliedEditing):
1510         * loader/EmptyClients.h:
1511         (WebCore::EmptyEditorClient::registerUndoStep):
1512         (WebCore::EmptyEditorClient::registerRedoStep):
1513         * page/EditorClient.h:
1514
1515 2011-12-16  Tim Horton  <timothy_horton@apple.com>
1516
1517         Canvas should respect backing store scale ratio when used as drawImage() source
1518         https://bugs.webkit.org/show_bug.cgi?id=74758
1519         <rdar://problem/10350194>
1520
1521         Reviewed by Simon Fraser.
1522
1523         Interpret the source rectangle passed into drawImage() when using a Canvas source in the source Canvas coordinate space,
1524         instead of in the backing store coordinate space, without changing the behavior of drawImage(canvas, x, y).
1525
1526         No new tests.
1527
1528         * html/HTMLCanvasElement.cpp:
1529         (WebCore::HTMLCanvasElement::convertDeviceToLogical):
1530         * html/HTMLCanvasElement.h:
1531         * html/canvas/CanvasRenderingContext2D.cpp:
1532         (WebCore::CanvasRenderingContext2D::drawImage):
1533
1534 2011-12-16  Anders Carlsson  <andersca@apple.com>
1535
1536         Subpixel antialiasing not working in tiled mode
1537         https://bugs.webkit.org/show_bug.cgi?id=74759
1538
1539         Reviewed by Simon Fraser.
1540
1541         Call setContentsOpaque(true) on the main frame render view layer so subpixel aa will be used
1542         when drawing text into that layer.
1543
1544         * rendering/RenderLayerBacking.cpp:
1545         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
1546
1547 2011-12-16  Ryosuke Niwa  <rniwa@webkit.org>
1548
1549         invalidateNodeListsCacheAfterAttributeChanged has too many callers
1550         https://bugs.webkit.org/show_bug.cgi?id=74692
1551
1552         Reviewed by Sam Weinig.
1553
1554         Call invalidateNodeListsCacheAfterAttributeChanged in Element::updateAfterAttributeChanged instead of
1555         parsedMappedAttribute of various elements. Also make invalidateNodeListsCacheAfterAttributeChanged take
1556         the qualified name of the changed attribute so that we can exit early when the changed attribute isn't
1557         one of attributes we care.
1558
1559         In addition, added a missing call to invalidateNodeListsCacheAfterAttributeChanged in Attr::setValue.
1560
1561         Test: fast/dom/Attr/invalidate-nodelist-after-attr-setvalue.html
1562
1563         * dom/Attr.cpp:
1564         (WebCore::Attr::childrenChanged):
1565         * dom/Element.cpp:
1566         (WebCore::Element::updateAfterAttributeChanged):
1567         * dom/NamedNodeMap.cpp:
1568         (WebCore::NamedNodeMap::addAttribute):
1569         (WebCore::NamedNodeMap::removeAttribute):
1570         * dom/Node.cpp:
1571         (WebCore::Node::invalidateNodeListsCacheAfterAttributeChanged):
1572         * dom/Node.h:
1573         * dom/StyledElement.cpp:
1574         (WebCore::StyledElement::classAttributeChanged):
1575         * html/HTMLAnchorElement.cpp:
1576         (WebCore::HTMLAnchorElement::parseMappedAttribute):
1577         * html/HTMLAppletElement.cpp:
1578         (WebCore::HTMLAppletElement::parseMappedAttribute):
1579         * html/HTMLElement.cpp:
1580         (WebCore::HTMLElement::parseMappedAttribute):
1581         * html/HTMLEmbedElement.cpp:
1582         (WebCore::HTMLEmbedElement::parseMappedAttribute):
1583         * html/HTMLFormElement.cpp:
1584         (WebCore::HTMLFormElement::parseMappedAttribute):
1585         * html/HTMLFrameElementBase.cpp:
1586         (WebCore::HTMLFrameElementBase::parseMappedAttribute):
1587         * html/HTMLIFrameElement.cpp:
1588         (WebCore::HTMLIFrameElement::parseMappedAttribute):
1589         * html/HTMLImageElement.cpp:
1590         (WebCore::HTMLImageElement::parseMappedAttribute):
1591         * html/HTMLMapElement.cpp:
1592         (WebCore::HTMLMapElement::parseMappedAttribute):
1593         * html/HTMLMetaElement.cpp:
1594         (WebCore::HTMLMetaElement::parseMappedAttribute):
1595         * html/HTMLObjectElement.cpp:
1596         (WebCore::HTMLObjectElement::parseMappedAttribute):
1597         * html/HTMLParamElement.cpp:
1598         (WebCore::HTMLParamElement::parseMappedAttribute):
1599
1600 2011-12-16  Andreas Kling  <kling@webkit.org>
1601
1602         Cache and reuse HTMLCollections exposed by Document.
1603         <http://webkit.org/b/71956>
1604
1605         Reviewed by Antti Koivisto.
1606
1607         Let Document cache the various HTMLCollection objects it exposes.
1608         This is a behavior change in two ways:
1609
1610         1) The lifetime of returned collections is now tied to the lifetime
1611            of the Document. This matches the behavior of Firefox and Opera.
1612
1613         2) The cached collections returned by document are now exactly equal
1614            to those returned by subsequent calls to the same getters.
1615
1616         This reduces memory consumption by ~800 kB (on 64-bit) when loading
1617         the full HTML5 spec. document.links was called 34001 times, yielding
1618         34001 separate HTMLCollections, and now we only need 1.
1619
1620         The document.all collection retains the old behavior, as caching it
1621         will be a bit more complicated.
1622
1623         To avoid a reference cycle between Document and HTMLCollection,
1624         collections that are cached on Document do not retained their base
1625         node pointer (controlled by a m_baseIsRetained flag.)
1626
1627         Tests: fast/dom/document-collection-idempotence.html
1628                fast/dom/gc-9.html
1629
1630         * dom/Document.cpp:
1631         (WebCore::Document::detach):
1632         (WebCore::Document::cachedCollection):
1633         (WebCore::Document::images):
1634         (WebCore::Document::applets):
1635         (WebCore::Document::embeds):
1636         (WebCore::Document::plugins):
1637         (WebCore::Document::objects):
1638         (WebCore::Document::scripts):
1639         (WebCore::Document::links):
1640         (WebCore::Document::forms):
1641         (WebCore::Document::anchors):
1642         * dom/Document.h:
1643         * html/HTMLCollection.cpp:
1644         (WebCore::HTMLCollection::HTMLCollection):
1645         (WebCore::HTMLCollection::createForCachingOnDocument):
1646         (WebCore::HTMLCollection::~HTMLCollection):
1647         (WebCore::HTMLCollection::itemAfter):
1648         * html/HTMLCollection.h:
1649         (WebCore::HTMLCollection::base):
1650
1651 2011-12-16  Anders Carlsson  <andersca@apple.com>
1652
1653         Add a pretty dumb tile cache to WebTileCacheLayer
1654         https://bugs.webkit.org/show_bug.cgi?id=74753
1655
1656         Reviewed by Simon Fraser.
1657
1658         * WebCore.xcodeproj/project.pbxproj:
1659         * platform/graphics/ca/GraphicsLayerCA.cpp:
1660         (WebCore::GraphicsLayerCA::requiresTiledLayer):
1661         If a layer is a tile cache layer, we never want to swap it out for a tiled layer.
1662
1663         (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
1664         Assert that we don't have a tile cache layer.
1665
1666         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
1667         (PlatformCALayer::PlatformCALayer):
1668         If we have a tile cache layer, add its tile container to the list of custom sublayers.
1669
1670         * platform/graphics/ca/mac/TileCache.h: Added.
1671         (WebCore::TileCache::tileContainerLayer):
1672         Return the tile container layer.
1673
1674         * platform/graphics/ca/mac/TileCache.mm: Added.
1675         (WebCore::TileCache::tileCacheLayerBoundsChanged):
1676         Resize the tile grid if necessary.
1677
1678         (WebCore::TileCache::setNeedsDisplayInRect):
1679         Invalidate the necessary tiles.
1680
1681         (WebCore::TileCache::drawLayer):
1682         Set up the transform and draw the layer.
1683
1684         (WebCore::TileCache::getTileRangeForRect):
1685         Given a rect, return the range of tiles that it covers.
1686
1687         (WebCore::TileCache::numTilesForGridSize):
1688         Given a size, return how many tiles are needed to completely cover it.
1689
1690         (WebCore::TileCache::resizeTileGrid):
1691         Create new tile layers if needed, or reuse already existing ones.
1692
1693         (WebCore::TileCache::tileLayerAtPosition):
1694         Given a position in the grid, return the tile layer.
1695
1696         (WebCore::TileCache::createTileLayer):
1697         Create a WebTileLayer and set it up.
1698
1699         * platform/graphics/ca/mac/WebTileCacheLayer.h:
1700         * platform/graphics/ca/mac/WebTileCacheLayer.mm:
1701         (-[WebTileCacheLayer setBounds:]):
1702         (-[WebTileCacheLayer setNeedsDisplayInRect:]):
1703         (-[WebTileCacheLayer tileContainerLayer]):
1704         Call down to the tile cache object.
1705
1706         * platform/graphics/ca/mac/WebTileLayer.h: Added.
1707         * platform/graphics/ca/mac/WebTileLayer.mm: Added.
1708
1709         (-[WebTileLayer drawInContext:]):
1710         Ask the tile cache to draw the given layer.
1711
1712         (-[WebTileLayer setTileCache:WebCore::]):
1713
1714 2011-12-16  Sam Weinig  <sam@webkit.org>
1715
1716         Give PlatformEvents a base class
1717         https://bugs.webkit.org/show_bug.cgi?id=74685
1718
1719         Reviewed by Anders Carlsson.
1720
1721         Add a base class for PlatformMouseEvent, PlatformKeyboardEvent, PlatformWheelEvent
1722         and PlatformGestureEvent and move Type enumeration and modifiers down to it.
1723
1724         * CMakeLists.txt:
1725         * GNUmakefile.list.am:
1726         * Target.pri:
1727         * WebCore.exp.in:
1728         * WebCore.gypi:
1729         * WebCore.vcproj/WebCore.vcproj:
1730         * WebCore.xcodeproj/project.pbxproj:
1731         Add new files.
1732
1733         * platform/PlatformEvent.cpp: Added.
1734         * platform/PlatformEvent.h: Added.
1735         (WebCore::PlatformEvent::type):
1736         (WebCore::PlatformEvent::shiftKey):
1737         (WebCore::PlatformEvent::ctrlKey):
1738         (WebCore::PlatformEvent::altKey):
1739         (WebCore::PlatformEvent::metaKey):
1740         (WebCore::PlatformEvent::modifiers):
1741         (WebCore::PlatformEvent::PlatformEvent):
1742         Add new class.
1743
1744         * accessibility/mac/WebAccessibilityObjectWrapper.mm:
1745         (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
1746         * dom/KeyboardEvent.cpp:
1747         (WebCore::eventTypeForKeyboardEventType):
1748         * dom/MouseEvent.cpp:
1749         (WebCore::MouseEvent::create):
1750         * page/DragController.cpp:
1751         (WebCore::createMouseEvent):
1752         * page/EventHandler.cpp:
1753         (WebCore::EventHandler::handleGestureEvent):
1754         (WebCore::EventHandler::sendContextMenuEventForKey):
1755         (WebCore::EventHandler::fakeMouseMoveEventTimerFired):
1756         (WebCore::EventHandler::handleAccessKey):
1757         (WebCore::EventHandler::keyEvent):
1758         (WebCore::EventHandler::handleDrag):
1759         * page/blackberry/EventHandlerBlackBerry.cpp:
1760         (WebCore::EventHandler::accessKeyModifiers):
1761         * page/chromium/EventHandlerChromium.cpp:
1762         (WebCore::EventHandler::accessKeyModifiers):
1763         * page/efl/EventHandlerEfl.cpp:
1764         (WebCore::EventHandler::accessKeyModifiers):
1765         * page/gtk/EventHandlerGtk.cpp:
1766         (WebCore::EventHandler::accessKeyModifiers):
1767         * page/mac/EventHandlerMac.mm:
1768         (WebCore::EventHandler::accessKeyModifiers):
1769         * page/qt/EventHandlerQt.cpp:
1770         (WebCore::EventHandler::accessKeyModifiers):
1771         * page/win/EventHandlerWin.cpp:
1772         (WebCore::EventHandler::accessKeyModifiers):
1773         * page/wx/EventHandlerWx.cpp:
1774         (WebCore::EventHandler::accessKeyModifiers):
1775         * platform/PlatformGestureEvent.h:
1776         (WebCore::PlatformGestureEvent::PlatformGestureEvent):
1777         * platform/PlatformKeyboardEvent.h:
1778         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1779         (WebCore::PlatformKeyboardEvent::isKeypad):
1780         * platform/PlatformMouseEvent.h:
1781         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
1782         (WebCore::PlatformMouseEvent::button):
1783         * platform/PlatformWheelEvent.h:
1784         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
1785         * platform/ScrollAnimatorNone.cpp:
1786         (WebCore::ScrollAnimatorNone::zoom):
1787         (WebCore::ScrollAnimatorNone::handleGestureEvent):
1788         * platform/blackberry/PlatformKeyboardEventBlackBerry.cpp:
1789         (WebCore::toWebCorePlatformKeyboardEventType):
1790         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1791         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
1792         * platform/chromium/GestureRecognizerChromium.cpp:
1793         (WebCore::GestureRecognizerChromium::appendTapDownGestureEvent):
1794         (WebCore::GestureRecognizerChromium::appendClickGestureEvent):
1795         (WebCore::GestureRecognizerChromium::appendDoubleClickGestureEvent):
1796         (WebCore::GestureRecognizerChromium::appendScrollGestureBegin):
1797         (WebCore::GestureRecognizerChromium::appendScrollGestureEnd):
1798         (WebCore::GestureRecognizerChromium::appendScrollGestureUpdate):
1799         * platform/chromium/PlatformKeyboardEventChromium.cpp:
1800         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
1801         * platform/chromium/PopupContainer.cpp:
1802         (WebCore::PopupContainer::handleGestureEvent):
1803         * platform/chromium/PopupListBox.cpp:
1804         (WebCore::isCharacterTypeEvent):
1805         (WebCore::PopupListBox::handleKeyEvent):
1806         * platform/chromium/ScrollAnimatorChromiumMac.mm:
1807         (WebCore::ScrollAnimatorChromiumMac::handleGestureEvent):
1808         * platform/efl/PlatformKeyboardEventEfl.cpp:
1809         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1810         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
1811         * platform/efl/PlatformMouseEventEfl.cpp:
1812         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
1813         * platform/efl/PlatformWheelEventEfl.cpp:
1814         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
1815         * platform/gtk/PlatformKeyboardEventGtk.cpp:
1816         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1817         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
1818         * platform/gtk/PlatformMouseEventGtk.cpp:
1819         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
1820         * platform/gtk/PlatformWheelEventGtk.cpp:
1821         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
1822         * platform/ios/KeyEventIOS.mm:
1823         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1824         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
1825         * platform/mac/KeyEventMac.mm:
1826         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1827         * platform/mac/PlatformMouseEventMac.mm:
1828         (WebCore::mouseEventForNSEvent):
1829         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
1830         * platform/mac/ScrollAnimatorMac.mm:
1831         (WebCore::ScrollAnimatorMac::handleGestureEvent):
1832         * platform/mac/WheelEventMac.mm:
1833         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
1834         * platform/qt/PlatformKeyboardEventQt.cpp:
1835         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1836         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
1837         * platform/qt/PlatformMouseEventQt.cpp:
1838         (WebCore::mouseEventTypeAndMouseButtonFromQEvent):
1839         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
1840         * platform/qt/WheelEventQt.cpp:
1841         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
1842         * platform/win/KeyEventWin.cpp:
1843         (WebCore::isKeypadEvent):
1844         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1845         * platform/win/PlatformMouseEventWin.cpp:
1846         (WebCore::messageToEventType):
1847         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
1848         * platform/win/WheelEventWin.cpp:
1849         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
1850         * platform/wx/KeyboardEventWx.cpp:
1851         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1852         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
1853         * platform/wx/MouseEventWx.cpp:
1854         (WebCore::typeFromMouseEvent):
1855         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
1856         * platform/wx/MouseWheelEventWx.cpp:
1857         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
1858         * plugins/mac/PluginViewMac.mm:
1859         (WebCore::PluginView::handleKeyboardEvent):
1860         * testing/Internals.cpp:
1861         (WebCore::Internals::setZoomAnimatorTransform):
1862         Switch to using new names/class modifier as necessary.
1863
1864 2011-12-16  Adam Barth  <abarth@webkit.org>
1865
1866         <!doctype html><div><body><frameset> doesn't parse correctly
1867         https://bugs.webkit.org/show_bug.cgi?id=74745
1868
1869         Reviewed by Eric Seidel.
1870
1871         We were missing one place the spec tells us to set this bool.
1872
1873         Tests: html5lib/runner.html
1874
1875         * html/parser/HTMLTreeBuilder.cpp:
1876
1877 2011-12-16  Jarred Nicholls  <jarred@sencha.com>
1878
1879         Support HTML documents in XHR.responseXML
1880         https://bugs.webkit.org/show_bug.cgi?id=74626
1881
1882         Latest W3C XHR spec details for the responseXML attribute:
1883         http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#the-responsexml-attribute
1884         http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#document-response-entity-body
1885
1886         XHR.responseXML was not compliant per the latest editor's draft of the XHR spec.
1887         The following compliance issue have been corrected:
1888           - A responseType of "text" should disallow access to responseXML by throwing an InvalidState exception.
1889           - When the error flag is toggled, responseXML should return "null" immediately and not attempt to create a new Document.
1890           - responseXML should return a valid HTML document when the MIME type is "text/html", but only when the caller has
1891             explicitly set responseType to "document".
1892
1893         Reviewed by Alexey Proskuryakov.
1894
1895         Tests: fast/xmlhttprequest/xmlhttprequest-responseXML-html-document-responsetype-quirks.html
1896                fast/xmlhttprequest/xmlhttprequest-responseXML-html-document-responsetype-strict.html
1897                fast/xmlhttprequest/xmlhttprequest-responseXML-html-no-responsetype.html
1898                fast/xmlhttprequest/xmlhttprequest-responseXML-invalid-xml.html
1899                fast/xmlhttprequest/xmlhttprequest-responseXML-xml-document-responsetype.html
1900                fast/xmlhttprequest/xmlhttprequest-responseXML-xml-text-responsetype.html
1901
1902         * xml/XMLHttpRequest.cpp:
1903         (WebCore::XMLHttpRequest::responseXML):
1904         (WebCore::XMLHttpRequest::clearResponseBuffers):
1905         * xml/XMLHttpRequest.h: Rename m_responseXML to m_responseDocument
1906         (WebCore::XMLHttpRequest::optionalResponseXML):
1907
1908 2011-12-16  Ryosuke Niwa  <rniwa@webkit.org>
1909
1910         Only EditCommandComposition should implement unapply and reapply
1911         https://bugs.webkit.org/show_bug.cgi?id=74490
1912
1913         Reviewed by Eric Seidel.
1914
1915         Introduce new abstract class UndoStep to replace EditCommand for EditorClient, and make EditCommand
1916         private to WebCore.
1917
1918         * GNUmakefile.list.am:
1919         * Target.pri:
1920         * WebCore.exp.in:
1921         * WebCore.gypi:
1922         * WebCore.vcproj/WebCore.vcproj:
1923         * WebCore.xcodeproj/project.pbxproj:
1924         * editing/CompositeEditCommand.cpp:
1925         (WebCore::EditCommandComposition::create): Takes EditAction instead of boolean for CreateLinkCommand.
1926         (WebCore::EditCommandComposition::EditCommandComposition): Ditto.
1927         (WebCore::EditCommandComposition::unapply): Moved from EditCommand; we don't have to call isTopLevelCommand
1928         anymore because EditCommandComposition is always top-level. In fact, the only thing unapply/reapply do
1929         in addition to what doUnapply/doReapply do for sub-level commands is disabling and enabling delete button
1930         and defining an event queue scope. However, these can be done at top-level command anyway, so we now only call
1931         doApply for sub-level commands.
1932         (WebCore::EditCommandComposition::reapply): Ditto.
1933         (WebCore::EditCommandComposition::setStartingSelection): Added.
1934         (WebCore::EditCommandComposition::setEndingSelection): Added.
1935         (WebCore::applyCommand): Moved from EditCommand.
1936         (WebCore::CompositeEditCommand::apply): Moved from EditCommand; doesn't call isTopLevelCommand for the same reason.
1937         (WebCore::CompositeEditCommand::ensureComposition):
1938         (WebCore::CompositeEditCommand::applyCommandToComposite): Call doApply instead of apply for the same reason.
1939         * editing/CompositeEditCommand.h:
1940         (WebCore::EditCommandComposition::wasCreateLinkCommand):
1941         (WebCore::EditCommandComposition::startingSelection): Added.
1942         (WebCore::EditCommandComposition::endingSelection): Added.
1943         * editing/EditCommand.cpp:
1944         (WebCore::EditCommand::setStartingSelection):
1945         (WebCore::EditCommand::setEndingSelection):
1946         (WebCore::SimpleEditCommand::doReapply): Moved from EditCommand.
1947         * editing/EditCommand.h:
1948         * editing/UndoStep.h: Added.
1949         (WebCore::UndoStep::~UndoStep):
1950         * loader/EmptyClients.h:
1951         (WebCore::EmptyEditorClient::shouldInsertNode):
1952         (WebCore::EmptyEditorClient::didSetSelectionTypesForPasteboard):
1953         (WebCore::EmptyEditorClient::registerCommandForUndo): Takes UndoStep instead of EditCommand.
1954         (WebCore::EmptyEditorClient::registerCommandForRedo): Ditto.
1955         * page/EditorClient.h:
1956
1957 2011-12-16  Simon Fraser  <simon.fraser@apple.com>
1958
1959         Allow a PlatformCALayer to own its own sublayers
1960         https://bugs.webkit.org/show_bug.cgi?id=74744
1961
1962         Reviewed by Anders Carlsson.
1963
1964         GraphicsLayerCA rebuilds the sublayer list of CALayers, which would
1965         blow away any custom layers that a PlatformCALayer wants to maintain
1966         as children.
1967         
1968         Make it possible for a PlatformLayerCA to indicate that it wants
1969         a specific list of sublayers to be maintained as the first layers
1970         in the child list.
1971         
1972         * platform/graphics/ca/GraphicsLayerCA.cpp:
1973         (WebCore::GraphicsLayerCA::updateSublayerList):
1974         * platform/graphics/ca/PlatformCALayer.h:
1975         (WebCore::PlatformCALayer::customSublayers):
1976         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
1977         (PlatformCALayer::PlatformCALayer):
1978
1979 2011-12-16  Adam Barth  <abarth@webkit.org>
1980
1981         <!DOCTYPE html><pre>&#x0a;&#x0a;A</pre> doesn't parse correctly
1982         https://bugs.webkit.org/show_bug.cgi?id=74658
1983
1984         Reviewed by Darin Adler.
1985
1986         Previously, we handled skipping newlines after <pre> in the tokenizer,
1987         which isn't how the spec handles them.  Instead, the spec skips them in
1988         the tree builder.  This isn't usually observable, except in the case of
1989         an HTML entity.  In that case, the tokenzier sees '&' (because the
1990         entity hasn't been decoded yet), but the tree builder sees '\n' (the
1991         decoded entity).  This patch fixes the bug by more closely aligning our
1992         implementation with the spec.
1993
1994         Test: html5lib/runner.html
1995
1996         * html/parser/HTMLTokenizer.cpp:
1997         (WebCore::HTMLTokenizer::reset):
1998         (WebCore::HTMLTokenizer::nextToken):
1999         * html/parser/HTMLTokenizer.h:
2000         * html/parser/HTMLTreeBuilder.cpp:
2001         (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::skipAtMostOneLeadingNewline):
2002         (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
2003         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
2004         (WebCore::HTMLTreeBuilder::processCharacterBuffer):
2005         * html/parser/HTMLTreeBuilder.h:
2006         * xml/parser/MarkupTokenizerBase.h:
2007
2008 2011-12-16  Joshua Bell  <jsbell@chromium.org>
2009
2010         IndexedDB: Implement IDBObjectStore.count() and IDBIndex.count()
2011         https://bugs.webkit.org/show_bug.cgi?id=73686
2012
2013         Reviewed by Tony Chang.
2014
2015         These new methods open an internal cursor and iterate through the
2016         results, returning the number of items found. Note that only
2017         passing an IDBKeyRange is supported, not an IDBKey. Supporting
2018         that will require some IDL/binding monkeying; several other
2019         methods also need the same Key-or-KeyRange behavior.
2020
2021         Tests: storage/indexeddb/index-count.html
2022                storage/indexeddb/objectstore-count.html
2023
2024         * bindings/v8/SerializedScriptValue.cpp:
2025         (WebCore::SerializedScriptValue::numberValue):
2026         * bindings/v8/SerializedScriptValue.h:
2027         * storage/IDBIndex.cpp:
2028         (WebCore::IDBIndex::openCursor):
2029         (WebCore::IDBIndex::count):
2030         * storage/IDBIndex.h:
2031         (WebCore::IDBIndex::count):
2032         * storage/IDBIndex.idl:
2033         * storage/IDBIndexBackendImpl.cpp:
2034         (WebCore::IDBIndexBackendImpl::countInternal):
2035         (WebCore::IDBIndexBackendImpl::count):
2036         * storage/IDBIndexBackendImpl.h:
2037         * storage/IDBIndexBackendInterface.h:
2038         * storage/IDBObjectStore.cpp:
2039         (WebCore::IDBObjectStore::count):
2040         * storage/IDBObjectStore.h:
2041         (WebCore::IDBObjectStore::count):
2042         * storage/IDBObjectStore.idl:
2043         * storage/IDBObjectStoreBackendImpl.cpp:
2044         (WebCore::IDBObjectStoreBackendImpl::count):
2045         (WebCore::IDBObjectStoreBackendImpl::countInternal):
2046         * storage/IDBObjectStoreBackendImpl.h:
2047         * storage/IDBObjectStoreBackendInterface.h:
2048
2049 2011-12-16  Yael Aharon  <yael.aharon@nokia.com>
2050
2051         Audio file in video element has a size of 0x0 .
2052         https://bugs.webkit.org/show_bug.cgi?id=74738
2053
2054         Reviewed by Kenneth Rohde Christiansen.
2055
2056         When the source of a video element has audio only, the intrinsic size of the video should
2057         not be 0x0. Instead, it should be the same as as no media was loaded.
2058
2059         No new tests. An existing test is covering this case and was modified to reflect this change.
2060
2061         * rendering/RenderVideo.cpp:
2062         (WebCore::RenderVideo::calculateIntrinsicSize):
2063
2064 2011-12-16  Alexis Menard  <alexis.menard@openbossa.org>
2065
2066         getComputedStyle for border-width is not implemented.
2067         https://bugs.webkit.org/show_bug.cgi?id=74635
2068
2069         Reviewed by Tony Chang.
2070
2071         Implement getComputedStyle for border-width.
2072
2073         Test: fast/css/getComputedStyle/getComputedStyle-border-width.html
2074
2075         * css/CSSComputedStyleDeclaration.cpp:
2076         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
2077
2078 2011-12-16  Branimir Lambov  <blambov@google.com>
2079
2080         [chromium] svg/clip-path/clip-in-mask.svg fails on Windows and Linux
2081         https://bugs.webkit.org/show_bug.cgi?id=53378
2082
2083         Reviewed by Tony Chang.
2084
2085         Fixes a problem in Skia's clipping layer code's handling of coordinate
2086         transformations that was causing all complex clipping (including text
2087         and/or masks) to fail.
2088
2089         The method beginLayerClippedToImage was taking rectangle coordinates
2090         in one local coordinate space, but it was applying them in a different  
2091         one because of the delay between the time it is called and the actual 
2092         application occurs in applyClipFromImage. The fix translates the 
2093         coordinates passed to beginLayerClippedToImage to absolute ones, so 
2094         that they are not affected by any change in the transform matrix, and 
2095         makes sure that applyClipFromImage clears the matrix before drawing
2096         the clip layer to correctly apply the absolute coordinates.
2097
2098         * platform/graphics/skia/PlatformContextSkia.cpp:
2099         (WebCore::PlatformContextSkia::beginLayerClippedToImage):
2100         (WebCore::PlatformContextSkia::applyClipFromImage):
2101         * platform/graphics/skia/PlatformContextSkia.h:
2102
2103 2011-12-16  Mark Hahnenberg  <mhahnenberg@apple.com>
2104
2105         De-virtualize destructors
2106         https://bugs.webkit.org/show_bug.cgi?id=74331
2107
2108         Reviewed by Geoffrey Garen.
2109
2110         No new tests.
2111
2112         Doing everything here that was done to the JSCell hierarchy in JavaScriptCore. 
2113         See the ChangeLog for this commit for a more in-depth description.
2114
2115         * WebCore.exp.in: Add/remove symbols.
2116         * bindings/js/JSCanvasRenderingContext2DCustom.cpp: Remove first arg from isJSArray call.
2117         (WebCore::JSCanvasRenderingContext2D::setWebkitLineDash):
2118         * bindings/js/JSDOMBinding.cpp: Add trival destructor assert for DOMConstructorObject 
2119         and DOMConstructorWithDocument.
2120         * bindings/js/JSDOMGlobalObject.cpp: Add static destroy.  Add implementation for 
2121         scriptExecutionContext that dispatches to different functions in subclasses 
2122         depending on our current ClassInfo.  We do this so that we can get rid of the 
2123         virtual-ness of scriptExecutionContext, because any virtual functions will throw 
2124         off the layout of the object and we'll crash at runtime.
2125         (WebCore::JSDOMGlobalObject::destroy):
2126         (WebCore::JSDOMGlobalObject::scriptExecutionContext):
2127         * bindings/js/JSDOMGlobalObject.h:
2128         * bindings/js/JSDOMWindowBase.cpp: Add static destroy.
2129         (WebCore::JSDOMWindowBase::destroy):
2130         * bindings/js/JSDOMWindowBase.h: De-virtualize scriptExecutionContext.
2131         * bindings/js/JSDOMWindowShell.cpp: Add static destroy.
2132         (WebCore::JSDOMWindowShell::destroy):
2133         * bindings/js/JSDOMWindowShell.h:
2134         * bindings/js/JSDOMWrapper.cpp: Add trivial destructor assert.
2135         * bindings/js/JSDOMWrapper.h: Add a ClassInfo to JSDOMWrapper since it now overrides 
2136         a MethodTable function. Remove vtableAnchor virtual function.
2137         * bindings/js/JSImageConstructor.cpp: Add trivial destructor assert.
2138         * bindings/js/JSNodeCustom.cpp: Change implementation of pushEventHandlerScope so that 
2139         it dispatches to the correct function depending on the 
2140         identity of the class as specified by the ClassInfo.  
2141         See JSDOMGlobalObject::scriptExecutionContext for explanation.
2142         (WebCore::JSNode::pushEventHandlerScope):
2143         * bindings/js/JSWebSocketCustom.cpp: Remove first arg to isJSArray call.
2144         (WebCore::JSWebSocketConstructor::constructJSWebSocket):
2145         * bindings/js/JSWorkerContextBase.cpp: Add static destroy.
2146         (WebCore::JSWorkerContextBase::destroy):
2147         * bindings/js/JSWorkerContextBase.h: 
2148         * bindings/js/ScriptValue.cpp: Remove first arg to isJSArray call.
2149         (WebCore::jsToInspectorValue): 
2150         * bindings/js/SerializedScriptValue.cpp: Ditto.
2151         (WebCore::CloneSerializer::isArray):
2152         (WebCore::CloneSerializer::getSparseIndex):
2153         * bindings/scripts/CodeGeneratorJS.pm:
2154         (GenerateHeader): Remove virtual-ness of any custom pushEventHandlerScope (see 
2155         JSNodeCustom::pushEventHandlerScope for explanation).  Remove virtual toBoolean 
2156         for anybody who masquerades as undefined, since our JSObject implementation handles 
2157         this based on the TypeInfo in the Structure. Add trivial destructor assert for any 
2158         class other than DOMWindow or WorkerContexts.
2159         (GenerateImplementation): Change ClassInfo definitions to use Base::s_info, since 
2160         typing the parent class more than once is duplication of information and increases 
2161         the likelihood of mistakes.  Pass ClassInfo to TypeArrayDescriptors instead of vptr. 
2162         (GenerateConstructorDefinition): Add trivial destructor assert for all generated constructors.
2163         * bridge/c/CRuntimeObject.cpp: Remove empty virtual destructor.
2164         * bridge/c/CRuntimeObject.h: 
2165         * bridge/jni/jsc/JavaRuntimeObject.cpp: Ditto.
2166         * bridge/jni/jsc/JavaRuntimeObject.h: 
2167         * bridge/objc/ObjCRuntimeObject.h: Ditto.
2168         * bridge/objc/ObjCRuntimeObject.mm:
2169         * bridge/objc/objc_runtime.h: Add static destroy for ObjcFallbackObjectImp. De-virtualize 
2170         toBoolean in the short term.  Need longer term fix.
2171         * bridge/objc/objc_runtime.mm:
2172         (JSC::Bindings::ObjcFallbackObjectImp::destroy):
2173         * bridge/qt/qt_runtime.cpp: Add static destroy to QtRuntimeMethod.
2174         (JSC::Bindings::QtRuntimeMethod::destroy):
2175         * bridge/qt/qt_runtime.h: De-virtualize ~QtRuntimeMethod.
2176         * bridge/runtime_array.cpp: De-virtualize destructor. Add static destroy.
2177         (JSC::RuntimeArray::destroy):
2178         * bridge/runtime_array.h:
2179         * bridge/runtime_method.cpp: Remove vtableAnchor. Add static destroy.
2180         (JSC::RuntimeMethod::destroy):
2181         * bridge/runtime_method.h:
2182         * bridge/runtime_object.cpp: Add static destroy.
2183         (JSC::Bindings::RuntimeObject::destroy):
2184         * bridge/runtime_object.h:
2185
2186 2011-12-15  Alexey Proskuryakov  <ap@apple.com>
2187
2188         Poor XPath performance when evaluating an expression that returns a lot of nodes
2189         https://bugs.webkit.org/show_bug.cgi?id=74665
2190         <rdar://problem/10517146>
2191
2192         Reviewed by Darin Adler.
2193
2194         No change in funcitonality. Well covered by existing tests (ran them with zero cutoff to
2195         execute the new code path).
2196
2197         Our sorting function is optimized for small node sets in large documents, and this is the
2198         opposite of it. Added another one that traverses the whole document, adding nodes from the
2199         node set to sorted list. That doesn't grow with the number of nodes nearly as fast.
2200
2201         Cutoff amount chosen for the document referenced in bug - this is roughly where the algorithms
2202         have the same performance on it.
2203
2204         * xml/XPathNodeSet.cpp:
2205         (WebCore::XPath::NodeSet::sort):
2206         (WebCore::XPath::findRootNode):
2207         (WebCore::XPath::NodeSet::traversalSort):
2208         * xml/XPathNodeSet.h:
2209
2210 2011-12-15  Antti Koivisto  <antti@apple.com>
2211
2212         https://bugs.webkit.org/show_bug.cgi?id=74677
2213         Count ResourceLoadScheduler suspends/resumes
2214
2215         Reviewed by Andreas Kling.
2216
2217         Using boolean is not robust when there are multiple clients calling suspendPendingRequests/resumePendingRequests.
2218         
2219         Increment and decrement suspend count instead of just setting/unsetting a boolean.
2220
2221         * loader/ResourceLoadScheduler.cpp:
2222         (WebCore::ResourceLoadScheduler::ResourceLoadScheduler):
2223         (WebCore::ResourceLoadScheduler::servePendingRequests):
2224         (WebCore::ResourceLoadScheduler::suspendPendingRequests):
2225         (WebCore::ResourceLoadScheduler::resumePendingRequests):
2226         * loader/ResourceLoadScheduler.h:
2227         (WebCore::ResourceLoadScheduler::isSuspendingPendingRequests):
2228
2229 2011-12-16  Adam Klein  <adamk@chromium.org>
2230
2231         Improve performance of ChildListMutationScope when no MutationObservers are present
2232         https://bugs.webkit.org/show_bug.cgi?id=74671
2233
2234         Reviewed by Ojan Vafai.
2235
2236         Inline ChildListMutationScope's methods (including constructor and
2237         destructor), and provide a fast-fail case when no mutation observers
2238         are present.
2239
2240         The code reorganization necessary for the above also removed the
2241         anonymous namespace in ChildListMutationScope.cpp, making both helper
2242         classes private inner classes of ChildListMutationScope.
2243
2244         No new tests, refactoring only.
2245
2246         * dom/ChildListMutationScope.cpp:
2247         (WebCore::ChildListMutationScope::MutationAccumulator::MutationAccumulator):
2248         (WebCore::ChildListMutationScope::MutationAccumulator::~MutationAccumulator):
2249         (WebCore::ChildListMutationScope::MutationAccumulator::isAddedNodeInOrder):
2250         (WebCore::ChildListMutationScope::MutationAccumulator::childAdded):
2251         (WebCore::ChildListMutationScope::MutationAccumulator::isRemovedNodeInOrder):
2252         (WebCore::ChildListMutationScope::MutationAccumulator::willRemoveChild):
2253         (WebCore::ChildListMutationScope::MutationAccumulator::enqueueMutationRecord):
2254         (WebCore::ChildListMutationScope::MutationAccumulator::clear):
2255         (WebCore::ChildListMutationScope::MutationAccumulator::isEmpty):
2256         (WebCore::ChildListMutationScope::MutationAccumulationRouter::MutationAccumulationRouter):
2257         (WebCore::ChildListMutationScope::MutationAccumulationRouter::~MutationAccumulationRouter):
2258         (WebCore::ChildListMutationScope::MutationAccumulationRouter::initialize):
2259         (WebCore::ChildListMutationScope::MutationAccumulationRouter::instance):
2260         (WebCore::ChildListMutationScope::MutationAccumulationRouter::childAdded):
2261         (WebCore::ChildListMutationScope::MutationAccumulationRouter::willRemoveChild):
2262         (WebCore::ChildListMutationScope::MutationAccumulationRouter::incrementScopingLevel):
2263         (WebCore::ChildListMutationScope::MutationAccumulationRouter::decrementScopingLevel):
2264         * dom/ChildListMutationScope.h:
2265         (WebCore::ChildListMutationScope::ChildListMutationScope):
2266         (WebCore::ChildListMutationScope::~ChildListMutationScope):
2267         (WebCore::ChildListMutationScope::childAdded):
2268         (WebCore::ChildListMutationScope::willRemoveChild):
2269
2270 2011-12-16  Dean Jackson  <dino@apple.com>
2271
2272         Filters need to affect visual overflow
2273         https://bugs.webkit.org/show_bug.cgi?id=71930
2274
2275         Reviewed by Simon Fraser.
2276
2277         Make sure filters are included in visual overflow.
2278         Add a new method to calculate the expansion of overflow
2279         region given a list of FilterOperations. This is a slight
2280         duplication of code from the rendering path, but is needed
2281         because overflow is calculated before the FilterEffect
2282         chain is built.
2283
2284         Also, filters were always rendered into their
2285         input rectangle which was wrong for any effect
2286         that produced a different sized result - drop-shadow
2287         and blur. This required two changes. First, FilterEffect
2288         needed a flag to decide whether or not to clip
2289         output to primitive regions (as required by SVG but not
2290         what we want here). Second, the rendering operation
2291         draws into the rectangle the filter claims is its painting
2292         rectangle.
2293
2294         Test: css3/filters/regions-expanding.html
2295
2296         * platform/graphics/filters/FEDropShadow.cpp:
2297         (WebCore::FEDropShadow::determineAbsolutePaintRect): Only
2298         clipToBounds if necessary.
2299         * platform/graphics/filters/FEGaussianBlur.cpp:
2300         (WebCore::FEGaussianBlur::calculateUnscaledKernelSize): CSS filters
2301         ask for the kernel size before the Filter object is created, so
2302         add a new method to return an unscaled kernel.
2303         (WebCore::FEGaussianBlur::calculateKernelSize):
2304         (WebCore::FEGaussianBlur::determineAbsolutePaintRect): Only
2305         clipToBounds if necessary.
2306         * platform/graphics/filters/FEGaussianBlur.h:
2307         * platform/graphics/filters/FEMorphology.cpp:
2308         (WebCore::FEMorphology::determineAbsolutePaintRect): Only
2309         clipToBounds if necessary.
2310         * platform/graphics/filters/FEOffset.cpp:
2311         (WebCore::FEOffset::determineAbsolutePaintRect): Only
2312         clipToBounds if necessary.
2313         * platform/graphics/filters/FilterEffect.cpp:
2314         (WebCore::FilterEffect::FilterEffect): Initialize clipToBounds
2315         as false so SVG remains unchanged.
2316         (WebCore::FilterEffect::determineAbsolutePaintRect): Only
2317         clipToBounds if necessary.
2318         * platform/graphics/filters/FilterEffect.h:
2319         (WebCore::FilterEffect::clipsToBounds):
2320         (WebCore::FilterEffect::setClipsToBounds):
2321         * rendering/FilterEffectRenderer.cpp:
2322         (WebCore::FilterEffectRenderer::build): Make sure we set our
2323         filters here to NOT clip to bounds.
2324         * rendering/FilterEffectRenderer.h:
2325         (WebCore::FilterEffectRenderer::outputRect): Asks the filter
2326         operation for the size of the result image.
2327         * rendering/RenderBlock.cpp:
2328         (WebCore::RenderBlock::computeOverflow):
2329         * rendering/RenderBox.cpp:
2330         (WebCore::RenderBox::addVisualEffectOverflow): Change the name
2331         from addBoxShadowAndBorderOverflow().
2332         * rendering/RenderBox.h:
2333         * rendering/RenderEmbeddedObject.cpp:
2334         (WebCore::RenderEmbeddedObject::layout):
2335         * rendering/RenderIFrame.cpp:
2336         (WebCore::RenderIFrame::layout):
2337         * rendering/RenderLayer.cpp:
2338         (WebCore::RenderLayer::paintLayer):
2339         * rendering/RenderLayerBacking.cpp:
2340         (WebCore::hasBoxDecorations): Change name from
2341         hasBorderOutlineOrShadow().
2342         (WebCore::hasBoxDecorationsOrBackground):
2343         (WebCore::hasBoxDecorationsOrBackgroundImage):
2344         * rendering/RenderReplaced.cpp:
2345         (WebCore::RenderReplaced::layout):
2346         * rendering/style/FilterOperations.cpp:
2347         (WebCore::outsetSizeForBlur): Return an IntSize that is the amount
2348         of offset.
2349         (WebCore::FilterOperations::hasOutsets):
2350         (WebCore::FilterOperations::getOutsets):
2351         * rendering/style/FilterOperations.h:
2352         * rendering/style/RenderStyle.h:
2353         (WebCore::InheritedFlags::getFilterOutsets):
2354         (WebCore::InheritedFlags::hasFilterOutsets):
2355         * svg/graphics/filters/SVGFEImage.cpp:
2356         (WebCore::FEImage::determineAbsolutePaintRect): Only
2357         clipToBounds if necessary.
2358
2359 2011-12-16  Alexis Menard  <alexis.menard@openbossa.org>, Jakub Wieczorek  <jwieczorek@webkit.org>
2360
2361         Add support for <ol reversed>.
2362         https://bugs.webkit.org/show_bug.cgi?id=36724
2363
2364         The reversed attribute makes an ordered list appear with marker values
2365         decreasing from n, where n is the number of items.
2366         See: http://www.whatwg.org/specs/web-apps/current-work/#attr-ol-reversed
2367
2368         Reviewed by Darin Adler.
2369
2370         Tests: fast/lists/ol-reversed-dynamic-simple.html
2371                fast/lists/ol-reversed-dynamic.html
2372                fast/lists/ol-reversed-nested-items.html
2373                fast/lists/ol-reversed-nested-list.html
2374                fast/lists/ol-reversed-simple.html
2375
2376         * html/HTMLAttributeNames.in:
2377         * html/HTMLOListElement.cpp:
2378         (WebCore::HTMLOListElement::HTMLOListElement):
2379         (WebCore::HTMLOListElement::parseMappedAttribute):
2380         (WebCore::HTMLOListElement::updateItemValues):
2381         (WebCore::HTMLOListElement::recalculateItemCount):
2382         * html/HTMLOListElement.h:
2383         (WebCore::HTMLOListElement::start):
2384         (WebCore::HTMLOListElement::isReversed):
2385         (WebCore::HTMLOListElement::itemCountChanged):
2386         (WebCore::HTMLOListElement::itemCount):
2387         * html/HTMLOListElement.idl:
2388         * rendering/RenderListItem.cpp:
2389         (WebCore::RenderListItem::nextListItem):
2390         (WebCore::previousListItem):
2391         (WebCore::RenderListItem::calcValue):
2392         (WebCore::RenderListItem::explicitValueChanged):
2393         (WebCore::previousOrNextItem):
2394         (WebCore::RenderListItem::updateListMarkerNumbers):
2395         * rendering/RenderListItem.h:
2396
2397 2011-12-16  Mikhail Naganov  <mnaganov@chromium.org>
2398
2399         Scroll non-visible edit controls and caret into the center of the view when starting typing.
2400         https://bugs.webkit.org/show_bug.cgi?id=65027
2401
2402         Reviewed by Ryosuke Niwa.
2403
2404         Tests: editing/input/caret-at-the-edge-of-contenteditable.html
2405                editing/input/caret-at-the-edge-of-input.html
2406                editing/input/reveal-caret-of-multiline-contenteditable.html
2407                editing/input/reveal-caret-of-multiline-input.html
2408                editing/input/reveal-contenteditable-on-input-vertically.html
2409                editing/input/reveal-contenteditable-on-paste-vertically.html
2410                editing/input/reveal-edit-on-input-vertically.html
2411                editing/input/reveal-edit-on-paste-vertically.html
2412
2413         * editing/Editor.cpp:
2414         (WebCore::Editor::insertTextWithoutSendingTextEvent):
2415         (WebCore::Editor::revealSelectionAfterEditingOperation):
2416
2417 2011-12-16  Ryosuke Niwa  <rniwa@webkit.org>
2418
2419         Touch RenderStyle in an attempt to fix linking errors on Chromium Windows bots.
2420
2421         * rendering/style/RenderStyle.h:
2422
2423 2011-12-14  Nat Duca  <nduca@chromium.org>
2424
2425         [chromium] DelayBasedTimeSource should not change its timebase on late ticks
2426         https://bugs.webkit.org/show_bug.cgi?id=74573
2427
2428         The original DelayBasedTimeSource was designed to shift its timebase
2429         to the tick time when a tick came back "late." The rationale was that it is
2430         better to just "start fresh" after a stutter. After profiling this,
2431         this time-rebasing just destabilizes frame rate anytime the thread gets
2432         loaded.  This patch keeps the timebase stationary, leading to vastly
2433         smoother framerates when the message loop is under load.
2434
2435         Reviewed by James Robinson.
2436
2437         * platform/graphics/chromium/cc/CCDelayBasedTimeSource.cpp:
2438         (WebCore::CCDelayBasedTimeSource::updateState):
2439
2440 2011-12-16  Sheriff Bot  <webkit.review.bot@gmail.com>
2441
2442         Unreviewed, rolling out r103062.
2443         http://trac.webkit.org/changeset/103062
2444         https://bugs.webkit.org/show_bug.cgi?id=74715
2445
2446         It broke many tests (Requested by Ossy on #webkit).
2447
2448         * html/HTMLAttributeNames.in:
2449         * html/HTMLOListElement.cpp:
2450         (WebCore::HTMLOListElement::HTMLOListElement):
2451         (WebCore::HTMLOListElement::parseMappedAttribute):
2452         * html/HTMLOListElement.h:
2453         (WebCore::HTMLOListElement::start):
2454         * html/HTMLOListElement.idl:
2455         * rendering/RenderListItem.cpp:
2456         (WebCore::previousListItem):
2457         (WebCore::RenderListItem::calcValue):
2458         (WebCore::RenderListItem::explicitValueChanged):
2459         (WebCore::RenderListItem::updateListMarkerNumbers):
2460         * rendering/RenderListItem.h:
2461
2462 2011-12-16  Alexis Menard  <alexis.menard@openbossa.org>, Jakub Wieczorek  <jwieczorek@webkit.org>
2463
2464         Add support for <ol reversed>.
2465         https://bugs.webkit.org/show_bug.cgi?id=36724
2466
2467         The reversed attribute makes an ordered list appear with marker values
2468         decreasing from n, where n is the number of items.
2469         See: http://www.whatwg.org/specs/web-apps/current-work/#attr-ol-reversed
2470
2471         Reviewed by Darin Adler.
2472
2473         Tests: fast/lists/ol-reversed-dynamic-simple.html
2474                fast/lists/ol-reversed-dynamic.html
2475                fast/lists/ol-reversed-nested-items.html
2476                fast/lists/ol-reversed-nested-list.html
2477                fast/lists/ol-reversed-simple.html
2478
2479         * html/HTMLAttributeNames.in:
2480         * html/HTMLOListElement.cpp:
2481         (WebCore::HTMLOListElement::HTMLOListElement):
2482         (WebCore::HTMLOListElement::parseMappedAttribute):
2483         (WebCore::HTMLOListElement::updateItemValues):
2484         (WebCore::HTMLOListElement::recalculateItemCount):
2485         * html/HTMLOListElement.h:
2486         (WebCore::HTMLOListElement::start):
2487         (WebCore::HTMLOListElement::isReversed):
2488         (WebCore::HTMLOListElement::itemCountChanged):
2489         (WebCore::HTMLOListElement::itemCount):
2490         * html/HTMLOListElement.idl:
2491         * rendering/RenderListItem.cpp:
2492         (WebCore::RenderListItem::nextListItem):
2493         (WebCore::previousListItem):
2494         (WebCore::RenderListItem::calcValue):
2495         (WebCore::RenderListItem::explicitValueChanged):
2496         (WebCore::previousOrNextItem):
2497         (WebCore::RenderListItem::updateListMarkerNumbers):
2498         * rendering/RenderListItem.h:
2499
2500 2011-12-15  Stephen White  <senorblanco@chromium.org>
2501
2502         Enable CSS_FILTERS in Chromium.
2503         https://bugs.webkit.org/show_bug.cgi?id=74334
2504
2505         Reviewed by Chris Marrin.
2506
2507         Covered by css3/filters (when enabled).
2508
2509         * platform/graphics/filters/FilterOperation.h:
2510         (WebCore::PassthroughFilterOperation::PassthroughFilterOperation):
2511         Since wingdi.h #define's PASSTHROUGH, #undef it after the includes.
2512
2513 2011-12-16  Patrick Gansterer  <paroga@webkit.org>
2514
2515         Unreviewed WinCE build fix after r102979.
2516
2517         Make everHadLayout() public accessible as it was before the change.
2518
2519         * rendering/RenderObject.h:
2520         (WebCore::RenderObject::everHadLayout):
2521
2522 2011-12-15  Hans Wennborg  <hans@chromium.org>
2523
2524         IndexedDB: Don't prefetch values from key cursors
2525         https://bugs.webkit.org/show_bug.cgi?id=74604
2526
2527         Reviewed by Tony Chang.
2528
2529         Since index key cursors don't have values, prefetching should not try
2530         to retrieve them. Doing so trips an ASSERT in debug builds.
2531
2532         This will be tested Chromium-side.
2533
2534         * storage/IDBCursorBackendImpl.cpp:
2535         (WebCore::IDBCursorBackendImpl::prefetchContinueInternal):
2536
2537 2011-12-16  Yosifumi Inoue  <yosin@chromium.org>
2538
2539         [Forms] The "maxlength" attribute on "textarea" tag miscounts hard newlines
2540         https://bugs.webkit.org/show_bug.cgi?id=74686
2541
2542         Reviewed by Kent Tamura.
2543
2544         This patch counts LF in textarea value as two for LF to CRLF conversion on submission.
2545
2546         No new tests. Existing tests cover all changes.
2547
2548         * html/HTMLTextAreaElement.cpp:
2549         (WebCore::computeLengthForSubmission): Count LF as 2 for CR LF conversion on submission.
2550         (WebCore::HTMLTextAreaElement::handleBeforeTextInsertedEvent): Use computeLengthForSubmission instead of numGraphemeClusters.
2551         (WebCore::HTMLTextAreaElement::tooLong): Use computeLengthForSubmission instead of numGraphemeClusters.
2552
2553 2011-12-16  Hajime Morrita  <morrita@chromium.org>
2554
2555         Unreviewed, rolling out r103045.
2556         http://trac.webkit.org/changeset/103045
2557         https://bugs.webkit.org/show_bug.cgi?id=74590
2558
2559         Breaks select-script-onchange.html on Chromium Windows
2560
2561         * html/HTMLSelectElement.cpp:
2562         (WebCore::HTMLSelectElement::typeAheadFind):
2563
2564 2011-12-16  Carlos Garcia Campos  <cgarcia@igalia.com>
2565
2566         Unreviewed. Fix make distcheck.
2567
2568         * GNUmakefile.list.am: Add missing header file.
2569
2570 2011-12-16  Yosifumi Inoue  <yosin@chromium.org>
2571
2572         [Forms] Selection change by type-ahead doesn't fire 'change' event
2573         https://bugs.webkit.org/show_bug.cgi?id=74590
2574
2575         Reviewed by Kent Tamura.
2576
2577         Fire onchange even for type ahead selection.
2578
2579         Test: fast/forms/select/menulist-type-ahead-find.html
2580
2581         * html/HTMLSelectElement.cpp:
2582         (WebCore::HTMLSelectElement::typeAheadFind): Add DispatchChangeEvent when
2583         calling selectOption method.
2584
2585 2011-12-16  Andreas Kling  <kling@webkit.org>
2586
2587         Don't call Document::body() twice in the same function.
2588         <http://webkit.org/b/74683>
2589
2590         Reviewed by Dan Bernstein.
2591
2592         Document::body() is O(n), so we should avoid calling it multiple
2593         times unnecessarily.
2594
2595         * dom/Document.cpp:
2596         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
2597
2598 2011-12-16  Daniel Sievers  <sievers@chromium.org>
2599
2600         [Chromium] Add trace events for decoding and drawing images.
2601         https://bugs.webkit.org/show_bug.cgi?id=74547
2602
2603         Reviewed by James Robinson.
2604
2605         * platform/graphics/skia/ImageSkia.cpp:
2606         (WebCore::drawResampledBitmap):
2607         (WebCore::paintSkBitmap):
2608         (WebCore::Image::drawPattern):
2609         * platform/graphics/skia/NativeImageSkia.cpp:
2610         (WebCore::NativeImageSkia::resizedBitmap):
2611         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
2612         (WebCore::BMPImageDecoder::decode):
2613         * platform/image-decoders/gif/GIFImageDecoder.cpp:
2614         (WebCore::GIFImageDecoder::decode):
2615         * platform/image-decoders/ico/ICOImageDecoder.cpp:
2616         (WebCore::ICOImageDecoder::decode):
2617         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
2618         (WebCore::JPEGImageDecoder::decode):
2619         * platform/image-decoders/png/PNGImageDecoder.cpp:
2620         (WebCore::PNGImageDecoder::decode):
2621         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
2622         (WebCore::WEBPImageDecoder::decode):
2623
2624 2011-12-15  Martin Robinson  <mrobinson@igalia.com>
2625
2626         Fix 'make dist' in preparation for the GTK+ release.
2627
2628         * GNUmakefile.list.am: Add missing header.
2629
2630 2011-12-15  Rafael Ávila de Espíndola  <rafael.espindola@gmail.com>
2631
2632         Don't create empty files on error.
2633         https://bugs.webkit.org/show_bug.cgi?id=74373
2634
2635         Reviewed by Ryosuke Niwa.
2636
2637         * css/makeprop.pl:
2638         * css/makevalues.pl:
2639         * make-hash-tools.pl:
2640
2641 2011-12-15  Yongjun Zhang  <yongjun_zhang@apple.com>
2642
2643         PODIntervalTree takes 1.7MB memory on www.nytimes.com.
2644         https://bugs.webkit.org/show_bug.cgi?id=73712
2645
2646         Reviewed by Kenneth Russell.
2647
2648         For a RenderBlock which has floating objects inside, we will create a PODIntervalTree and a PODArena with
2649         at least one 16KB chunk.  A page could have a large number of such RenderBlocks and they could take huge
2650         amount of memory.  To fix that, we can create a shared PODArena in the root RenderView.  Instead of having
2651         their own PODArena, each RenderBlock with floating objects could share this PODArena to reduce memory consumption.
2652
2653         The shared PODArena could grow unboundedly if we keep removing and adding floating objects.  We can fix that
2654         by reusing the freed memory in each chunk.  However, a PODArena could allocate objects of different sizes and
2655         it would be complex to keep track of the size for each allocation in PODArena.  To address that, this patch
2656         added class PODFreeListArena<T> which only allocates objects of type T (hence the same size).  We can then use a
2657         free list to track freed nodes inside the chunk and reuse the free nodes in future allocations.
2658
2659         Manually tested on nytimes.com and the heap consumption of PODIntervalTree reduced from 1.7MB to 16KB. Performance
2660         doesn't regress on test PerformanceTests/Layout/floats.html.
2661
2662         * WebCore.xcodeproj/project.pbxproj: add new header file PODFreeListArena.h.
2663         * platform/PODArena.h:
2664         (WebCore::PODArena::~PODArena): change dtor to virtual.
2665         (WebCore::PODArena::Chunk::~Chunk): ditto.
2666         * platform/PODFreeListArena.h: Added.
2667         (WebCore::PODFreeListArena::create): 
2668         (WebCore::PODFreeListArena::allocateObject): allocate an object.
2669         (WebCore::PODFreeListArena::freeObject): free an object, find the right chunk and update its free list.
2670         (WebCore::PODFreeListArena::allocate): allocate memory from the free list or current chunk.
2671         (WebCore::PODFreeListArena::FreeListChunk::FreeListChunk): add m_freeList to track freed cells.
2672         (WebCore::PODFreeListArena::FreeListChunk::allocate): reuse a free cell if there is one.
2673         (WebCore::PODFreeListArena::FreeListChunk::free): make the memory taken by this object is free, and link it to m_freeList.
2674         (WebCore::PODFreeListArena::FreeListChunk::contains): check if a pointer is inside this chunk.
2675         (WebCore::PODFreeListArena::FreeListChunk::hasFreeList): check if this chunk has free cells.
2676         * platform/PODRedBlackTree.h:
2677         (WebCore::PODRedBlackTree::PODRedBlackTree): take PODFreeListArena instead of PODArena, since nodes of a particular PODRedBlackTree
2678             is always of the same size.
2679         (WebCore::PODRedBlackTree::clear): mark all nodes before clearing the tree.
2680         (WebCore::PODRedBlackTree::initIfNeeded): add initIfNeeded to take an external PODFreeListArena.
2681         (WebCore::PODRedBlackTree::add):
2682         (WebCore::PODRedBlackTree::deleteNode): mark the node free in arena after it is removed from the tree.
2683         (WebCore::PODRedBlackTree::markFree): mark all node free in the tree.
2684         * rendering/RenderBlock.cpp:
2685         (WebCore::RenderBlock::insertFloatingObject):
2686         (WebCore::RenderBlock::addOverhangingFloats):
2687         (WebCore::RenderBlock::addIntrudingFloats):
2688         (WebCore::RenderBlock::FloatingObjects::computePlacedFloatsTree):  passing the shared PODFreeListArena to m_placedFloatsTree.
2689         * rendering/RenderBlock.h:
2690         (WebCore::RenderBlock::FloatingObjects::FloatingObjects):
2691         * rendering/RenderView.cpp:
2692         (WebCore::RenderView::intervalArena): create the shared PODFreeListArena lazily.
2693         * rendering/RenderView.h:
2694
2695 2011-12-15  Tony Chang  <tony@chromium.org>
2696
2697         Unreviewed, rollout r102825 because it didn't improve performance.
2698         https://bugs.webkit.org/show_bug.cgi?id=74622
2699
2700         * css/CSSStyleSelector.cpp:
2701         (WebCore::CSSStyleSelector::styleForElement):
2702         (WebCore::CSSStyleSelector::pseudoStyleForElement):
2703
2704 2011-12-15  Ryosuke Niwa  <rniwa@webkit.org>
2705
2706         sizeof(RenderObject) is 32 instead of 24 on Windows
2707         https://bugs.webkit.org/show_bug.cgi?id=74646
2708
2709         Reviewed by Darin Adler.
2710
2711         Make all bitfields in RenderObject to unsigned and wrap them around by RenderObjectBitfields.
2712         Also add a compilation time assertion to make sure we won't grow RenderObject's size unintentionally.
2713
2714         * rendering/RenderBlock.cpp:
2715         (WebCore::RenderBlock::layoutBlock):
2716         (WebCore::RenderBlock::layoutBlockChild):
2717         (WebCore::RenderBlock::markAllDescendantsWithFloatsForLayout):
2718         (WebCore::RenderBlock::layoutColumns):
2719         * rendering/RenderBlock.h:
2720         (WebCore::RenderBlock::FloatWithRect::FloatWithRect):
2721         * rendering/RenderObject.cpp:
2722         (WebCore::SameSizeAsRenderObject::~SameSizeAsRenderObject):
2723         (WebCore::RenderObject::RenderObject):
2724         (WebCore::RenderObject::markContainingBlocksForLayout):
2725         (WebCore::RenderObject::setPreferredLogicalWidthsDirty):
2726         (WebCore::RenderObject::invalidateContainerPreferredLogicalWidths):
2727         (WebCore::RenderObject::styleWillChange):
2728         (WebCore::RenderObject::styleDidChange):
2729         (WebCore::RenderObject::willBeDestroyed):
2730         (WebCore::RenderObject::updateDragState):
2731         * rendering/RenderObject.h:
2732         (WebCore::RenderObject::hasCounterNodeMap):
2733         (WebCore::RenderObject::setHasCounterNodeMap):
2734         (WebCore::RenderObject::childrenInline):
2735         (WebCore::RenderObject::setChildrenInline):
2736         (WebCore::RenderObject::hasColumns):
2737         (WebCore::RenderObject::setHasColumns):
2738         (WebCore::RenderObject::inRenderFlowThread):
2739         (WebCore::RenderObject::setInRenderFlowThread):
2740         (WebCore::RenderObject::isAnonymous):
2741         (WebCore::RenderObject::setIsAnonymous):
2742         (WebCore::RenderObject::isAnonymousBlock):
2743         (WebCore::RenderObject::isFloating):
2744         (WebCore::RenderObject::isPositioned):
2745         (WebCore::RenderObject::isRelPositioned):
2746         (WebCore::RenderObject::isText):
2747         (WebCore::RenderObject::isBox):
2748         (WebCore::RenderObject::isInline):
2749         (WebCore::RenderObject::isDragging):
2750         (WebCore::RenderObject::isReplaced):
2751         (WebCore::RenderObject::isHorizontalWritingMode):
2752         (WebCore::RenderObject::hasLayer):
2753         (WebCore::RenderObject::hasBoxDecorations):
2754         (WebCore::RenderObject::needsLayout):
2755         (WebCore::RenderObject::selfNeedsLayout):
2756         (WebCore::RenderObject::needsPositionedMovementLayout):
2757         (WebCore::RenderObject::needsPositionedMovementLayoutOnly):
2758         (WebCore::RenderObject::posChildNeedsLayout):
2759         (WebCore::RenderObject::needsSimplifiedNormalFlowLayout):
2760         (WebCore::RenderObject::normalChildNeedsLayout):
2761         (WebCore::RenderObject::preferredLogicalWidthsDirty):
2762         (WebCore::RenderObject::hasOverflowClip):
2763         (WebCore::RenderObject::hasTransform):
2764         (WebCore::RenderObject::node):
2765         (WebCore::RenderObject::setPositioned):
2766         (WebCore::RenderObject::setRelPositioned):
2767         (WebCore::RenderObject::setFloating):
2768         (WebCore::RenderObject::setInline):
2769         (WebCore::RenderObject::setHasBoxDecorations):
2770         (WebCore::RenderObject::setIsText):
2771         (WebCore::RenderObject::setIsBox):
2772         (WebCore::RenderObject::setReplaced):
2773         (WebCore::RenderObject::setHorizontalWritingMode):
2774         (WebCore::RenderObject::setHasOverflowClip):
2775         (WebCore::RenderObject::setHasLayer):
2776         (WebCore::RenderObject::setHasTransform):
2777         (WebCore::RenderObject::setHasReflection):
2778         (WebCore::RenderObject::hasReflection):
2779         (WebCore::RenderObject::setHasMarkupTruncation):
2780         (WebCore::RenderObject::hasMarkupTruncation):
2781         (WebCore::RenderObject::selectionState):
2782         (WebCore::RenderObject::setSelectionState):
2783         (WebCore::RenderObject::hasSelectedChildren):
2784         (WebCore::RenderObject::isMarginBeforeQuirk):
2785         (WebCore::RenderObject::isMarginAfterQuirk):
2786         (WebCore::RenderObject::setMarginBeforeQuirk):
2787         (WebCore::RenderObject::setMarginAfterQuirk):
2788         (WebCore::RenderObject::everHadLayout):
2789         (WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
2790         (WebCore::RenderObject::RenderObjectBitfields::selectionState):
2791         (WebCore::RenderObject::RenderObjectBitfields::setSelectionState):
2792         (WebCore::RenderObject::setNeedsPositionedMovementLayout):
2793         (WebCore::RenderObject::setNormalChildNeedsLayout):
2794         (WebCore::RenderObject::setPosChildNeedsLayout):
2795         (WebCore::RenderObject::setNeedsSimplifiedNormalFlowLayout):
2796         (WebCore::RenderObject::setPaintBackground):
2797         (WebCore::RenderObject::setIsDragging):
2798         (WebCore::RenderObject::setEverHadLayout):
2799         (WebCore::RenderObject::setNeedsLayout):
2800         (WebCore::RenderObject::setChildNeedsLayout):
2801         * rendering/RenderObjectChildList.cpp:
2802         (WebCore::RenderObjectChildList::removeChildNode):
2803         * rendering/svg/RenderSVGContainer.cpp:
2804         (WebCore::RenderSVGContainer::layout):
2805
2806 2011-12-15  Wei Charles  <charles.wei@torchmobile.com.cn>
2807
2808         [BlackBerry] Upstream BlackBerry porting of pluginView
2809         https://bugs.webkit.org/show_bug.cgi?id=73397
2810
2811         Reviewed by Daniel Bates.
2812
2813         No new tests for now.
2814
2815         * plugins/blackberry/PluginViewBlackBerry.cpp: Added.
2816
2817 2011-12-15  Joshua Bell  <jsbell@chromium.org>
2818
2819         IndexedDB: Can't pass DOMStringList to IDBDatabase.transaction()
2820         https://bugs.webkit.org/show_bug.cgi?id=74452
2821
2822         Reviewed by Adam Barth.
2823
2824         V8 code generator generated checks for DOMStringList arguments, then
2825         deferred to a function that only handled array inputs. This previously
2826         worked for IndexedDB because it would fall into a now-removed default
2827         handler.
2828
2829         Modified storage/indexeddb/transaction-basics.html to test this.
2830
2831         * bindings/v8/V8Binding.cpp:
2832         (WebCore::v8ValueToWebCoreDOMStringList):
2833
2834 2011-12-15  Adam Klein  <adamk@chromium.org>
2835
2836         Make Element::setAttributeInternal inline in an attempt to avoid function call overhead
2837         https://bugs.webkit.org/show_bug.cgi?id=74638
2838
2839         Reviewed by Andreas Kling.
2840
2841         In r102695, I factored common code in setAttribute into
2842         Element::setAttributeInternal. This may have caused a perf regression
2843         due to the extra function call, which inlining should eliminate.
2844
2845         Running Dromaeo locally suggests that this will improve performance
2846         by ~9% on the "dom-attr element.property = value" test (which assigns
2847         a value to an element's id).
2848
2849         * dom/Element.cpp:
2850         (WebCore::Element::setAttributeInternal):
2851
2852 2011-12-15  Mary Wu  <mary.wu@torchmobile.com.cn>
2853
2854         Upstream FileSystemBlackBerry.cpp into WebCore/platform/blackberry
2855         https://bugs.webkit.org/show_bug.cgi?id=74491
2856
2857         Reviewed by Rob Buis.
2858
2859         We are using POSIX porting of FileSystem, so here only implement other 
2860         necessary functions.
2861
2862         Initial upstream, no new tests.
2863
2864         * platform/blackberry/FileSystemBlackBerry.cpp: Added.
2865         (WebCore::homeDirectoryPath):
2866         (WebCore::fileSystemRepresentation):
2867         (WebCore::unloadModule):
2868         (WebCore::openTemporaryFile):
2869
2870 2011-12-15  Adrienne Walker  <enne@google.com>
2871
2872         [chromium] Clean up unnecessary leaf functions in GraphicsLayerChromium
2873         https://bugs.webkit.org/show_bug.cgi?id=74140
2874
2875         Reviewed by James Robinson.
2876
2877         Tested by existing compositor layout tests.
2878
2879         This is a follow-on cleanup to r102196, which made some of these
2880         functions less useful than they had been in the past.
2881
2882         * platform/graphics/chromium/GraphicsLayerChromium.cpp:
2883         (WebCore::GraphicsLayerChromium::setContentsOpaque):
2884         (WebCore::GraphicsLayerChromium::setBackfaceVisibility):
2885         (WebCore::GraphicsLayerChromium::updateLayerPreserves3D):
2886         * platform/graphics/chromium/GraphicsLayerChromium.h:
2887
2888 2011-12-15  Kenneth Russell  <kbr@google.com>
2889
2890         Unreviewed, rolling out r103000.
2891         http://trac.webkit.org/changeset/103000
2892         https://bugs.webkit.org/show_bug.cgi?id=74658
2893
2894         Does not handle text/plain documents correctly.
2895
2896         * html/parser/HTMLTokenizer.cpp:
2897         * html/parser/HTMLTokenizer.h:
2898         * html/parser/HTMLTreeBuilder.cpp:
2899         * html/parser/HTMLTreeBuilder.h:
2900         * xml/parser/MarkupTokenizerBase.h:
2901
2902 2011-12-15  James Robinson  <jamesr@chromium.org>
2903
2904         [chromium] Set the CCLayerTreeHost pointer on LayerChromium instances eagerly
2905         https://bugs.webkit.org/show_bug.cgi?id=74477
2906
2907         Reviewed by Kenneth Russell.
2908
2909         This enforces that the m_layerTreeHost pointer on LayerChromium instances is always up to date, instead of
2910         lazily setting it in the paintContents loop. There are two invariants:
2911         1.) If a LayerChromium is the root layer of a CCLayerTreeHost, or is reachable via the children, mask, or
2912         replica pointers from the root layer of a CCLayerTreeHost, then that LayerChromium's m_layerTreeHost pointer
2913         refers to that CCLayerTreeHost
2914         2.) If a LayerChromium is not a root layer or reachable from a root layer of any CCLayerTreeHost, its
2915         CCLayerTreeHost pointer is nil.
2916
2917         Covered by several new layout tests in LayerChromiumTest
2918
2919         * platform/graphics/chromium/LayerChromium.cpp:
2920         (WebCore::LayerChromium::setLayerTreeHost):
2921         (WebCore::LayerChromium::setParent):
2922         (WebCore::LayerChromium::setMaskLayer):
2923         (WebCore::LayerChromium::setReplicaLayer):
2924         * platform/graphics/chromium/LayerChromium.h:
2925         * platform/graphics/chromium/TiledLayerChromium.cpp:
2926         (WebCore::TiledLayerChromium::createTile):
2927         * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
2928         (WebCore::CCLayerTreeHost::setRootLayer):
2929         (WebCore::CCLayerTreeHost::paintMaskAndReplicaForRenderSurface):
2930         (WebCore::CCLayerTreeHost::paintLayerContents):
2931         * platform/graphics/chromium/cc/CCLayerTreeHost.h:
2932
2933 2011-12-15  Sheriff Bot  <webkit.review.bot@gmail.com>
2934
2935         Unreviewed, rolling out r102652 and r102717.
2936         http://trac.webkit.org/changeset/102652
2937         http://trac.webkit.org/changeset/102717
2938         https://bugs.webkit.org/show_bug.cgi?id=74674
2939
2940         Broke too many webs. (Requested by kling on #webkit).
2941
2942         * WebCore.exp.in:
2943
2944 2011-12-15  Anders Carlsson  <andersca@apple.com>
2945
2946         Lazily create the scrolling coordinator and add a setting for enabling it
2947         https://bugs.webkit.org/show_bug.cgi?id=74667
2948
2949         Reviewed by Darin Adler.
2950
2951         * WebCore.xcodeproj/project.pbxproj:
2952         Make ScrollingCoordinator.h a private header so it can be used in WebKit.
2953         * page/Page.cpp:
2954         (WebCore::Page::Page):
2955         Don't create the scrolling coordinator.
2956
2957         (WebCore::Page::~Page):
2958         Check for a null scrolling coordinator.
2959
2960         (WebCore::Page::scrollingCoordinator):
2961         Create the scrolling coordinator lazily.
2962
2963         * page/Settings.cpp:
2964         (WebCore::Settings::Settings):
2965         * page/Settings.h:
2966         (WebCore::Settings::setScrollingCoordinatorEnabled):
2967         (WebCore::Settings::scrollingCoordinatorEnabled):
2968         Add a setting for enabling the scrolling coordinator.
2969
2970         * rendering/RenderLayerBacking.cpp:
2971         (WebCore::RenderLayerBacking::RenderLayerBacking):
2972         Use a tile cache layer for the main frame when the scrolling coordinator is neabled.
2973
2974 2011-12-15  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2975
2976         Unreviewed. Fix build break when data-transfer-items is enabled.
2977
2978         * platform/efl/ClipboardEfl.cpp:
2979         (WebCore::ClipboardEfl::items):
2980         * platform/efl/ClipboardEfl.h:
2981
2982 2011-12-15  Adam Barth  <abarth@webkit.org>
2983
2984         <ruby><div><p><rp> parses incorrectly
2985         https://bugs.webkit.org/show_bug.cgi?id=74668
2986
2987         Reviewed by Darin Adler.
2988
2989         This patch updates our implementation to match a change to the HTML5
2990         specification regarding how <ruby> elements parse.  Previously, <rp>
2991         and similar tags used to pop the stack up to the <ruby> element.  Now
2992         the popping does not occur.
2993
2994         Tests: html5lib/runner.html
2995
2996         * html/parser/HTMLTreeBuilder.cpp:
2997
2998 2011-12-15  Daniel Sievers  <sievers@chromium.org>
2999
3000         [Chromium] Avoid strdup() for extra argument when tracing is disabled.
3001         https://bugs.webkit.org/show_bug.cgi?id=74637
3002
3003         Reviewed by James Robinson.
3004
3005         * platform/chromium/TraceEvent.h:
3006         (WebCore::internal::ScopeTracer::ScopeTracer):
3007
3008 2011-12-15  Rafael Weinstein  <rafaelw@chromium.org>
3009
3010         [MutationObservers] Add a document-level flag that can trivially be checked to avoid doing unnessary work if mutation observers absent
3011         https://bugs.webkit.org/show_bug.cgi?id=74641
3012
3013         Reviewed by Ojan Vafai.
3014
3015         This patch adds a byte of flags to Document, of which three bits are used to signal if any
3016         node owned by the document has a Mutation Observer of the given type. This is used to
3017         reduce the cost of discovering there are none to a single (inlined) method call and bit-check.
3018         Also, a similar byte of flags which was used to optimize a particular case when mutation observers
3019         are present has been removed, with the reasoning that we should first focus on minimizing impact on
3020         the null-case before optimizing particular in-use cases.
3021
3022         Also, MutationObserverInterestGroup is broken out into its own file (which probably should have happened
3023         earlier, but now avoids a circular header dependency).
3024
3025         No tests needed. This patch is just a refactor.
3026
3027         * CMakeLists.txt:
3028         * GNUmakefile.list.am:
3029         * Target.pri:
3030         * WebCore.gypi:
3031         * WebCore.vcproj/WebCore.vcproj:
3032         * WebCore.xcodeproj/project.pbxproj:
3033         * css/CSSMutableStyleDeclaration.cpp:
3034         * dom/CharacterData.cpp:
3035         * dom/ChildListMutationScope.cpp:
3036         * dom/Document.cpp:
3037         (WebCore::Document::Document):
3038         * dom/Document.h:
3039         (WebCore::Document::hasMutationObserversOfType):
3040         (WebCore::Document::hasMutationObservers):
3041         (WebCore::Document::addMutationObserverTypes):
3042         * dom/Element.cpp:
3043         * dom/MutationObserverInterestGroup.cpp: Added.
3044         (WebCore::MutationObserverInterestGroup::createIfNeeded):
3045         (WebCore::MutationObserverInterestGroup::MutationObserverInterestGroup):
3046         (WebCore::MutationObserverInterestGroup::isOldValueRequested):
3047         (WebCore::MutationObserverInterestGroup::enqueueMutationRecord):
3048         * dom/MutationObserverInterestGroup.h: Copied from Source/WebCore/dom/WebKitMutationObserver.h.
3049         (WebCore::MutationObserverInterestGroup::createForChildListMutation):
3050         (WebCore::MutationObserverInterestGroup::createForCharacterDataMutation):
3051         (WebCore::MutationObserverInterestGroup::createForAttributesMutation):
3052         (WebCore::MutationObserverInterestGroup::hasOldValue):
3053         * dom/Node.cpp:
3054         (WebCore::Node::didMoveToNewOwnerDocument):
3055         (WebCore::Node::getRegisteredMutationObserversOfType):
3056         (WebCore::Node::notifyMutationObserversNodeWillDetach):
3057         * dom/Node.h:
3058         * dom/WebKitMutationObserver.cpp:
3059         (WebCore::WebKitMutationObserver::observe):
3060         * dom/WebKitMutationObserver.h:
3061
3062 2011-12-15  Adam Barth  <abarth@webkit.org>
3063
3064         <!DOCTYPE html><pre>&#x0a;&#x0a;A</pre> doesn't parse correctly
3065         https://bugs.webkit.org/show_bug.cgi?id=74658
3066
3067         Reviewed by Darin Adler.
3068
3069         Previously, we handled skipping newlines after <pre> in the tokenizer,
3070         which isn't how the spec handles them.  Instead, the spec skips them in
3071         the tree builder.  This isn't usually observable, except in the case of
3072         an HTML entity.  In that case, the tokenzier sees '&' (because the
3073         entity hasn't been decoded yet), but the tree builder sees '\n' (the
3074         decoded entity).  This patch fixes the bug by more closely aligning our
3075         implementation with the spec.
3076
3077         Test: html5lib/runner.html
3078
3079         * html/parser/HTMLTokenizer.cpp:
3080         (WebCore::HTMLTokenizer::reset):
3081         (WebCore::HTMLTokenizer::nextToken):
3082         * html/parser/HTMLTokenizer.h:
3083         * html/parser/HTMLTreeBuilder.cpp:
3084         (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::skipAtMostOneLeadingNewline):
3085         (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
3086         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
3087         (WebCore::HTMLTreeBuilder::processCharacterBuffer):
3088         * html/parser/HTMLTreeBuilder.h:
3089         * xml/parser/MarkupTokenizerBase.h:
3090
3091 2011-12-15  Kenneth Russell  <kbr@google.com>
3092
3093         Unreviewed, rolling out r102989.
3094         http://trac.webkit.org/changeset/102989
3095         https://bugs.webkit.org/show_bug.cgi?id=74580
3096
3097         Caused SHOULD NOT BE REACHED assertions in debug builds.
3098
3099         * css/CSSComputedStyleDeclaration.cpp:
3100         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
3101         * css/CSSPrimitiveValueMappings.h:
3102         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3103         (WebCore::CSSPrimitiveValue::operator EBoxAlignment):
3104         * css/CSSStyleSelector.cpp:
3105         (WebCore::CSSStyleSelector::applyProperty):
3106         * rendering/RenderDeprecatedFlexibleBox.cpp:
3107         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
3108         (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
3109         * rendering/RenderFullScreen.cpp:
3110         (createFullScreenStyle):
3111         * rendering/style/RenderStyle.h:
3112         (WebCore::InheritedFlags::boxPack):
3113         (WebCore::InheritedFlags::setBoxAlign):
3114         (WebCore::InheritedFlags::setBoxPack):
3115         (WebCore::InheritedFlags::initialBoxPack):
3116         * rendering/style/RenderStyleConstants.h:
3117         * rendering/style/StyleDeprecatedFlexibleBoxData.h:
3118
3119 2011-12-15  Ryosuke Niwa  <rniwa@webkit.org>
3120
3121         Touch make_name.pl in an attempt to make Qt bots happy.
3122
3123         * dom/make_names.pl:
3124         (printNamesHeaderFile):
3125
3126 2011-12-15  Kentaro Hara  <haraken@chromium.org>
3127
3128         Unreviewed. Rebaselined run-bindings-tests results.
3129
3130         * bindings/scripts/test/JS/JSFloat64Array.cpp:
3131         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3132         * bindings/scripts/test/JS/JSTestObj.cpp:
3133
3134 2011-12-15  Luke Macpherson   <macpherson@chromium.org>
3135
3136         Separate box alignment and box pack values into separate enums.
3137         https://bugs.webkit.org/show_bug.cgi?id=74580
3138
3139         Reviewed by Darin Adler.
3140
3141         No new tests / refactoring only.
3142
3143         Separating these types cleans up the code by removing several assertions that
3144         values are in the correct ranges, as this is ensured by the type system.
3145
3146         * css/CSSComputedStyleDeclaration.cpp:
3147         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
3148         * css/CSSPrimitiveValueMappings.h:
3149         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3150         (WebCore::CSSPrimitiveValue::operator EBoxPack):
3151         (WebCore::CSSPrimitiveValue::operator EBoxAlignment):
3152         * css/CSSStyleSelector.cpp:
3153         (WebCore::CSSStyleSelector::applyProperty):
3154         * rendering/RenderDeprecatedFlexibleBox.cpp:
3155         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
3156         (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
3157         * rendering/RenderFullScreen.cpp:
3158         (createFullScreenStyle):
3159         * rendering/style/RenderStyle.h:
3160         (WebCore::InheritedFlags::boxPack):
3161         (WebCore::InheritedFlags::setBoxAlign):
3162         (WebCore::InheritedFlags::setBoxPack):
3163         (WebCore::InheritedFlags::initialBoxPack):
3164         * rendering/style/RenderStyleConstants.h:
3165         * rendering/style/StyleDeprecatedFlexibleBoxData.h:
3166
3167 2011-12-15  Kentaro Hara  <haraken@chromium.org>
3168
3169         REGRESSION(r102663): generate-bindings.pl runs every time
3170         https://bugs.webkit.org/show_bug.cgi?id=74481
3171
3172         Reviewed by Adam Barth.
3173
3174         See the comment #1 of bug 74481 for the cause of this bug.
3175
3176         This patch fixes generate-bindings.pl so that it generates .h and .cpp files
3177         even for IDL files that do not need .h and .cpp files. This is just to prevent
3178         build scripts from trying to generate .h and .cpp files at every build.
3179
3180         No new tests. No change in behavior.
3181
3182         * bindings/scripts/generate-bindings.pl:
3183         (generateEmptyHeaderAndCpp): Generates .h and .cpp files for IDL files
3184         that do not need .h and .cpp files.
3185         * bindings/scripts/test/CPP/CPPTestSupplemental.cpp: Added.
3186         * bindings/scripts/test/CPP/CPPTestSupplemental.h: Added.
3187         * bindings/scripts/test/GObject/GObjectTestSupplemental.cpp: Added.
3188         * bindings/scripts/test/GObject/GObjectTestSupplemental.h: Added.
3189         * bindings/scripts/test/JS/JSTestSupplemental.cpp: Added.
3190         * bindings/scripts/test/JS/JSTestSupplemental.h: Added.
3191         * bindings/scripts/test/ObjC/ObjCTestSupplemental.cpp: Added.
3192         * bindings/scripts/test/ObjC/ObjCTestSupplemental.h: Added.
3193         * bindings/scripts/test/V8/V8TestSupplemental.cpp: Added.
3194         * bindings/scripts/test/V8/V8TestSupplemental.h: Added.
3195
3196 2011-12-15  Jarred Nicholls  <jarred@sencha.com>
3197
3198         Unreviewed build fix. Mac build broken when CSS Filters enabled.
3199         Needed to move Filter headers out as private headers in WebCore.framework.
3200
3201         * WebCore.xcodeproj/project.pbxproj:
3202
3203 2011-12-15  Eric Seidel  <eric@webkit.org>
3204
3205         WebCore has two (disconnected) ways to keep track of updated widgets, should be unified
3206         https://bugs.webkit.org/show_bug.cgi?id=74367
3207
3208         Reviewed by Adam Barth.
3209
3210         It seems the FrameView updateWidgets set is needed for now,
3211         so just making FrameView::addWidgetToUpdate mark the DOM node
3212         as needing a widget update and later when it goes to call
3213         updateWidget() checking first if it needs an update.
3214
3215         No new tests, just adding an assert.
3216
3217         * html/HTMLEmbedElement.cpp:
3218         (WebCore::HTMLEmbedElement::updateWidget):
3219         * html/HTMLObjectElement.cpp:
3220         (WebCore::HTMLObjectElement::updateWidget):
3221         * html/HTMLPlugInImageElement.h:
3222         (WebCore::HTMLPlugInImageElement::needsWidgetUpdate):
3223         (WebCore::HTMLPlugInImageElement::setNeedsWidgetUpdate):
3224         * page/FrameView.cpp:
3225         (WebCore::FrameView::addWidgetToUpdate):
3226         (WebCore::FrameView::updateWidget):
3227
3228 2011-12-15  Alexandru Chiculita  <achicu@adobe.com>
3229
3230         Windows project file is broken. It has a missing </File> enclosing tag
3231         https://bugs.webkit.org/show_bug.cgi?id=74632
3232
3233         Reviewed by Anders Carlsson.
3234
3235         No new tests, just fixing the project file.
3236
3237         * WebCore.vcproj/WebCore.vcproj:
3238
3239 2011-12-15  Adam Barth  <abarth@webkit.org>
3240
3241         <table><tr><td><svg><desc><td> parses incorrectly
3242         https://bugs.webkit.org/show_bug.cgi?id=68106
3243
3244         Reviewed by Eric Seidel.
3245
3246         This patch updates our implementation of the HTML5 parser to account
3247         for recent changes in the spec.  The main change in this patch is to
3248         remove the "in foreign content" state from the tree builder.  Rather
3249         than maintaining this as a separate state, the parser now introspects
3250         on the stack of open elements to determine whether the parser is in
3251         foriegn content.  In the process, I've deleted some now-unused
3252         machinery in the tree builder.
3253
3254         Tested by the html5lib LayoutTests.  These tests show the progression
3255         in our spec compliance.
3256
3257         * html/parser/HTMLElementStack.cpp:
3258         * html/parser/HTMLElementStack.h:
3259         * html/parser/HTMLTreeBuilder.cpp:
3260         * html/parser/HTMLTreeBuilder.h:
3261         * mathml/mathattrs.in:
3262
3263 2011-12-15  Ryosuke Niwa  <rniwa@webkit.org>
3264
3265         m_hasCounterNodeMap and m_everHadLayout should be private to RenderObject
3266         https://bugs.webkit.org/show_bug.cgi?id=74645
3267
3268         Reviewed by Eric Seidel.
3269
3270         Made them private and added getters and setters as needed.
3271
3272         * rendering/RenderCounter.cpp:
3273         (WebCore::makeCounterNode):
3274         (WebCore::RenderCounter::destroyCounterNodes):
3275         (WebCore::updateCounters):
3276         (WebCore::RenderCounter::rendererStyleChanged):
3277         (showCounterRendererTree):
3278         * rendering/RenderFlowThread.cpp:
3279         (WebCore::RenderFlowThread::layout):
3280         * rendering/RenderObject.h:
3281         (WebCore::RenderObject::hasCounterNodeMap):
3282         (WebCore::RenderObject::setHasCounterNodeMap):
3283         (WebCore::RenderObject::everHadLayout):
3284         * rendering/svg/RenderSVGForeignObject.cpp:
3285         (WebCore::RenderSVGForeignObject::layout):
3286         * rendering/svg/RenderSVGImage.cpp:
3287         (WebCore::RenderSVGImage::layout):
3288         * rendering/svg/RenderSVGResourceContainer.cpp:
3289         (WebCore::RenderSVGResourceContainer::layout):
3290         * rendering/svg/RenderSVGResourceMarker.cpp:
3291         (WebCore::RenderSVGResourceMarker::layout):
3292         * rendering/svg/RenderSVGRoot.cpp:
3293         (WebCore::RenderSVGRoot::layout):
3294         * rendering/svg/RenderSVGShape.cpp:
3295         (WebCore::RenderSVGShape::layout):
3296         * rendering/svg/RenderSVGText.cpp:
3297         (WebCore::RenderSVGText::layout):
3298
3299 2011-12-15  Vsevolod Vlasov  <vsevik@chromium.org>
3300
3301         Not able to navigate the Resource tab options properly with arrow keys after adding the sticky-notes.
3302         https://bugs.webkit.org/show_bug.cgi?id=72013
3303
3304         Reviewed by Pavel Feldman.
3305
3306         * inspector/front-end/DatabaseQueryView.js:
3307         (WebInspector.DatabaseQueryView):
3308         (WebInspector.DatabaseQueryView.prototype._messagesClicked):
3309         * inspector/front-end/ResourcesPanel.js:
3310         (WebInspector.DatabaseTreeElement.prototype.onexpand):
3311
3312 2011-12-15  Anders Carlsson  <andersca@apple.com>
3313
3314         Add ScrollingCoordinator class and ENABLE_THREADED_SCROLLING define
3315         https://bugs.webkit.org/show_bug.cgi?id=74639
3316
3317         Reviewed by Andreas Kling.
3318
3319         Add a ScrollingCoordinator class and make it a member of Page. Tear it down
3320         when the page goes away.
3321
3322         * WebCore.xcodeproj/project.pbxproj:
3323         * page/Page.cpp:
3324         (WebCore::Page::Page):
3325         (WebCore::Page::~Page):
3326         * page/Page.h:
3327         (WebCore::Page::scrollingCoordinator):
3328         * page/ScrollingCoordinator.cpp: Added.
3329         (WebCore::ScrollingCoordinator::create):
3330         (WebCore::ScrollingCoordinator::ScrollingCoordinator):
3331         (WebCore::ScrollingCoordinator::~ScrollingCoordinator):
3332         (WebCore::ScrollingCoordinator::pageDestroyed):
3333         * page/ScrollingCoordinator.h: Added.
3334
3335 2011-12-15  Kenneth Russell  <kbr@google.com>
3336
3337         Rename WEBKIT_lose_context to WEBKIT_WEBGL_lose_context
3338         https://bugs.webkit.org/show_bug.cgi?id=71870
3339
3340         Reviewed by James Robinson.
3341
3342         Re-landing after original commit was rolled out.
3343
3344         Rename largely done with do-webcore-rename with a couple of
3345         necessary manual fixups. Ran WebGL layout tests.
3346
3347         * CMakeLists.txt:
3348         * DerivedSources.make:
3349         * DerivedSources.pri:
3350         * GNUmakefile.list.am:
3351         * Target.pri:
3352         * WebCore.gypi:
3353         * WebCore.xcodeproj/project.pbxproj:
3354         * bindings/js/JSWebGLRenderingContextCustom.cpp:
3355         (WebCore::toJS):
3356         * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
3357         (WebCore::toV8Object):
3358         * html/canvas/WebGLExtension.h:
3359         * html/canvas/WebGLLoseContext.cpp: Copied from Source/WebCore/html/canvas/WebKitLoseContext.cpp.
3360         (WebCore::WebGLLoseContext::WebGLLoseContext):
3361         (WebCore::WebGLLoseContext::~WebGLLoseContext):
3362         (WebCore::WebGLLoseContext::getName):
3363         (WebCore::WebGLLoseContext::create):
3364         (WebCore::WebGLLoseContext::loseContext):
3365         (WebCore::WebGLLoseContext::restoreContext):
3366         * html/canvas/WebGLLoseContext.h: Copied from Source/WebCore/html/canvas/WebKitLoseContext.h.
3367         * html/canvas/WebGLLoseContext.idl: Copied from Source/WebCore/html/canvas/WebKitLoseContext.idl.
3368         * html/canvas/WebGLRenderingContext.cpp:
3369         (WebCore::WebGLRenderingContext::getExtension):
3370         (WebCore::WebGLRenderingContext::getSupportedExtensions):
3371         (WebCore::WebGLRenderingContext::maybeRestoreContext):
3372         * html/canvas/WebGLRenderingContext.h:
3373         * html/canvas/WebKitLoseContext.cpp: Removed.
3374         * html/canvas/WebKitLoseContext.h: Removed.
3375         * html/canvas/WebKitLoseContext.idl: Removed.
3376
3377 2011-12-15  Brady Eidson  <beidson@apple.com>
3378
3379         https://bugs.webkit.org/show_bug.cgi?id=74631
3380         HTMLMediaElement should not register for document activation callbacks as it doesn't use them
3381
3382         Reviewed by Eric Carlson.
3383
3384         No new tests. (No behavior change, pruning useless code)
3385
3386         * html/HTMLMediaElement.cpp:
3387         (WebCore::HTMLMediaElement::HTMLMediaElement):
3388         (WebCore::HTMLMediaElement::~HTMLMediaElement):
3389         (WebCore::HTMLMediaElement::willMoveToNewOwnerDocument):
3390         (WebCore::HTMLMediaElement::didMoveToNewOwnerDocument):
3391
3392 2011-12-15  Eric Carlson  <eric.carlson@apple.com>
3393
3394         Text tracks should be treated differently according to their kind
3395         https://bugs.webkit.org/show_bug.cgi?id=72547
3396
3397         Reviewed by Sam Weinig.
3398
3399         Tests: media/track/track-default-attribute.html
3400                media/track/track-mode-not-changed-by-new-track.html
3401                media/track/track-mode-triggers-loading.html
3402
3403         * html/HTMLAudioElement.cpp:
3404         (WebCore::HTMLAudioElement::HTMLAudioElement): Add "createdByParser" parameter.
3405         (WebCore::HTMLAudioElement::create): Ditto.
3406         (WebCore::HTMLAudioElement::createForJSConstructor): Deal with constructor change.
3407         * html/HTMLAudioElement.h:
3408
3409         * html/HTMLMediaElement.cpp:
3410         (WebCore::HTMLMediaElement::HTMLMediaElement): Add "createdByParser" parameter. Initialize m_parsingInProgress.
3411         (WebCore::HTMLMediaElement::finishParsingChildren): Clear m_parsingInProgress. Schedule track
3412             loading if necessary.
3413         (WebCore::HTMLMediaElement::loadTimerFired): Call configureTextTracks not call scheduleLoad, 
3414             it just schedules the load timer again.
3415         (WebCore::HTMLMediaElement::prepareForLoad): Add all non-disabled track elements to a vector
3416             so we can prevent the media element's readyState from reaching HAVE_METADATA until the
3417             tracks are ready.
3418         (WebCore::HTMLMediaElement::textTracksAreReady): New. Return false unless all tracks that were
3419             not disabled when loading started have loaded or failed.
3420         (WebCore::HTMLMediaElement::textTrackReadyStateChanged): Call setReadyState when a track is
3421             stops loading.
3422         (WebCore::HTMLMediaElement::textTrackModeChanged): Trigger <track> loading when the mode
3423             changes to hidden or showing for the first time.
3424         (WebCore::HTMLMediaElement::setReadyState): Do not advance to HAVE_METADATA or higher while
3425             track elements are loading.
3426         (WebCore::HTMLMediaElement::addTrack): Removed.
3427         (WebCore::HTMLMediaElement::showingTrackWithSameKind): New.
3428         (WebCore::HTMLMediaElement::trackWasAdded):
3429         (WebCore::HTMLMediaElement::trackWillBeRemoved): Flag a track as unconfigured so it will be
3430             reconfigured if it is added to another element.
3431         (WebCore::HTMLMediaElement::userIsInterestedInThisLanguage): New.
3432         (WebCore::HTMLMediaElement::userIsInterestedInThisTrack): New. Consider user preferences.
3433         (WebCore::HTMLMediaElement::configureTextTrack): New. Configure a track as per the user's preferences.
3434         (WebCore::HTMLMediaElement::configureTextTracks): New. Configure all track elements.
3435         * html/HTMLMediaElement.h:
3436         * html/HTMLMediaElement.h:
3437
3438         * html/HTMLTagNames.in: Add constructorNeedsCreatedByParser to audio and video.
3439
3440         * html/HTMLTrackElement.cpp:
3441         (WebCore::HTMLTrackElement::HTMLTrackElement): Initialize m_hasBeenConfigured.
3442         * html/HTMLTrackElement.h:
3443         (WebCore::HTMLTrackElement::hasBeenConfigured):
3444         (WebCore::HTMLTrackElement::setHasBeenConfigured):
3445
3446         * html/HTMLVideoElement.cpp:
3447         (WebCore::HTMLVideoElement::HTMLVideoElement): Add "createdByParser" parameter.
3448         (WebCore::HTMLVideoElement::create): Ditto.
3449         * html/HTMLVideoElement.h:
3450
3451         * html/TextTrack.cpp:
3452         (WebCore::TextTrack::TextTrack): Initialize m_mode to DISABLED, not HIDDEN. Initialize m_showingByDefault.
3453         (WebCore::TextTrack::setMode): Clear the "showing by default" flag when a track's mode is
3454             explicitly set to SHOWING.
3455         (WebCore::TextTrack::mode): Return SHOWING whenever the "showing by default" flag is set.
3456         * html/TextTrack.h:
3457         (WebCore::TextTrack::showingByDefault):
3458         (WebCore::TextTrack::setShowingByDefault):
3459
3460         * html/TextTrackCue.cpp:
3461         (WebCore::TextTrackCue::isActive): Return false if a cue has no track, or if its track is disabled.
3462         (WebCore::TextTrackCue::setIsActive): Don't