Adopt WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics and WebKit::Netwo...
[WebKit-https.git] / Source / WebCore / ChangeLog-2014-02-20
1 2014-02-20  Dean Jackson  <dino@apple.com>
2
3         An unresolved WebGL Context should operate normally until used
4         https://bugs.webkit.org/show_bug.cgi?id=129110
5
6         Reviewed by Brent Fulgham.
7
8         Add the ability to create a special instance of WebGLRenderingContext,
9         that appears normal but won't actually do anything if asked. This will
10         be created in the case of the WebGLLoadPolicy being "pending" and helps
11         in the case of pages that feature detect by creating a context and
12         immediately deleting it.
13
14         Note that the context doesn't actually try to recover from this state
15         yet, although that would be a nice addition. When asked to do something
16         it could actually try to create the GraphicsContext3D. However, if it
17         fails it would then have to fire a context lost.
18
19         * html/HTMLCanvasElement.cpp:
20         (WebCore::HTMLCanvasElement::getContext): Move the load policy code out of getContext.
21         * html/canvas/WebGLRenderingContext.cpp:
22         (WebCore::WebGLRenderingContext::create): Add the ability to create a pending context.
23         (WebCore::WebGLRenderingContext::WebGLRenderingContext): New constructor for a pending context.
24         (WebCore::WebGLRenderingContext::~WebGLRenderingContext): Only delete if not pending.
25         (WebCore::WebGLRenderingContext::destroyGraphicsContext3D): Ditto.
26         (WebCore::WebGLRenderingContext::clearIfComposited): Everything below is about checking the
27         pending state before doing anything, and triggering a resolution if necessary.
28         (WebCore::WebGLRenderingContext::activeTexture):
29         (WebCore::WebGLRenderingContext::attachShader):
30         (WebCore::WebGLRenderingContext::bindAttribLocation):
31         (WebCore::WebGLRenderingContext::checkObjectToBeBound):
32         (WebCore::WebGLRenderingContext::blendColor):
33         (WebCore::WebGLRenderingContext::blendEquation):
34         (WebCore::WebGLRenderingContext::blendEquationSeparate):
35         (WebCore::WebGLRenderingContext::blendFunc):
36         (WebCore::WebGLRenderingContext::blendFuncSeparate):
37         (WebCore::WebGLRenderingContext::bufferData):
38         (WebCore::WebGLRenderingContext::bufferSubData):
39         (WebCore::WebGLRenderingContext::checkFramebufferStatus):
40         (WebCore::WebGLRenderingContext::clear):
41         (WebCore::WebGLRenderingContext::clearColor):
42         (WebCore::WebGLRenderingContext::clearDepth):
43         (WebCore::WebGLRenderingContext::clearStencil):
44         (WebCore::WebGLRenderingContext::colorMask):
45         (WebCore::WebGLRenderingContext::compileShader):
46         (WebCore::WebGLRenderingContext::compressedTexImage2D):
47         (WebCore::WebGLRenderingContext::compressedTexSubImage2D):
48         (WebCore::WebGLRenderingContext::copyTexImage2D):
49         (WebCore::WebGLRenderingContext::copyTexSubImage2D):
50         (WebCore::WebGLRenderingContext::createBuffer):
51         (WebCore::WebGLRenderingContext::createFramebuffer):
52         (WebCore::WebGLRenderingContext::createTexture):
53         (WebCore::WebGLRenderingContext::createProgram):
54         (WebCore::WebGLRenderingContext::createRenderbuffer):
55         (WebCore::WebGLRenderingContext::createShader):
56         (WebCore::WebGLRenderingContext::cullFace):
57         (WebCore::WebGLRenderingContext::deleteObject):
58         (WebCore::WebGLRenderingContext::depthFunc):
59         (WebCore::WebGLRenderingContext::depthMask):
60         (WebCore::WebGLRenderingContext::depthRange):
61         (WebCore::WebGLRenderingContext::detachShader):
62         (WebCore::WebGLRenderingContext::disable):
63         (WebCore::WebGLRenderingContext::disableVertexAttribArray):
64         (WebCore::WebGLRenderingContext::validateDrawArrays):
65         (WebCore::WebGLRenderingContext::validateDrawElements):
66         (WebCore::WebGLRenderingContext::enable):
67         (WebCore::WebGLRenderingContext::enableVertexAttribArray):
68         (WebCore::WebGLRenderingContext::finish):
69         (WebCore::WebGLRenderingContext::flush):
70         (WebCore::WebGLRenderingContext::framebufferRenderbuffer):
71         (WebCore::WebGLRenderingContext::framebufferTexture2D):
72         (WebCore::WebGLRenderingContext::frontFace):
73         (WebCore::WebGLRenderingContext::generateMipmap):
74         (WebCore::WebGLRenderingContext::getActiveAttrib):
75         (WebCore::WebGLRenderingContext::getActiveUniform):
76         (WebCore::WebGLRenderingContext::getAttachedShaders):
77         (WebCore::WebGLRenderingContext::getAttribLocation):
78         (WebCore::WebGLRenderingContext::getBufferParameter):
79         (WebCore::WebGLRenderingContext::getContextAttributes):
80         (WebCore::WebGLRenderingContext::getExtension):
81         (WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter):
82         (WebCore::WebGLRenderingContext::getParameter):
83         (WebCore::WebGLRenderingContext::getProgramParameter):
84         (WebCore::WebGLRenderingContext::getProgramInfoLog):
85         (WebCore::WebGLRenderingContext::getRenderbufferParameter):
86         (WebCore::WebGLRenderingContext::getShaderParameter):
87         (WebCore::WebGLRenderingContext::getShaderInfoLog):
88         (WebCore::WebGLRenderingContext::getShaderPrecisionFormat):
89         (WebCore::WebGLRenderingContext::getShaderSource):
90         (WebCore::WebGLRenderingContext::getTexParameter):
91         (WebCore::WebGLRenderingContext::getUniform):
92         (WebCore::WebGLRenderingContext::getUniformLocation):
93         (WebCore::WebGLRenderingContext::getVertexAttrib):
94         (WebCore::WebGLRenderingContext::getVertexAttribOffset):
95         (WebCore::WebGLRenderingContext::hint):
96         (WebCore::WebGLRenderingContext::isBuffer):
97         (WebCore::WebGLRenderingContext::isContextLostOrPending):
98         (WebCore::WebGLRenderingContext::isEnabled):
99         (WebCore::WebGLRenderingContext::isFramebuffer):
100         (WebCore::WebGLRenderingContext::isProgram):
101         (WebCore::WebGLRenderingContext::isRenderbuffer):
102         (WebCore::WebGLRenderingContext::isShader):
103         (WebCore::WebGLRenderingContext::isTexture):
104         (WebCore::WebGLRenderingContext::lineWidth):
105         (WebCore::WebGLRenderingContext::linkProgram):
106         (WebCore::WebGLRenderingContext::pixelStorei):
107         (WebCore::WebGLRenderingContext::polygonOffset):
108         (WebCore::WebGLRenderingContext::readPixels):
109         (WebCore::WebGLRenderingContext::releaseShaderCompiler):
110         (WebCore::WebGLRenderingContext::renderbufferStorage):
111         (WebCore::WebGLRenderingContext::sampleCoverage):
112         (WebCore::WebGLRenderingContext::scissor):
113         (WebCore::WebGLRenderingContext::shaderSource):
114         (WebCore::WebGLRenderingContext::stencilFunc):
115         (WebCore::WebGLRenderingContext::stencilFuncSeparate):
116         (WebCore::WebGLRenderingContext::stencilMask):
117         (WebCore::WebGLRenderingContext::stencilMaskSeparate):
118         (WebCore::WebGLRenderingContext::stencilOp):
119         (WebCore::WebGLRenderingContext::stencilOpSeparate):
120         (WebCore::WebGLRenderingContext::texImage2D):
121         (WebCore::WebGLRenderingContext::texParameter):
122         (WebCore::WebGLRenderingContext::texSubImage2D):
123         (WebCore::WebGLRenderingContext::uniform1f):
124         (WebCore::WebGLRenderingContext::uniform1fv):
125         (WebCore::WebGLRenderingContext::uniform1i):
126         (WebCore::WebGLRenderingContext::uniform1iv):
127         (WebCore::WebGLRenderingContext::uniform2f):
128         (WebCore::WebGLRenderingContext::uniform2fv):
129         (WebCore::WebGLRenderingContext::uniform2i):
130         (WebCore::WebGLRenderingContext::uniform2iv):
131         (WebCore::WebGLRenderingContext::uniform3f):
132         (WebCore::WebGLRenderingContext::uniform3fv):
133         (WebCore::WebGLRenderingContext::uniform3i):
134         (WebCore::WebGLRenderingContext::uniform3iv):
135         (WebCore::WebGLRenderingContext::uniform4f):
136         (WebCore::WebGLRenderingContext::uniform4fv):
137         (WebCore::WebGLRenderingContext::uniform4i):
138         (WebCore::WebGLRenderingContext::uniform4iv):
139         (WebCore::WebGLRenderingContext::uniformMatrix2fv):
140         (WebCore::WebGLRenderingContext::uniformMatrix3fv):
141         (WebCore::WebGLRenderingContext::uniformMatrix4fv):
142         (WebCore::WebGLRenderingContext::validateProgram):
143         (WebCore::WebGLRenderingContext::vertexAttribPointer):
144         (WebCore::WebGLRenderingContext::viewport):
145         (WebCore::WebGLRenderingContext::forceLostContext):
146         (WebCore::WebGLRenderingContext::forceRestoreContext):
147         (WebCore::WebGLRenderingContext::platformLayer):
148         (WebCore::WebGLRenderingContext::removeSharedObject):
149         (WebCore::WebGLRenderingContext::addSharedObject):
150         (WebCore::WebGLRenderingContext::removeContextObject):
151         (WebCore::WebGLRenderingContext::addContextObject):
152         (WebCore::WebGLRenderingContext::detachAndRemoveAllObjects):
153         (WebCore::WebGLRenderingContext::stop):
154         (WebCore::WebGLRenderingContext::vertexAttribfImpl):
155         (WebCore::WebGLRenderingContext::vertexAttribfvImpl):
156         (WebCore::WebGLRenderingContext::vertexAttribDivisor):
157         * html/canvas/WebGLRenderingContext.h:
158
159 2014-02-20  Dean Jackson  <dino@apple.com>
160
161         Add an unresolved WebGLPolicy and an API to resolve it
162         https://bugs.webkit.org/show_bug.cgi?id=129109
163
164         Reviewed by Anders Carlsson.
165
166         Add a third WebGLLoadPolicy which is "pending" allowing the page
167         to go ahead with creating the WebGLRenderingContext and resolve the policy
168         at a later time. Add a new API resolveWebGLLoadPolicy to do the resolution.
169
170         * html/HTMLCanvasElement.cpp:
171         (WebCore::HTMLCanvasElement::getContext): WebGLBlock -> WebGLBlockCreation
172         * loader/FrameLoaderClient.h:
173         (WebCore::FrameLoaderClient::webGLPolicyForURL): WebGLAllow -> WebGLAllowCreation.
174         (WebCore::FrameLoaderClient::resolveWebGLPolicyForURL): New method.
175         * loader/FrameLoaderTypes.h: Add WebGLPendingCreation.
176
177 2014-02-20  Zalan Bujtas  <zalan@apple.com>
178
179         Subpixel rendering: Enable compositing RenderLayer painting on device pixel position.
180         https://bugs.webkit.org/show_bug.cgi?id=128509
181
182         Reviewed by Simon Fraser.
183
184         GraphicsLayer is now positioned on device pixel boundary. This enables us to put
185         compositing layers on a subpixel position and animate them with device pixel
186         precision.
187
188         Tests: fast/sub-pixel/compositing-layers-on-subpixel-position.html
189                fast/sub-pixel/simple-clipping.html
190
191         * platform/LayoutUnit.h:
192         (WebCore::ceilToDevicePixel):
193         * platform/graphics/LayoutPoint.h:
194         (WebCore::flooredForPainting):
195         (WebCore::ceiledForPainting):
196         * platform/graphics/LayoutRect.cpp:
197         (WebCore::enclosingRectForPainting):
198         * platform/graphics/LayoutRect.h:
199         * rendering/RenderLayer.cpp:
200         (WebCore::RenderLayer::clipToRect):
201         * rendering/RenderLayerBacking.cpp:
202         (WebCore::clipBox):
203         (WebCore::pixelFractionForLayerPainting):
204         (WebCore::calculateDevicePixelOffsetFromRenderer):
205         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
206         (WebCore::RenderLayerBacking::paintIntoLayer):
207         * rendering/RenderLayerBacking.h:
208
209 2014-02-20  Bem Jones-Bey  <bjonesbe@adobe.com>
210
211         Rename border/padding/margin width/height to horizontal/vertical extent on RenderBoxModelObject
212         https://bugs.webkit.org/show_bug.cgi?id=129043
213
214         Reviewed by David Hyatt.
215
216         Using horizontal extent instead of width and vertical extent instead
217         of height makes it more obvious that these are measurements of both
218         border/margin/padding sides, not just one.
219
220         As David Hyatt put it: "I dislike using terms like 'width' since it
221         could be confused with the actual border-width CSS name, i.e., a
222         person new to this code would think the method was returning the pixel
223         width of a single border."
224
225         No new tests, no behavior change.
226
227         * html/HTMLAppletElement.cpp:
228         (WebCore::HTMLAppletElement::updateWidget):
229         * inspector/InspectorOverlay.cpp:
230         * rendering/RenderBlockLineLayout.cpp:
231         (WebCore::RenderBlockFlow::checkFloatsInCleanLine):
232         * rendering/RenderBox.cpp:
233         (WebCore::RenderBox::repaintLayerRectsForImage):
234         (WebCore::RenderBox::positionForPoint):
235         * rendering/RenderBoxModelObject.h:
236         (WebCore::RenderBoxModelObject::horizontalBorderExtent):
237         (WebCore::RenderBoxModelObject::verticalBorderExtent):
238         (WebCore::RenderBoxModelObject::verticalBorderAndPaddingExtent):
239         (WebCore::RenderBoxModelObject::horizontalBorderAndPaddingExtent):
240         (WebCore::RenderBoxModelObject::verticalMarginExtent):
241         (WebCore::RenderBoxModelObject::horizontalMarginExtent):
242         * rendering/RenderDeprecatedFlexibleBox.cpp:
243         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
244         (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
245         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
246         * rendering/RenderFieldset.cpp:
247         (WebCore::RenderFieldset::computePreferredLogicalWidths):
248         * rendering/RenderFileUploadControl.cpp:
249         (WebCore::RenderFileUploadControl::computePreferredLogicalWidths):
250         * rendering/RenderFlexibleBox.cpp:
251         (WebCore::RenderFlexibleBox::crossAxisMarginExtentForChild):
252         (WebCore::RenderFlexibleBox::mainAxisBorderAndPaddingExtentForChild):
253         (WebCore::RenderFlexibleBox::computeNextFlexLine):
254         * rendering/RenderInline.cpp:
255         (WebCore::RenderInline::localCaretRect):
256         (WebCore::RenderInline::generateCulledLineBoxRects):
257         * rendering/RenderLayer.cpp:
258         (WebCore::RenderLayer::resize):
259         * rendering/RenderListBox.cpp:
260         (WebCore::RenderListBox::computePreferredLogicalWidths):
261         (WebCore::RenderListBox::computeLogicalHeight):
262         * rendering/RenderMenuList.cpp:
263         (RenderMenuList::computePreferredLogicalWidths):
264         * rendering/RenderScrollbar.cpp:
265         (WebCore::RenderScrollbar::trackPieceRectWithMargins):
266         * rendering/RenderSlider.cpp:
267         (WebCore::RenderSlider::computePreferredLogicalWidths):
268         * rendering/RenderTextControl.cpp:
269         (WebCore::RenderTextControl::computeLogicalHeight):
270         * rendering/RenderTextControlSingleLine.cpp:
271         (WebCore::RenderTextControlSingleLine::layout):
272         * rendering/line/LineLayoutState.h:
273         (WebCore::FloatWithRect::FloatWithRect):
274         * rendering/shapes/ShapeInfo.cpp:
275         (WebCore::ShapeInfo<RenderType>::setReferenceBoxLogicalSize):
276         * rendering/svg/RenderSVGRoot.cpp:
277         (WebCore::RenderSVGRoot::updateCachedBoundaries):
278
279 2014-02-20  Bem Jones-Bey  <bjonesbe@adobe.com>
280
281         Rename RenderBlockFlow::clearFloats and RenderBlockFlow::newLine to be more accurate
282         https://bugs.webkit.org/show_bug.cgi?id=128991
283
284         Reviewed by David Hyatt.
285
286         Rename clearFloats to rebuildFloatingObjectSetFromIntrudingFloats
287         since it does just that.
288
289         Rename newLine to clearFloats because it actually does what the CSS
290         spec calls clearing floats. This also matches clearFloatsIfNeeded.
291
292         This also removes a FIXME comment that points to a bug that has
293         already been fixed.
294
295         This patch is based on a Blink patch by leviw:
296         https://src.chromium.org/viewvc/blink?revision=158598&view=revision
297
298         No new tests, no behavior change.
299
300         * rendering/RenderBlockFlow.cpp:
301         (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
302         (WebCore::RenderBlockFlow::layoutBlock):
303         (WebCore::RenderBlockFlow::clearFloats):
304         * rendering/RenderBlockFlow.h:
305         * rendering/RenderBlockLineLayout.cpp:
306         (WebCore::RenderBlockFlow::layoutRunsAndFloats):
307         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
308         * rendering/line/BreakingContextInlineHeaders.h:
309         (WebCore::BreakingContext::handleFloat):
310         * rendering/svg/RenderSVGText.cpp:
311         (WebCore::RenderSVGText::layout):
312
313 2014-02-19  Pratik Solanki  <psolanki@apple.com>
314
315         ASSERT in FrameLoader::shouldInterruptLoadForXFrameOptions
316         https://bugs.webkit.org/show_bug.cgi?id=129081
317         <rdar://problem/16026440>
318
319         Reviewed by Alexey Proskuryakov.
320
321         Do not assert if the server sends us a malformed X-Frame-Options header.
322
323         * loader/FrameLoader.cpp:
324         (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
325
326 2014-02-20  Krzysztof Czech  <k.czech@samsung.com>
327
328         AX: Use auto to reduce some code in loops
329         https://bugs.webkit.org/show_bug.cgi?id=129087
330
331         Reviewed by Chris Fleizach.
332
333         Use auto where appropriate to reduce some code.
334
335         * accessibility/AccessibilityObject.cpp:
336         (WebCore::AccessibilityObject::boundingBoxForQuads):
337         (WebCore::AccessibilityObject::ariaRoleToWebCoreRole):
338         * accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp:
339         (webkitAccessibleHypertextGetNLinks):
340
341 2014-02-20  Commit Queue  <commit-queue@webkit.org>
342
343         Unreviewed, rolling out r164422.
344         http://trac.webkit.org/changeset/164422
345         https://bugs.webkit.org/show_bug.cgi?id=129102
346
347         Causes assertions in
348         ScriptExecutionContext::canSuspendActiveDOMObjects()
349         (Requested by zdobersek on #webkit).
350
351         * dom/KeyboardEvent.cpp:
352         (WebCore::KeyboardEvent::KeyboardEvent):
353         * dom/KeyboardEvent.h:
354         * dom/ScriptExecutionContext.cpp:
355         (WebCore::ScriptExecutionContext::reportException):
356         (WebCore::ScriptExecutionContext::publicURLManager):
357         * dom/ScriptExecutionContext.h:
358         * dom/ScriptRunner.h:
359
360 2014-02-20  Zan Dobersek  <zdobersek@igalia.com>
361
362         Move to using std::unique_ptr for VisitedLinkState, CheckedRadioButtons
363         https://bugs.webkit.org/show_bug.cgi?id=128967
364
365         Reviewed by Andreas Kling.
366
367         Replace uses of OwnPtr and PassOwnPtr in the VisitedLinkState and
368         CheckedRadioButtons classes with std::unique_ptr.
369
370         * dom/CheckedRadioButtons.cpp:
371         (WebCore::RadioButtonGroup::RadioButtonGroup):
372         (WebCore::RadioButtonGroup::remove):
373         (WebCore::CheckedRadioButtons::addButton):
374         (WebCore::CheckedRadioButtons::removeButton):
375         * dom/CheckedRadioButtons.h:
376         * dom/Document.cpp:
377         (WebCore::Document::Document):
378         * dom/Document.h:
379         * dom/VisitedLinkState.cpp:
380         * dom/VisitedLinkState.h:
381
382 2014-02-20  Artur Moryc  <a.moryc@samsung.com>
383
384         AX: Children Nodes for Canvas objects are not equal to Render Objects.
385         https://bugs.webkit.org/show_bug.cgi?id=123568
386
387         Reviewed by Chris Fleizach.
388
389         There is a difference in children nodes taken into account for RenderObject
390         and for NodeObject types. There is a problem with text nodes that are
391         focusable for EFL/GTK and therefore are not filtered out in the test like it
392         happens for the MAC port. Text nodes are eliminated in the
393         AccessibilityRenderObject::computeAccessibilityIsIgnored() method. The same
394         approach has been applied to the NodeObject to eliminate text nodes.
395
396         Covered by existing tests.
397
398         * accessibility/AccessibilityNodeObject.cpp:
399         (WebCore::AccessibilityNodeObject::computeAccessibilityIsIgnored):
400
401 2014-02-20  Zan Dobersek  <zdobersek@igalia.com>
402
403         Move to using std::unique_ptr for KeyboardEvent, ScriptExecutionContext::PendingException
404         https://bugs.webkit.org/show_bug.cgi?id=129061
405
406         Reviewed by Andreas Kling.
407
408         Replace uses of OwnPtr and PassOwnPtr for KeyboardEvent and ScriptExecutionContext::PendingException
409         classes with std::unique_ptr. ScriptExecutionContext::Task objects are still handled through OwnPtr,
410         but this will be addressed later.
411
412         * dom/KeyboardEvent.cpp:
413         (WebCore::KeyboardEvent::KeyboardEvent):
414         * dom/KeyboardEvent.h:
415         * dom/ScriptExecutionContext.cpp:
416         (WebCore::ScriptExecutionContext::reportException):
417         (WebCore::ScriptExecutionContext::publicURLManager):
418         * dom/ScriptExecutionContext.h:
419         * dom/ScriptRunner.h: Remove an unnecessary PassOwnPtr header inclusion.
420
421 2014-02-20  Zan Dobersek  <zdobersek@igalia.com>
422
423         Move to using std::unique_ptr for EventListenerMap, EventTarget
424         https://bugs.webkit.org/show_bug.cgi?id=129062
425
426         Reviewed by Andreas Kling.
427
428         Replace uses of OwnPtr and PassOwnPtr in the EventListenerMap and
429         EventTarget classes with std::unique_ptr.
430
431         * dom/EventListenerMap.cpp:
432         (WebCore::EventListenerMap::add):
433         * dom/EventListenerMap.h:
434         * dom/EventTarget.cpp:
435         (WebCore::EventTarget::fireEventListeners):
436         * dom/EventTarget.h:
437
438 2014-02-20  Zan Dobersek  <zdobersek@igalia.com>
439
440         Move to using std::unique_ptr for Document and related classes
441         https://bugs.webkit.org/show_bug.cgi?id=129063
442
443         Reviewed by Anders Carlsson.
444
445         Replace uses of OwnPtr and PassOwnPtr in the Document and related classes with std::unique_ptr.
446
447         * dom/DOMImplementation.h:
448         * dom/Document.cpp:
449         (WebCore::Document::Document):
450         (WebCore::Document::removedLastRef):
451         (WebCore::Document::selectorQueryCache):
452         (WebCore::Document::implementation):
453         (WebCore::Document::formController):
454         (WebCore::Document::createStyleResolver):
455         (WebCore::Document::clearStyleResolver):
456         (WebCore::Document::clearAXObjectCache):
457         (WebCore::Document::axObjectCache):
458         (WebCore::Document::setParsing):
459         (WebCore::Document::styleResolverChanged):
460         (WebCore::Document::setTransformSource):
461         (WebCore::Document::accessSVGExtensions):
462         (WebCore::Document::sharedObjectPoolClearTimerFired):
463         (WebCore::Document::didAddTouchEventHandler):
464         * dom/Document.h:
465         * dom/DocumentEventQueue.cpp:
466         (WebCore::DocumentEventQueue::DocumentEventQueue):
467         * dom/DocumentEventQueue.h:
468         * dom/DocumentMarkerController.cpp:
469         (WebCore::DocumentMarkerController::addMarker):
470         * dom/DocumentMarkerController.h:
471         * dom/DocumentSharedObjectPool.cpp:
472         * dom/DocumentSharedObjectPool.h:
473         * dom/DocumentStyleSheetCollection.cpp:
474         (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets):
475         (WebCore::DocumentStyleSheetCollection::activeStyleSheetsContains):
476         * dom/DocumentStyleSheetCollection.h:
477         * dom/DocumentType.h:
478         * html/FormController.h:
479         * rendering/TextAutosizer.h:
480         * xml/parser/XMLDocumentParserLibxml2.cpp:
481         (WebCore::XMLDocumentParser::doEnd):
482
483 2014-02-20  Mihnea Ovidenie  <mihnea@adobe.com>
484
485         [CSSRegions] Add helper method for region clipping flow content
486         https://bugs.webkit.org/show_bug.cgi?id=129036
487
488         Reviewed by Andrei Bucur.
489
490         Add helper method to test whether a region should clip the flow thread content
491         and use it thoughout the code.
492         Code refactoring, no functionality change, no new tests.
493
494         * rendering/RenderLayer.cpp:
495         (WebCore::RenderLayer::calculateClipRects):
496         * rendering/RenderRegion.cpp:
497         (WebCore::RenderRegion::overflowRectForFlowThreadPortion):
498         (WebCore::RenderRegion::shouldClipFlowThreadContent):
499         (WebCore::RenderRegion::rectFlowPortionForBox):
500         * rendering/RenderRegion.h:
501
502 2014-02-20  Frédéric Wang  <fred.wang@free.fr>
503
504         Implement the MathML Operator Dictionary.
505         https://bugs.webkit.org/show_bug.cgi?id=99620
506
507         Reviewed by Chris Fleizach.
508
509         The MathML Operator Dictionary is implemented and the corresponding mo
510         attributes are parsed. Currently, only the stretchy property is used for
511         the visual rendering and the fence/separators properties are used by the
512         accessibility code. Very basic heuristics to determine the form are also
513         added.
514
515         Tests: mathml/presentation/mo-form-fallback.html
516                mathml/presentation/mo-form-stretchy.html
517                mathml/presentation/mo-invalid-attributes.html
518
519         * accessibility/AccessibilityRenderObject.cpp:
520         (WebCore::AccessibilityRenderObject::isMathFenceOperator):
521         (WebCore::AccessibilityRenderObject::isMathSeparatorOperator):
522         * mathml/mathattrs.in:
523         * rendering/mathml/RenderMathMLFenced.cpp:
524         (WebCore::RenderMathMLFenced::createMathMLOperator):
525         (WebCore::RenderMathMLFenced::makeFences):
526         (WebCore::RenderMathMLFenced::addChild):
527         * rendering/mathml/RenderMathMLFenced.h:
528         * rendering/mathml/RenderMathMLOperator.cpp:
529         (WebCore::MathMLOperatorDictionary::ExtractKey):
530         (WebCore::MathMLOperatorDictionary::ExtractChar):
531         (WebCore::RenderMathMLOperator::RenderMathMLOperator):
532         (WebCore::RenderMathMLOperator::setOperatorFlagFromAttribute):
533         (WebCore::RenderMathMLOperator::setOperatorPropertiesFromOpDictEntry):
534         (WebCore::RenderMathMLOperator::SetOperatorProperties):
535         (WebCore::RenderMathMLOperator::advanceForCharacter):
536         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths):
537         (WebCore::RenderMathMLOperator::updateFromElement):
538         (WebCore::RenderMathMLOperator::shouldAllowStretching):
539         (WebCore::RenderMathMLOperator::updateStyle):
540         * rendering/mathml/RenderMathMLOperator.h:
541
542 2014-02-19  Zalan Bujtas  <zalan@apple.com>
543
544         Subpixel rendering: Make GraphicsLayer's offsetFromRenderer subpixel position based.
545         https://bugs.webkit.org/show_bug.cgi?id=128694
546
547         Reviewed by Simon Fraser.
548
549         Changing layers from using integral types to using Float/LayoutUnits so that
550         we can position them on subpixels. They are still integral positioned though.
551
552         Covered by existing tests.
553
554         * platform/graphics/GraphicsLayer.cpp:
555         (WebCore::GraphicsLayer::setOffsetFromRenderer):
556         (WebCore::GraphicsLayer::paintGraphicsLayerContents):
557         * platform/graphics/GraphicsLayer.h:
558         (WebCore::GraphicsLayer::offsetFromRenderer): removed incorrect comment.
559         * rendering/RenderLayerBacking.cpp:
560         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
561         (WebCore::RenderLayerBacking::adjustAncestorCompositingBoundsForFlowThread):
562         (WebCore::RenderLayerBacking::positionOverflowControlsLayers):
563         (WebCore::RenderLayerBacking::computeTransformOrigin):
564         (WebCore::RenderLayerBacking::computePerspectiveOrigin):
565         * rendering/RenderLayerBacking.h:
566         * rendering/RenderLayerCompositor.cpp:
567         (WebCore::RenderLayerCompositor::requiresOwnBackingStore):
568         * rendering/RenderLayerCompositor.h:
569         * rendering/RenderMultiColumnSet.cpp:
570         (WebCore::RenderMultiColumnSet::adjustRegionBoundsFromFlowThreadPortionRect):
571         * rendering/RenderMultiColumnSet.h:
572         * rendering/RenderRegion.cpp:
573         (WebCore::RenderRegion::adjustRegionBoundsFromFlowThreadPortionRect):
574         * rendering/RenderRegion.h:
575
576 2014-02-19  Zalan Bujtas  <zalan@apple.com>
577
578         Subpixel rendering: Make GraphicsLayer::paintGraphicsLayerContents()'s cliprect FloatRect based.
579         https://bugs.webkit.org/show_bug.cgi?id=128911
580
581         Reviewed by Simon Fraser.
582
583         Switching from IntRect to FloatRect makes device pixel position clipping possible.
584
585         Covered by existing tests.
586
587         * WebCore.exp.in:
588         * platform/graphics/GraphicsLayer.cpp:
589         (WebCore::GraphicsLayer::paintGraphicsLayerContents):
590         * platform/graphics/GraphicsLayer.h:
591         * platform/graphics/ca/GraphicsLayerCA.cpp:
592         (WebCore::GraphicsLayerCA::platformCALayerPaintContents):
593         * platform/graphics/ca/GraphicsLayerCA.h:
594         * platform/graphics/ca/PlatformCALayerClient.h:
595         * platform/graphics/ca/mac/TileController.h:
596         * platform/graphics/ca/mac/TileController.mm:
597         (WebCore::TileController::platformCALayerPaintContents):
598         * platform/graphics/mac/WebLayer.mm:
599         (WebCore::drawLayerContents):
600         (-[WebSimpleLayer drawInContext:]):
601
602 2014-02-19  Zalan Bujtas  <zalan@apple.com>
603
604         Subpixel rendering: (RenderLayer)Pass non-css-pixel-snapped dirty rects to PaintInfo when painting renderer().
605         https://bugs.webkit.org/show_bug.cgi?id=128913
606
607         Reviewed by Simon Fraser.
608
609         This is part of the preparation to move RenderLayers to device pixel positioning.
610         We might need to device pixelsnapp the dirty rects later, but PaintInfo should be
611         able to manage that instead of doing it everywhere in the code.
612
613         Covered by existing tests.
614
615         * rendering/RenderLayer.cpp:
616         (WebCore::RenderLayer::paintBackgroundForFragments):
617         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
618         (WebCore::RenderLayer::paintOutlineForFragments):
619         (WebCore::RenderLayer::paintMaskForFragments):
620
621 2014-02-19  Ryosuke Niwa  <rniwa@webkit.org>
622
623         fieldset:disabled fieldset > legend:first-child input should be disabled
624         https://bugs.webkit.org/show_bug.cgi?id=129077
625
626         Reviewed by Antti Koivisto.
627
628         Similar to r164403. When a fieldset inside a disabled fieldset, input elements inside
629         the inner fieldset's first legend element child should be disabled.
630
631         Test: fast/forms/fieldset/fieldset-disabled-2.html
632
633         * html/HTMLFieldSetElement.cpp:
634         (WebCore::HTMLFieldSetElement::legend): Fixed the bug where it was returning the first
635         legend element descendent. It should be the first legend element _child_.
636         * html/HTMLFormControlElement.cpp:
637         (WebCore::HTMLFormControlElement::updateAncestorDisabledState): Fixed the algorithm
638         to look for any ancestor fieldset that has been disabled instead of the first fieldset
639         ancestor and checking its disabledness.
640
641 2014-02-19  Ryosuke Niwa  <rniwa@webkit.org>
642
643         Debug build fix after r164401. Removed a bogus assertion in comparePositions.
644         When either position is anchored at a detached node, they don't have a tree scope in common.
645
646         * editing/htmlediting.cpp:
647         (WebCore::comparePositions):
648
649 2014-02-19  Ryosuke Niwa  <rniwa@webkit.org>
650
651         fieldset:disabled > legend:first-child legend input should not be disabled
652         https://bugs.webkit.org/show_bug.cgi?id=129068
653
654         Reviewed by Andreas Kling.
655
656         An input element inside a disabled fieldset element is ordinarily disabled unless it's inside
657         a legend element that is the first of its kind to appear in the fieldset's child node list.
658
659         Prior to this patch, an input element inside such a legend element was erroneously disabled if
660         we had another legend element between the two as in <fieldset disabled><legend><legend><input>.
661
662         Fixed the bug by correcting the algorithm in updateAncestorDisabledState.
663
664         Test: fast/forms/fieldset/fieldset-disabled-2.html
665
666         * html/HTMLFormControlElement.cpp:
667         (WebCore::HTMLFormControlElement::updateAncestorDisabledState):
668
669 2014-02-18  Ryosuke Niwa  <rniwa@webkit.org>
670
671         Changing selection shouldn't synchronously update editor UI components
672         https://bugs.webkit.org/show_bug.cgi?id=129024
673
674         Reviewed by Brent Fulgham.
675
676         Make updates to spellchecker, alternative text controller (correction pane), and delete button controller
677         asynchronous for programmatically triggered selection changes.
678
679         We continue to update their states synchronously immediately after we have applied, unapplied, or reapplied
680         editing commands to keep states in spell checker and alternative text controller consistent. We should be
681         able to make them asynchronous as well in the future but that should be done in a separate patch.
682
683         * WebCore.exp.in:
684         * editing/AlternativeTextController.cpp:
685         (WebCore::AlternativeTextController::respondToChangedSelection): This function used to enumerate all document
686         makers and call respondToMarkerAtEndOfWord on each one of them only to exit early when SetSelectionOptions
687         had DictationTriggered. This condition is now checked in Editor::respondToChangedSelection to avoid all the
688         unnecessary work and remove the dependency on SetSelectionOptions.
689         (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord): Ditto.
690         * editing/AlternativeTextController.h:
691
692         * editing/Editor.cpp:
693         (WebCore::Editor::appliedEditing): Calls updateEditorUINowIfScheduled before calling respondToAppliedEditing
694         on the alternative text controller.
695         (WebCore::Editor::unappliedEditing): Ditto.
696         (WebCore::Editor::reappliedEditing): Ditto.
697         (WebCore::Editor::Editor): Initializes newly added booleans.
698         (WebCore::Editor::respondToChangedSelection): Continue to call respondToChangedSelection (for API consistency)
699         and setStartNewKillRingSequence but defer the "editor UI updates" to spellchecker, alternative text controller
700         and delete button controller by firing a newly added one shot timer.
701         (WebCore::Editor::updateEditorUINowIfScheduled): Synchronously update the pending editor UI updates.
702         (WebCore::Editor::editorUIUpdateTimerFired): Extracted from respondToChangedSelection.
703         * editing/Editor.h:
704
705         * testing/Internals.cpp:
706         (WebCore::Internals::markerCountForNode): Calls updateEditorUINowIfScheduled() to update document markers.
707         (WebCore::Internals::markerAt): Ditto.
708         (WebCore::Internals::updateEditorUINowIfScheduled): Added.
709         (WebCore::Internals::findEditingDeleteButton): Added. Updates delete button controller synchronously.
710         (WebCore::Internals::hasSpellingMarker): Calls updateEditorUINowIfScheduled() to update document markers.
711         (WebCore::Internals::hasAutocorrectedMarker): Ditto.
712         * testing/Internals.h:
713         * testing/Internals.idl:
714
715 2014-02-19  Anders Carlsson  <andersca@apple.com>
716
717         Add WTF_MAKE_FAST_ALLOCATED to more classes
718         https://bugs.webkit.org/show_bug.cgi?id=129064
719
720         Reviewed by Andreas Kling.
721
722         * dom/EventContext.h:
723         * platform/graphics/Region.h:
724         * platform/text/BidiResolver.h:
725         * rendering/LayoutState.h:
726
727 2014-02-19  Ryosuke Niwa  <rniwa@webkit.org>
728
729         isEditablePosition shouldn't trigger synchronous layout
730         https://bugs.webkit.org/show_bug.cgi?id=129026
731
732         Reviewed by Brent Fulgham.
733
734         Just trigger style recalc instead.
735
736         * editing/htmlediting.cpp:
737         (WebCore::isEditablePosition):
738
739 2014-02-19  Beth Dakin  <bdakin@apple.com>
740
741         UIProcess needs to know the color of the page's extended background
742         https://bugs.webkit.org/show_bug.cgi?id=129004
743
744         Rubber-stamped by Andreas Kling.
745
746         Missed this late-breaking review comment. Fixing now!
747
748         * rendering/RenderLayerCompositor.cpp:
749         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
750
751 2014-02-19  Beth Dakin  <bdakin@apple.com>
752
753         UIProcess needs to know the color of the page's extended background
754         https://bugs.webkit.org/show_bug.cgi?id=129004
755
756         Reviewed by Brent Fulgham.
757
758         This patch adds a new ChromeClient function, 
759         pageExtendedBackgroundColorDidChange() which will be called whenever the extended 
760         background color has changed.
761
762         New function.
763         * page/ChromeClient.h:
764         (WebCore::ChromeClient::pageExtendedBackgroundColorDidChange):
765
766         Store the extended background color in a member variable so that we can know if it 
767         changed even if we do not have an m_layerForOverhangAreas.
768         * rendering/RenderLayerCompositor.cpp:
769         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
770         (WebCore::RenderLayerCompositor::setRootExtendedBackgroundColor):
771         * rendering/RenderLayerCompositor.h:
772
773 2014-02-19  Dirk Schulze  <krit@webkit.org>
774
775         Missing box doesn't use border-box as reference box for clip-path
776         https://bugs.webkit.org/show_bug.cgi?id=129049
777
778         Reviewed by Simon Fraser.
779
780         If no reference box was specified the default reference box should be
781         border-box. Previously to this patch the reference box was the bounding
782         client rect. This was not following the specification.
783         http://www.w3.org/TR/2014/WD-css-masking-1-20140213/#the-clip-path
784         The change affects content using -webkit-clip-path in Safari. Since the
785         bounding client box is equalvalent to the border box most of the time
786         there shouldn't be to much impact.
787
788         Existing tests cover the issue.
789
790         * rendering/RenderLayer.cpp:
791         (WebCore::computeReferenceBox):
792
793 2014-02-19  James Craig  <jcraig@apple.com>
794
795         Web Inspector: AX: clarify reason for ignored state where possible (hidden, default for tag, etc)
796         https://bugs.webkit.org/show_bug.cgi?id=129037
797
798         Reviewed by Timothy Hatcher.
799
800         Passing back hidden and ignoredByDefault attrs to clarify some reasons for "ignored" status.
801
802         Test Updated: inspector-protocol/dom/getAccessibilityPropertiesForNode.html
803
804         * inspector/InspectorDOMAgent.cpp:
805         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
806         * inspector/protocol/DOM.json:
807
808 2014-02-19  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
809
810         [WebRTC] Updating RTCConfiguration to match WebRTC editor's draft of 01/27/2014
811         https://bugs.webkit.org/show_bug.cgi?id=129000
812
813         Reviewed by Eric Carlson.
814
815         Adding RTCIceTransports and RTCIdentityOption to RTCConfiguration object.
816
817         Existing test was updated.
818
819         * Modules/mediastream/RTCPeerConnection.cpp:
820         (WebCore::RTCPeerConnection::parseConfiguration): Taking into account iceTransports and requestIdentity
821         parameters.
822         * platform/mediastream/RTCConfiguration.h:
823         (WebCore::RTCConfiguration::iceTransports): Added.
824         (WebCore::RTCConfiguration::setIceTransports): Added.
825         (WebCore::RTCConfiguration::requestIdentity): Added.
826         (WebCore::RTCConfiguration::setRequestIdentity): Added.
827         (WebCore::RTCConfiguration::RTCConfiguration): Initialize iceTransports and requestIdentity with the default
828         values.
829
830 2014-02-19  Antti Koivisto  <antti@apple.com>
831
832         Don't call to willBeDeletedFrom(Document&) when destructing document
833         https://bugs.webkit.org/show_bug.cgi?id=129013
834
835         Reviewed by Andreas Kling.
836         
837         The document is half dead at this point.
838
839         * dom/ContainerNode.cpp:
840         (WebCore::ContainerNode::~ContainerNode):
841
842 2014-02-19  Daniel Bates  <dabates@apple.com>
843
844         REGRESSION (r163560): Always treat SVG <tspan> and <textPath> as display inline
845         https://bugs.webkit.org/show_bug.cgi?id=128552
846         <rdar://problem/16029658>
847
848         Reviewed by Andreas Kling.
849
850         Following <http://trac.webkit.org/changeset/163560>, SVG <tspan> and <textPath> may be treated as block-
851         level elements depending on their CSS styles (e.g. display: block). But such elements should always be
852         treated as inline-level elements.
853
854         Tests: svg/text/textpath-display-block.html
855                svg/text/textpath-display-none.html
856                svg/text/tspan-display-block.html
857
858         * css/StyleResolver.cpp:
859         (WebCore::StyleResolver::adjustRenderStyle):
860
861 2014-02-19  Daniel Bates  <dabates@apple.com>
862
863         Do not dispatch change event twice in single step action
864         https://bugs.webkit.org/show_bug.cgi?id=116936
865         <rdar://problem/16086828>
866
867         Reviewed by Ryosuke Niwa.
868
869         Merged from Blink (patch by Kent Tamura):
870         https://src.chromium.org/viewvc/blink?view=rev&revision=151175
871
872         Test: fast/forms/number/number-type-update-by-change-event.html
873
874         * html/InputType.cpp:
875         (WebCore::InputType::stepUpFromRenderer):
876
877 2014-02-19  Brady Eidson  <beidson@apple.com>
878
879         Add FeatureDefines for image controls
880         https://bugs.webkit.org/show_bug.cgi?id=129022
881
882         Reviewed by Jer Noble.
883
884         * Configurations/FeatureDefines.xcconfig:
885
886 2014-02-19  Piotr Grad  <p.grad@samsung.com>
887
888         Setting playback rate on Media Controller modifies current time.
889         https://bugs.webkit.org/show_bug.cgi?id=129042
890
891         Reviewed by Jer Noble.
892
893         In ClockGeneric: when setting playback rate or stoping timer,clock was restarted using current real time
894         instead of provided time by setCurrentTime.
895         Changed impl. so that m_offset is updated when clock stops to remember last clock position.
896         When playbackRate is changed m_offset is updated in order to not use old time interval for new playback rate.
897
898         Test: media/video-controller-currentTime-rate.html
899
900         * html/MediaController.cpp:
901         (MediaController::updatePlaybackState):
902         * platform/ClockGeneric.cpp:
903         (ClockGeneric::setPlayRate):
904         (ClockGeneric::start):
905         (ClockGeneric::stop):
906
907 2014-02-19  Brady Eidson  <beidson@apple.com>
908
909         Add settings/preferences for enabling image controls
910         https://bugs.webkit.org/show_bug.cgi?id=129027
911
912         Reviewed by Jer Noble.
913
914         * WebCore.exp.in:
915
916         * page/Settings.cpp:
917         (WebCore::Settings::Settings):
918         (WebCore::Settings::setImageControlsEnabled):
919         * page/Settings.h:
920         (WebCore::Settings::imageControlsEnabled):
921
922 2014-02-19  Bem Jones-Bey  <bjonesbe@adobe.com>
923
924         [CSS Shapes] shape-outside does not properly handle different writing modes
925         https://bugs.webkit.org/show_bug.cgi?id=128631
926
927         Reviewed by David Hyatt.
928
929         Fix ShapeOutsideInfo to properly convert the line coordinates and
930         shape coordinates with respect to the writing mode and writing
931         direction for the lines that are affected by the shape. This is
932         notably different from shape inside in that shape outside needs to use
933         the writing mode of the container, not of the element that the shape
934         is applied to.
935
936         Tests: fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-direction-border-box.html
937                fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-direction-content-box.html
938                fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-direction-margin-box.html
939                fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-direction-padding-box.html
940                fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes-border-box.html
941                fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes-content-box.html
942                fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes-margin-box.html
943                fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes-padding-box.html
944
945         * rendering/RenderBoxModelObject.h:
946         (WebCore::RenderBoxModelObject::borderWidth): Used by
947             ShapeInfo::setReferenceBoxLogicalSize.
948         (WebCore::RenderBoxModelObject::borderHeight): Ditto.
949         * rendering/shapes/ShapeInfo.cpp:
950         (WebCore::ShapeInfo<RenderType>::setReferenceBoxLogicalSize): Use the
951             container's writing mode to determine the logical dimensions in
952             the case of shape outside.
953         (WebCore::ShapeInfo<RenderType>::computedShape): Use the new
954             ShapeInfo::styleForWritingMode method.
955         (WebCore::borderBeforeInWritingMode): Determines the borderBefore for
956             the passed in renderer using the writing mode passed in. The
957             borderBefore method on the renderer is implemented in RenderStyle,
958             unlike with the margin methods, so this was chosen instead of
959             attempting to move the border method implementation into a place
960             where it could take the writing mode as an argument.
961         (WebCore::borderAndPaddingBeforeInWritingMode): Determines the
962             borderAndPaddingBefore for the passed in renderer using the
963             given writihg mode. See above for why this method instead of doing
964             it like margins.
965         (WebCore::borderStartWithStyleForWritingMode): Determines the
966             borderStart for the passed in renderer using the writing mode and
967             direction from the style passed in. See above for why this method
968             instead of doing it like margins.
969         (WebCore::borderAndPaddingStartWithStyleForWritingMode): Determines
970             the borderAndPaddingStart for the passed in renderer using the
971             writing mode and direction from the style passed in. See above for
972             why this method instead of doing it like margins.
973         (WebCore::ShapeInfo<RenderType>::logicalTopOffset): Use the
974             container's writing mode to determine the logicalTopOffset in the
975             case of shape outside.
976         (WebCore::ShapeInfo<RenderType>::logicalLeftOffset): Use the
977             container's writing mode to determine the logicalTopOffset in the
978             case of shape outside.
979         * rendering/shapes/ShapeInfo.h:
980         * rendering/shapes/ShapeInsideInfo.cpp:
981         (WebCore::ShapeInsideInfo::styleForWritingMode): Return the entire
982             style because to determine start/end the writing direction is
983             needed in addtion to the writing mode.
984         * rendering/shapes/ShapeInsideInfo.h:
985         * rendering/shapes/ShapeOutsideInfo.cpp:
986         (WebCore::ShapeOutsideInfo::updateDeltasForContainingBlockLine):
987             Properly convert the containing block line into the reference box
988             coordinates of the shape.
989         (WebCore::ShapeOutsideInfo::styleForWritingMode): Return the entire
990             style because to determine start/end the writing direction is
991             needed in addtion to the writing mode.
992         * rendering/shapes/ShapeOutsideInfo.h:
993
994 2014-02-19  Xabier Rodriguez Calvar  <calvaris@igalia.com>
995
996         [GStreamer] the GstPlayFlags enum diverged from upstream
997         https://bugs.webkit.org/show_bug.cgi?id=128957
998
999         Reviewed by Philippe Normand.
1000
1001         Removed the GstPlayFlags from the GStreamer implementation and
1002         replaced by the use of the GFlags.
1003
1004         * platform/graphics/gstreamer/GStreamerUtilities.h:
1005         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
1006         (WebCore::getGstPlaysFlag): Created to get the flags by using the
1007         GFlags infrastructure.
1008         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1009         (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
1010         Replaced GST_PLAY_FLAG_DOWNLOAD with getGstPlaysFlag.
1011
1012 2014-02-19  Zan Dobersek  <zdobersek@igalia.com>
1013
1014         Replace WTF::bind() uses in RTCPeerConnection with C++11 lambdas
1015         https://bugs.webkit.org/show_bug.cgi?id=129001
1016
1017         Reviewed by Eric Carlson.
1018
1019         * Modules/mediastream/RTCPeerConnection.cpp:
1020         (WebCore::RTCPeerConnection::setLocalDescription): Pass a lambda function to
1021         callOnMainThread() instead of using WTF::bind().
1022         (WebCore::RTCPeerConnection::setRemoteDescription): Ditto.
1023
1024 2014-02-19  Dan Bernstein  <mitz@apple.com>
1025
1026         Simplify PLATFORM(MAC) && !PLATFORM(IOS) and similar expressions
1027         https://bugs.webkit.org/show_bug.cgi?id=129029
1028
1029         Reviewed by Mark Rowe.
1030
1031         * accessibility/AccessibilityRenderObject.cpp:
1032         (WebCore::AccessibilityRenderObject::boundsForVisiblePositionRange):
1033         (WebCore::AccessibilityRenderObject::visiblePositionForPoint):
1034         * config.h:
1035         * editing/Editor.cpp:
1036         (WebCore::Editor::copyURL):
1037         * editing/EditorCommand.cpp:
1038         (WebCore::createCommandMap):
1039         * editing/TypingCommand.cpp:
1040         (WebCore::TypingCommand::markMisspellingsAfterTyping):
1041         * loader/FrameLoader.cpp:
1042         (WebCore::FrameLoader::loadArchive):
1043         * page/AlternativeTextClient.h:
1044         * page/EventHandler.cpp:
1045         * page/PageGroup.cpp:
1046         (WebCore::PageGroup::captionPreferences):
1047         * page/scrolling/ScrollingStateScrollingNode.cpp:
1048         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
1049         * page/scrolling/ScrollingStateScrollingNode.h:
1050         * page/scrolling/ScrollingTree.h:
1051         * page/scrolling/ThreadedScrollingTree.cpp:
1052         * page/scrolling/ThreadedScrollingTree.h:
1053         * platform/DragData.h:
1054         * platform/FileSystem.cpp:
1055         * platform/MemoryPressureHandler.cpp:
1056         * platform/Pasteboard.h:
1057         * platform/PlatformMouseEvent.h:
1058         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
1059         * platform/PlatformPasteboard.h:
1060         * platform/PlatformScreen.h:
1061         * platform/Scrollbar.cpp:
1062         (WebCore::Scrollbar::supportsUpdateOnSecondaryThread):
1063         * platform/SuddenTermination.h:
1064         * platform/ThreadGlobalData.cpp:
1065         (WebCore::ThreadGlobalData::ThreadGlobalData):
1066         (WebCore::ThreadGlobalData::destroy):
1067         * platform/ThreadGlobalData.h:
1068         * platform/audio/mac/AudioDestinationMac.cpp:
1069         * platform/audio/mac/AudioFileReaderMac.cpp:
1070         * platform/audio/mac/AudioSessionMac.cpp:
1071         * platform/graphics/DisplayRefreshMonitor.h:
1072         * platform/graphics/FloatPoint.h:
1073         * platform/graphics/FloatRect.h:
1074         * platform/graphics/FloatSize.h:
1075         * platform/graphics/IntRect.h:
1076         * platform/graphics/IntSize.h:
1077         * platform/graphics/MediaPlayer.cpp:
1078         (WebCore::installedMediaEngines):
1079         * platform/graphics/cg/ImageBufferCG.cpp:
1080         (WebCore::utiFromMIMEType):
1081         * platform/graphics/cg/PDFDocumentImage.h:
1082         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1083         * platform/graphics/mac/GraphicsContextMac.mm:
1084         (WebCore::GraphicsContext::drawLineForDocumentMarker):
1085         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
1086         (WebCore::Extensions3DOpenGL::supportsExtension):
1087         (WebCore::Extensions3DOpenGL::drawBuffersEXT):
1088         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
1089         (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
1090         * platform/mac/KeyEventMac.mm:
1091         * platform/network/NetworkStateNotifier.h:
1092         * platform/network/cf/CookieJarCFNet.cpp:
1093         * platform/network/cf/ResourceRequest.h:
1094         * platform/network/cf/ResourceRequestCFNet.cpp:
1095         * platform/network/cf/SocketStreamHandleCFNet.cpp:
1096         (WebCore::SocketStreamHandle::reportErrorToClient):
1097         * platform/text/TextEncodingRegistry.cpp:
1098         (WebCore::extendTextCodecMaps):
1099         * rendering/RenderLayerCompositor.cpp:
1100         (WebCore::RenderLayerCompositor::allowsIndependentlyCompositedFrames):
1101         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
1102
1103 2014-02-18  Dan Bernstein  <mitz@apple.com>
1104
1105         PLATFORM(MAC) is true when building for iOS
1106         https://bugs.webkit.org/show_bug.cgi?id=129025
1107
1108         Reviewed by Mark Rowe.
1109
1110         * editing/Editor.cpp: Changed PLATFORM(MAC) to PLATFORM(COCOA) now that the former does not
1111         include iOS.
1112
1113 2014-02-17  Gavin Barraclough  <barraclough@apple.com>
1114
1115         Add fast mapping from StringImpl to JSString
1116         https://bugs.webkit.org/show_bug.cgi?id=128625
1117
1118         Reviewed by Geoff Garen & Andreas Kling.
1119
1120         Removed JSStringCache from WebCore; call JSC::jsStringWithWeakOwner instead.
1121
1122         * bindings/js/DOMWrapperWorld.cpp:
1123         (WebCore::DOMWrapperWorld::clearWrappers):
1124             - removed JSStringCache.
1125         * bindings/js/DOMWrapperWorld.h:
1126             - removed JSStringCache.
1127         * bindings/js/JSDOMBinding.h:
1128         (WebCore::jsStringWithCache):
1129             - call jsStringWithWeakOwner insead of using JSStringCache.
1130         * bindings/js/JSDOMWindowBase.cpp:
1131         (WebCore::JSDOMWindowBase::commonVM):
1132             - renamed createLeaked -> createLeakedForMainThread.
1133         * bindings/scripts/StaticString.pm:
1134         (GenerateStrings):
1135             - StringImpl has an additional field.
1136
1137 2014-02-18  Simon Fraser  <simon.fraser@apple.com>
1138
1139         Remove UIWKRemoteView
1140         https://bugs.webkit.org/show_bug.cgi?id=129015
1141
1142         Reviewed by Dan Bernstein.
1143
1144         The project referenced a maketokenizer script that disappeared
1145         long ago.
1146
1147         * WebCore.xcodeproj/project.pbxproj:
1148
1149 2014-02-18  Simon Fraser  <simon.fraser@apple.com>
1150
1151         border-box clip-paths jump around when outline changes
1152         https://bugs.webkit.org/show_bug.cgi?id=128929
1153
1154         Reviewed by Dirk Schulze.
1155         
1156         computeReferenceBox() for clip paths was using "rootRelativeBounds"
1157         to position the border-box. This bounds is an enclosing bounds for
1158         the layer and its descendants, including outlines and absolute descendants,
1159         so it is not the correct box to use to offset the border-box.
1160         
1161         The caller has offsetFromRoot(), which is the correct thing to use,
1162         so use it.
1163
1164         Test: css3/masking/clip-path-root-relative-bounds.html
1165
1166         * rendering/RenderLayer.cpp:
1167         (WebCore::computeReferenceBox):
1168         (WebCore::RenderLayer::setupClipPath):
1169
1170 2014-02-18  James Craig  <jcraig@apple.com>
1171
1172         Web Inspector: AX: more properties: exists, required, and invalid (exists was previously combined with ignored)
1173         https://bugs.webkit.org/show_bug.cgi?id=128504
1174
1175         Reviewed by Timothy Hatcher.
1176
1177         Additions to the accessibility node inspector: exists, required, invalid.
1178
1179         Test: inspector-protocol/dom/getAccessibilityPropertiesForNode.html
1180
1181         * inspector/InspectorDOMAgent.cpp:
1182         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
1183         * inspector/protocol/DOM.json:
1184
1185 2014-02-18  Ryosuke Niwa  <rniwa@webkit.org>
1186
1187         Commit the code change supposed to happen in r164320.
1188
1189         * editing/Editor.cpp:
1190         (WebCore::Editor::setIgnoreCompositionSelectionChange):
1191         (WebCore::Editor::respondToChangedSelection):
1192         * editing/Editor.h:
1193
1194 2014-02-18  Ryosuke Niwa  <rniwa@webkit.org>
1195
1196         TextFieldInputType::handleBeforeTextInsertedEvent shouldn't use plainText
1197         https://bugs.webkit.org/show_bug.cgi?id=128953
1198
1199         Reviewed by Alexey Proskuryakov.
1200
1201         Don't use FrameSelection's toNormalizedRange and plainText. Instead, use the cached selection start and selection
1202         end to extract the selected text. The caches are updated inside FrameSelection::setSelection whenever selection
1203         is inside a text form control via HTMLTextFormControlElement::selectionChanged.
1204
1205         * html/TextFieldInputType.cpp:
1206         (WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):
1207
1208 2014-02-18  Viatcheslav Ostapenko  <sl.ostapenko@samsung.com>
1209
1210         Bottom/right sticky positioning don't correctly handle scroll containers with padding
1211         https://bugs.webkit.org/show_bug.cgi?id=119280
1212
1213         Reviewed by Simon Fraser.
1214
1215         Take padding into account during calculation of overflow constraining rect for sticky
1216         positioning.
1217
1218         Test: fast/css/sticky/sticky-bottom-overflow-padding.html
1219
1220         * rendering/RenderBoxModelObject.cpp:
1221         (WebCore::RenderBoxModelObject::stickyPositionOffset):
1222
1223 2014-02-17  Jon Honeycutt  <jhoneycutt@apple.com>
1224
1225         Crash when merging ruby bases that contain floats
1226
1227         https://bugs.webkit.org/show_bug.cgi?id=127515
1228         <rdar://problem/15896562>
1229
1230         This crash occurs when we remove a ruby text object and decide to merge
1231         two adjacent ruby base objects. The right ruby base's children were
1232         being merged into the left ruby base, but the right ruby base's floats
1233         were not being moved to the left base. This could cause us not to
1234         descend into all nodes containing a FloatingObject in
1235         RenderBlockFlow::markAllDescendantsWithFloatsForLayout(), because we
1236         assume that if a block does not have a particular float in its float
1237         list, none of its descendants will, either.
1238
1239         Reviewed by David Hyatt.
1240
1241         Test: fast/ruby/ruby-base-merge-block-children-crash-2.html
1242
1243         * rendering/RenderBlockFlow.cpp:
1244         (WebCore::RenderBlockFlow::moveFloatsTo):
1245         Code split out of moveAllChildrenIncludingFloatsTo().
1246         (WebCore::RenderBlockFlow::moveAllChildrenIncludingFloatsTo):
1247         Call moveFloatsTo().
1248
1249         * rendering/RenderBlockFlow.h:
1250         Add declaration of moveFloatsTo().
1251
1252         * rendering/RenderRubyBase.cpp:
1253         (WebCore::RenderRubyBase::mergeChildrenWithBase):
1254         Move children and floats to the new base.
1255
1256         * rendering/RenderRubyBase.h:
1257         Declare mergeChildrenWithBase().
1258
1259         * rendering/RenderRubyRun.cpp:
1260         (WebCore::RenderRubyRun::removeChild):
1261         Call mergeChildrenWithBase().
1262
1263 2014-02-18  Ryosuke Niwa  <rniwa@webkit.org>
1264
1265         iOS build fix after r164319.
1266
1267         * editing/FrameSelection.cpp:
1268         (WebCore::FrameSelection::setSelectedRange):
1269
1270 2014-02-18  Samuel White  <samuel_white@apple.com>
1271
1272         AX: Searching for "immediate descendants only" can return unexpected results.
1273         https://bugs.webkit.org/show_bug.cgi?id=128986
1274
1275         Reviewed by Chris Fleizach.
1276
1277         Missed an application of the immediateDescendantsOnly flag during the initial implementation. We
1278         need to make sure we don't decend into the startObject first if it is provided. This fix causes
1279         the outer loop to 'skip' the first iteration so only siblings of the startObject are considered.
1280
1281         No new tests, updated existing search-predicate-immediate-descendants-only.html test to cover this case.
1282
1283         * accessibility/AccessibilityObject.cpp:
1284         (WebCore::AccessibilityObject::findMatchingObjects):
1285
1286 2014-02-18 Ryosuke Niwa <rniwa@webkit.org>
1287
1288         Merge notifyComponentsOnChangedSelection into respondToSelectionChange
1289         https://bugs.webkit.org/show_bug.cgi?id=128993
1290
1291         Reviewed by Andreas Kling.
1292
1293         Merged notifyComponentsOnChangedSelection into respondToSelectionChange since notifyComponentsOnChangedSelection
1294         was only added in iOS codebase in response to the code added for continuous spellchecking and alternative text controller
1295         in respondToChangedSelection but they should have been called inside setIgnoreCompositionSelectionChange.
1296
1297         So merge these two functions and make respondToChangedSelection behave like setIgnoreCompositionSelectionChange.
1298
1299         * editing/Editor.cpp:
1300         (WebCore::Editor::setIgnoreCompositionSelectionChange):
1301         (WebCore::Editor::respondToChangedSelection):
1302         * editing/Editor.h:
1303
1304 2014-02-18  Ryosuke Niwa  <rniwa@webkit.org>
1305
1306         FrameSelection::textWasReplaced and setSelectedRange shouldn't trigger synchronous layout
1307         https://bugs.webkit.org/show_bug.cgi?id=128951
1308
1309         Reviewed by Antti Koivisto.
1310
1311         Cleanup.
1312
1313         * editing/FrameSelection.cpp:
1314         (WebCore::FrameSelection::textWasReplaced): Don't call updateLayout. It's totally unnecessarily.
1315         (WebCore::FrameSelection::setSelectedRange): Ditto. Also removed the code to set affinity only when
1316         range is collapsed since VisibleSelection::validate already does this.
1317
1318 2014-02-18  Eric Carlson  <eric.carlson@apple.com>
1319
1320         Do not cache media time until media engine returns a non-zero value
1321         https://bugs.webkit.org/show_bug.cgi?id=128976
1322
1323         Reviewed by Jer Noble.
1324
1325         No new tests, covered by existing tests.
1326
1327         * html/HTMLMediaElement.cpp:
1328         (WebCore::HTMLMediaElement::refreshCachedTime): Don't mark the cached time as valid
1329             until it is non-zero.
1330         (WebCore::HTMLMediaElement::currentTime): Return 0 if m_cachedTime is invalid.
1331
1332 2014-02-17  Alexey Proskuryakov  <ap@apple.com>
1333
1334         [iOS] All WebKit clients should encrypt WebCrypto keys automatically
1335         https://bugs.webkit.org/show_bug.cgi?id=128938
1336
1337         Reviewed by Dan Bernstein.
1338
1339         Don't pass ACLs on iOS. Key will be added to app's default Keychain access group.
1340
1341         Also, don't pass kSecAttrIsPermanent, which is irrelevant for password items, and
1342         caused error -50 in DumpRenderTree for me when passed.
1343
1344         Added fallback to _NSGetProgname for account name, to account for tools such as
1345         Mac DumpRenderTree that don't have bundle identifiers.
1346
1347         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
1348         (WebCore::masterKeyAccountNameForCurrentApplication):
1349         (WebCore::createAndStoreMasterKey):
1350
1351 2014-02-18  Ryosuke Niwa  <rniwa@webkit.org>
1352
1353         setSelectionRange should set selection without validation
1354         https://bugs.webkit.org/show_bug.cgi?id=128949
1355
1356         Reviewed by Enrica Casucci.
1357
1358         Since positionForIndex in HTMLTextFormControlElement always returns a candidate Position, we don't have to
1359         validate selection in setSelectionRange.
1360
1361         Also fixed various bugs uncovered by this change.
1362
1363         This patch also fixes fast/forms/input-select-webkit-user-select-none.html, which used to assert wrong outcome
1364         so that WebKit's behavior matches that of Chrome and Firefox.
1365
1366         Test: fast/forms/input-select-webkit-user-select-none.html
1367
1368         * dom/Position.h:
1369         (WebCore::positionInParentBeforeNode): This function had a bug that when node is a child of the shadow root
1370         it would return a null Position. Allow a position anchored inside a shadow root.
1371         (WebCore::positionInParentAfterNode): Ditto.
1372
1373         * editing/FrameSelection.cpp:
1374         (WebCore::FrameSelection::moveWithoutValidationTo): Renamed from moveTo and avoided selection validation.
1375         * editing/FrameSelection.h:
1376
1377         * editing/htmlediting.cpp:
1378         (WebCore::updatePositionForNodeRemoval): Fixed the bug that this function doesn't update positions before
1379         or after children even if the shadow host of the anchor node is getting removed. Move the position before
1380         the shadow host to be removed in both situations.
1381
1382         * html/HTMLTextFormControlElement.cpp:
1383         (WebCore::HTMLTextFormControlElement::setSelectionRange): moveTo is renamed to moveWithoutValidationTo.
1384         (WebCore::HTMLTextFormControlElement::selectionChanged): Check if the cached selection offsets are different
1385         in lieu of FrameSelection::isRange() since they're equivalent here.
1386         (WebCore::positionForIndex): Return the position inside or after the last br when there is one to match
1387         the canonicalization algorithm we have. It's probably harmless to return the last position in the inner text
1388         element anyways since most of our codebase supports that but this would avoid having to rebaseline dozens
1389         of tests and reduces the risk of this patch.
1390
1391 2014-02-18  Zan Dobersek  <zdobersek@igalia.com>
1392
1393         Move IndexedDB module, LevelDB code to std::unique_ptr
1394         https://bugs.webkit.org/show_bug.cgi?id=128964
1395
1396         Reviewed by Andreas Kling.
1397
1398         Replace uses of OwnPtr and PassOwnPtr in the IndexedDB module and LevelDB platform code with std::unique_ptr.
1399
1400         * Modules/indexeddb/IDBCursorBackend.h:
1401         * Modules/indexeddb/IDBDatabaseBackend.cpp:
1402         (WebCore::IDBDatabaseBackend::IDBDatabaseBackend):
1403         (WebCore::IDBDatabaseBackend::transactionFinishedAndAbortFired):
1404         (WebCore::IDBDatabaseBackend::processPendingCalls):
1405         (WebCore::IDBDatabaseBackend::processPendingOpenCalls):
1406         (WebCore::IDBDatabaseBackend::openConnection):
1407         (WebCore::IDBDatabaseBackend::runIntVersionChangeTransaction):
1408         (WebCore::IDBDatabaseBackend::deleteDatabase):
1409         (WebCore::IDBDatabaseBackend::close):
1410         * Modules/indexeddb/IDBDatabaseBackend.h:
1411         (WebCore::IDBDatabaseBackend::hasPendingSecondHalfOpen):
1412         (WebCore::IDBDatabaseBackend::setPendingSecondHalfOpen):
1413         * Modules/indexeddb/IDBPendingDeleteCall.h:
1414         (WebCore::IDBPendingDeleteCall::IDBPendingDeleteCall):
1415         * Modules/indexeddb/IDBPendingOpenCall.h:
1416         (WebCore::IDBPendingOpenCall::IDBPendingOpenCall):
1417         * Modules/indexeddb/IDBTransactionBackendOperations.cpp:
1418         (WebCore::IDBDatabaseBackend::VersionChangeOperation::perform):
1419         * Modules/indexeddb/IDBTransactionCoordinator.cpp:
1420         * Modules/indexeddb/IDBTransactionCoordinator.h:
1421         * Modules/indexeddb/leveldb/IDBBackingStoreCursorLevelDB.h:
1422         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
1423         (WebCore::setUpMetadata):
1424         (WebCore::DefaultLevelDBFactory::openLevelDB):
1425         (WebCore::IDBBackingStoreLevelDB::IDBBackingStoreLevelDB):
1426         (WebCore::IDBBackingStoreLevelDB::~IDBBackingStoreLevelDB):
1427         (WebCore::IDBBackingStoreLevelDB::open):
1428         (WebCore::IDBBackingStoreLevelDB::openInMemory):
1429         (WebCore::IDBBackingStoreLevelDB::create):
1430         (WebCore::IDBBackingStoreLevelDB::getDatabaseNames):
1431         (WebCore::deleteRange):
1432         (WebCore::IDBBackingStoreLevelDB::deleteDatabase):
1433         (WebCore::IDBBackingStoreLevelDB::getObjectStores):
1434         (WebCore::IDBBackingStoreLevelDB::getKeyGeneratorCurrentNumber):
1435         (WebCore::IDBBackingStoreLevelDB::getIndexes):
1436         (WebCore::findGreatestKeyLessThanOrEqual):
1437         (WebCore::IDBBackingStoreLevelDB::findKeyInIndex):
1438         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.h:
1439         * platform/leveldb/LevelDBDatabase.cpp:
1440         (WebCore::LevelDBDatabase::~LevelDBDatabase):
1441         (WebCore::LevelDBDatabase::open):
1442         (WebCore::LevelDBDatabase::openInMemory):
1443         (WebCore::IteratorImpl::IteratorImpl):
1444         (WebCore::LevelDBDatabase::createIterator):
1445         * platform/leveldb/LevelDBDatabase.h:
1446         * platform/leveldb/LevelDBTransaction.cpp:
1447         (WebCore::LevelDBTransaction::commit):
1448         (WebCore::LevelDBTransaction::createIterator):
1449         (WebCore::LevelDBTransaction::TransactionIterator::TransactionIterator):
1450         (WebCore::LevelDBTransaction::TransactionIterator::refreshTreeIterator):
1451         (WebCore::LevelDBWriteOnlyTransaction::LevelDBWriteOnlyTransaction):
1452         * platform/leveldb/LevelDBTransaction.h:
1453         * platform/leveldb/LevelDBWriteBatch.cpp:
1454         (WebCore::LevelDBWriteBatch::LevelDBWriteBatch):
1455         * platform/leveldb/LevelDBWriteBatch.h:
1456
1457 2014-02-18  David Kilzer  <ddkilzer@apple.com>
1458
1459         Follow-up: Add type-checked casts for StyleImage and subclasses
1460         <http://webkit.org/b/128915>
1461
1462         Address some style issues based on feedback from Andreas Kling.
1463
1464         * css/CSSCursorImageValue.cpp:
1465         (WebCore::CSSCursorImageValue::cachedImageURL):
1466         * css/CSSImageSetValue.cpp:
1467         (WebCore::CSSImageSetValue::~CSSImageSetValue):
1468         (WebCore::CSSImageSetValue::hasFailedOrCanceledSubresources):
1469         * css/CSSImageValue.cpp:
1470         (WebCore::CSSImageValue::hasFailedOrCanceledSubresources):
1471         - Use the reference version of the type-checked casts since we
1472           know the pointers are not NULL.
1473
1474         * rendering/style/StyleImage.h:
1475         - Use 'styleImage' instead of 'resource' in
1476           STYLE_IMAGE_TYPE_CASTS.
1477
1478 2014-02-18  Zan Dobersek  <zdobersek@igalia.com>
1479
1480         Remove unnecessary UserActionElementSet constructor, destructor
1481         https://bugs.webkit.org/show_bug.cgi?id=128962
1482
1483         Reviewed by Andreas Kling.
1484
1485         UserActionElementSet constructor and destructor are not necessary, as is not the
1486         static create() function that returns PassOwnPtr<UserActionElementSet>. The implicit
1487         constructor and destructor can take care of creating and destroying the sole HashMap
1488         member variable.
1489
1490         * dom/UserActionElementSet.cpp:
1491         * dom/UserActionElementSet.h:
1492
1493 2014-02-18  Myles C. Maxfield  <mmaxfield@apple.com>
1494
1495         Rename convertFixedAndStickyPosition() to convertPositionStyle()
1496         https://bugs.webkit.org/show_bug.cgi?id=128987
1497
1498         Reviewed by NOBODY. This is addressing a post-commit review from Dean Jackson.
1499
1500         No new tests are necessary because there is no behavior change
1501
1502         * editing/EditingStyle.cpp:
1503         (WebCore::EditingStyle::convertPositionStyle):
1504         * editing/EditingStyle.h:
1505         * editing/markup.cpp:
1506         (WebCore::StyledMarkupAccumulator::appendElement):
1507
1508 2014-02-18  Commit Queue  <commit-queue@webkit.org>
1509
1510         Unreviewed, rolling out r164296.
1511         http://trac.webkit.org/changeset/164296
1512         https://bugs.webkit.org/show_bug.cgi?id=128989
1513
1514         Broke many media tests (Requested by eric_carlson on #webkit).
1515
1516         * html/HTMLMediaElement.cpp:
1517         (WebCore::HTMLMediaElement::parseAttribute):
1518         * html/HTMLMediaElement.h:
1519
1520 2014-02-18  Myles C. Maxfield  <mmaxfield@apple.com>
1521
1522         Convert position:sticky to position:static upon copy and paste
1523         https://bugs.webkit.org/show_bug.cgi?id=128982
1524
1525         Reviewed by Simon Fraser.
1526
1527         This patch has two parts:
1528
1529         1. Make sure that position:absolute elements trigger the position:relative wrapping (as
1530         well as position:fixed)
1531         2. Now that we copy position:sticky, convert that to position:static
1532
1533         Tests: editing/pasteboard/copy-paste-converts-fixed.html
1534                editing/pasteboard/copy-paste-converts-sticky.html
1535                editing/pasteboard/copy-paste-wraps-position-absolute.html
1536
1537         * editing/EditingStyle.cpp:
1538         (WebCore::EditingStyle::convertFixedAndStickyPosition):
1539
1540 2014-02-18  David Kilzer  <ddkilzer@apple.com>
1541
1542         Add type-checked casts for StyleImage and subclasses
1543         <http://webkit.org/b/128915>
1544
1545         Reviewed by Oliver Hunt.
1546
1547         * css/CSSCursorImageValue.cpp:
1548         (WebCore::CSSCursorImageValue::detachPendingImage):
1549         (WebCore::CSSCursorImageValue::cachedImage):
1550         (WebCore::CSSCursorImageValue::cachedImageURL):
1551         * css/CSSImageSetValue.cpp:
1552         (WebCore::CSSImageSetValue::detachPendingImage):
1553         (WebCore::CSSImageSetValue::~CSSImageSetValue):
1554         (WebCore::CSSImageSetValue::cachedImageSet):
1555         (WebCore::CSSImageSetValue::hasFailedOrCanceledSubresources):
1556         * css/CSSImageValue.cpp:
1557         (WebCore::CSSImageValue::detachPendingImage):
1558         (WebCore::CSSImageValue::cachedImage):
1559         (WebCore::CSSImageValue::hasFailedOrCanceledSubresources):
1560         * css/StyleResolver.cpp:
1561         (WebCore::StyleResolver::loadPendingShapeImage):
1562         (WebCore::StyleResolver::loadPendingImages):
1563         * page/PageSerializer.cpp:
1564         (WebCore::PageSerializer::retrieveResourcesForProperties):
1565         * page/animation/CSSPropertyAnimation.cpp:
1566         (WebCore::blendFunc):
1567         - Switch from static_cast<>() operators to toTypeName() methods.
1568         - Replace 0 with nullptr where convenient.
1569
1570         * rendering/style/StyleCachedImage.h:
1571         * rendering/style/StyleCachedImageSet.h:
1572         * rendering/style/StyleGeneratedImage.h:
1573         * rendering/style/StyleImage.h:
1574         * rendering/style/StylePendingImage.h:
1575         - Define type-checked cast macros.
1576
1577 2014-02-18  Sam Weinig  <sam@webkit.org>
1578
1579         Simplify HTML tokenizer parameterization down to what is used
1580         https://bugs.webkit.org/show_bug.cgi?id=128977
1581
1582         Reviewed by Alexey Proskuryakov.
1583
1584         - Removes support for CustomHTMLTokenizerChunkSize.
1585         - Consolidates CustomHTMLTokenizerTimeDelay down to one implementation, using Settings::maxParseDuration
1586
1587         * WebCore.exp.in:
1588         * html/parser/HTMLParserScheduler.cpp:
1589         (WebCore::HTMLParserScheduler::HTMLParserScheduler):
1590         * page/Page.cpp:
1591         (WebCore::Page::Page):
1592         (WebCore::Page::hasCustomHTMLTokenizerTimeDelay):
1593         (WebCore::Page::customHTMLTokenizerTimeDelay):
1594         * page/Page.h:
1595
1596 2014-02-18  Eric Carlson  <eric.carlson@apple.com>
1597
1598         Do not cache media time until media engine returns a non-zero value
1599         https://bugs.webkit.org/show_bug.cgi?id=128976
1600
1601         Reviewed by Jer Noble.
1602
1603         No new tests, covered by existing tests.
1604
1605         * html/HTMLMediaElement.cpp:
1606         (WebCore::HTMLMediaElement::refreshCachedTime): Don't mark the cached time as valid
1607             until it is non-zero.
1608
1609 2014-02-18  Mihai Tica  <mitica@adobe.com>
1610
1611         [CSS Blending] Add -webkit-blend-mode support for SVG.
1612
1613         https://bugs.webkit.org/show_bug.cgi?id=110427
1614         Reviewed by Dirk Schulze.
1615
1616         Add support for blend modes to SVG. This includes adding and validating isolation for blending.
1617         Make masked elements isolate blending by creating a transparency layer.
1618
1619         Tests: css3/compositing/svg-blend-color-burn.html
1620                css3/compositing/svg-blend-color-dodge.html
1621                css3/compositing/svg-blend-color.html
1622                css3/compositing/svg-blend-darken.html
1623                css3/compositing/svg-blend-difference.html
1624                css3/compositing/svg-blend-exclusion.html
1625                css3/compositing/svg-blend-hard-light.html
1626                css3/compositing/svg-blend-hue.html
1627                css3/compositing/svg-blend-layer-blend.html
1628                css3/compositing/svg-blend-layer-clip-path.html
1629                css3/compositing/svg-blend-layer-filter.html
1630                css3/compositing/svg-blend-layer-mask.html
1631                css3/compositing/svg-blend-layer-opacity.html
1632                css3/compositing/svg-blend-layer-shadow.html
1633                css3/compositing/svg-blend-lighten.html
1634                css3/compositing/svg-blend-luminosity.html
1635                css3/compositing/svg-blend-multiply-alpha.html
1636                css3/compositing/svg-blend-multiply.html
1637                css3/compositing/svg-blend-normal.html
1638                css3/compositing/svg-blend-overlay.html
1639                css3/compositing/svg-blend-saturation.html
1640                css3/compositing/svg-blend-screen.html
1641                css3/compositing/svg-blend-soft-light.html
1642
1643         * rendering/RenderElement.cpp:
1644         (WebCore::RenderElement::styleDidChange): Also pass a pointer to the old style when calling SVGRenderSupport::styleChanged.
1645         * rendering/style/RenderStyle.h:  Add blendMode default getter when CSS_COMPOSITING is disabled.
1646         * rendering/style/SVGRenderStyle.h:
1647         (WebCore::SVGRenderStyle::isolatesBlending): Add method.
1648         * rendering/svg/SVGRenderSupport.cpp:
1649         (WebCore::SVGRenderSupport::styleChanged): Call updateMaskedAncestorShouldIsolateBlending only when a blend mode is set/unset.
1650         (WebCore::SVGRenderSupport::isolatesBlending): Implement method that decides whether an SVGElement isolates or not blending.
1651         (WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending): Traverse to the nearest ancestor having a mask.
1652         - Set a flag causing the creation of a transparency layer when rendering the masked element.
1653         * rendering/svg/SVGRenderSupport.h:
1654         * rendering/svg/SVGRenderingContext.cpp:
1655         (WebCore::SVGRenderingContext::prepareToRenderSVGContent): Call GraphicsContext::setCompositeOperation.
1656         - Isolate blending by creating a transparency layer.
1657         - Isolate group when rendering a masked element having a blended child node.
1658         * svg/SVGGraphicsElement.cpp:
1659         (WebCore::SVGGraphicsElement::SVGGraphicsElement): Set default m_shouldIsolateBlending to false.
1660         * svg/SVGGraphicsElement.h: Add m_shouldIsolateBlending member, getter and setter.
1661         (WebCore::SVGGraphicsElement::shouldIsolateBlending):
1662         (WebCore::SVGGraphicsElement::setShouldIsolateBlending):
1663
1664 2014-02-18  ChangSeok Oh  <changseok.oh@collabora.com>
1665
1666         [GTK] Unreviewed fix. Correct wrong flags, ENABLE(GTK)->PLATFORM(GTK).
1667
1668         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
1669         (WebCore::Extensions3DOpenGL::drawArraysInstanced):
1670         (WebCore::Extensions3DOpenGL::drawElementsInstanced):
1671         (WebCore::Extensions3DOpenGL::vertexAttribDivisor):
1672
1673 2014-02-18  Mihnea Ovidenie  <mihnea@adobe.com>
1674
1675         [CSSRegions] Compute region ranges for inline replaced elements
1676         https://bugs.webkit.org/show_bug.cgi?id=128800
1677
1678         Reviewed by Andrei Bucur.
1679
1680         Tests: fast/regions/hover-content-inside-iframe-in-region.html
1681                fast/regions/select-multiple-in-region.html
1682
1683         When asking for the range of regions for an inline replaced box,
1684         use the region cached on the root inline box for the inline replaced
1685         box as the range of regions is computed only for blocks.
1686         A future patch will extend the computation of region ranges
1687         for inline blocks too.
1688
1689         * rendering/RenderBoxModelObject.cpp:
1690         (WebCore::RenderBoxModelObject::mapAbsoluteToLocalPoint):
1691         Remove the restriction set during https://bugs.webkit.org/show_bug.cgi?id=113703
1692         and enable the code path for boxes not only for blocks.
1693         Method RenderFlowThread::getRegionRangeForBox returns a null region when it is unable
1694         to get the region range and we already check for null region case.
1695         * rendering/RenderFlowThread.cpp:
1696         (WebCore::RenderFlowThread::getRegionRangeForBox):
1697
1698 2014-02-18  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1699
1700         Move inheriting method to the superclass in the JavaScript media controls
1701         https://bugs.webkit.org/show_bug.cgi?id=128897
1702
1703         Reviewed by Jer Noble.
1704
1705         The inheriting method of the JavaScript multimedia controls was
1706         moved from the subclasses to the superclass because this way it is
1707         only defined once.
1708
1709         * Modules/mediacontrols/mediaControlsApple.js:
1710         (Controller.prototype.extend): Added to replace inheritFrom in the
1711         subclasses.
1712         * Modules/mediacontrols/mediaControlsGtk.js:
1713         * Modules/mediacontrols/mediaControlsiOS.js: Removed inheritFrom
1714         and used extend.
1715
1716 2014-02-18  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1717
1718         [GTK] Fix hitting hasClass() assertion in debug with the new JS media controls
1719         https://bugs.webkit.org/show_bug.cgi?id=128820
1720
1721         Reviewed by Martin Robinson.
1722
1723         The code introduced at r164024 caused the hit of hasClass()
1724         assertion when getting the classNames() of an element with no
1725         class. Now we check for it to avoid the assertion.
1726
1727         No new tests, current set detects the crash in many tests.
1728
1729         * platform/gtk/RenderThemeGtk.cpp:
1730         (WebCore::nodeHasClass): Check for hasClass() in order not to hit
1731         the assertion when getting the classNames() in debug mode.
1732
1733 2014-02-18  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1734
1735         Refactor SVGPreserveAspectRatio::parse()
1736         https://bugs.webkit.org/show_bug.cgi?id=128658
1737
1738         Reviewed by Dirk Schulze.
1739
1740         To removed "goto" in SVGPreserveAspectRatio::parse(), this patch introduce parseInternal() to handle
1741         existing behavior with local variables, and existing/new parse() functions invoke it, then set
1742         those to member variables.
1743
1744         Motivated from Blink: https://src.chromium.org/viewvc/blink?view=rev&revision=166927
1745
1746         No new tests, no behavior change.
1747
1748         * svg/SVGPreserveAspectRatio.cpp:
1749         (WebCore::SVGPreserveAspectRatio::parse):
1750         (WebCore::SVGPreserveAspectRatio::parseInternal):
1751         * svg/SVGPreserveAspectRatio.h: Add parse() and parseInternal() functions.
1752
1753 2014-02-17  Radu Stavila  <stavila@adobe.com>
1754
1755         [CSS Regions] Move specific named flow methods from RenderRegion to RenderNamedFlowFragment
1756         https://bugs.webkit.org/show_bug.cgi?id=128914
1757
1758         Reviewed by Antti Koivisto.
1759
1760         Moved named flow specific methods regionContainer() and regionContainerLayer() from 
1761         RenderRegion to RenderNamedFlowFragment and renamed them to fragmentContainer and
1762         fragmentContainerLayer.
1763
1764         No new tests required.
1765
1766         * rendering/RenderLayer.cpp:
1767         (WebCore::RenderLayer::mapLayerClipRectsToFragmentationLayer):
1768         (WebCore::RenderLayer::calculateClipRects):
1769         * rendering/RenderNamedFlowFragment.cpp:
1770         (WebCore::RenderNamedFlowFragment::fragmentContainer):
1771         (WebCore::RenderNamedFlowFragment::fragmentContainerLayer):
1772         * rendering/RenderNamedFlowFragment.h:
1773         * rendering/RenderRegion.cpp:
1774         * rendering/RenderRegion.h:
1775
1776 2014-02-17  Sangho Kim  <thomas.kim@lge.com>
1777
1778         Move PublicURLMansger to std::unique_ptr.
1779         https://bugs.webkit.org/show_bug.cgi?id=128891
1780
1781         Reviewed by Anders Carlsson.
1782
1783         Use std::unique_ptr and std::make_unique in place of PassOwnPtr and adoptPtr in the PublicURLManager
1784
1785         * dom/ScriptExecutionContext.h:
1786         * html/PublicURLManager.cpp:
1787         (WebCore::PublicURLManager::create):
1788         * html/PublicURLManager.h:
1789
1790 2014-02-17  Ricky Mondello  <rmondello@apple.com>
1791
1792         Expose a way to clear cookies modified after a given date
1793         https://bugs.webkit.org/show_bug.cgi?id=128845
1794
1795         Reviewed by Alexey Proskuryakov.
1796
1797         * WebCore.exp.in: Add a symbol.
1798         * platform/network/PlatformCookieJar.h: Declare deleteAllCookiesModifiedAfterDate.
1799         * platform/network/cf/CookieJarCFNet.cpp:
1800         (WebCore::deleteAllCookiesModifiedAfterDate): Add a stub.
1801         * platform/network/curl/CookieJarCurl.cpp:
1802         (WebCore::deleteAllCookiesModifiedAfterDate): Ditto.
1803         * platform/network/soup/CookieJarSoup.cpp:
1804         (WebCore::deleteAllCookiesModifiedAfterDate): Ditto.
1805         * platform/network/mac/CookieJarMac.mm: Add a category NSHTTPCookieStorage category with the method
1806             used for time-based clearing so we can build on all platforms. For now, we'll check for support
1807             at runtime.
1808         (WebCore::deleteAllCookiesModifiedAfterDate): Added. Without foundation API, we'll ignore the passed-in
1809             NetworkStorageSession.
1810
1811 2014-02-17  Benjamin Poulain  <bpoulain@apple.com>
1812
1813         SelectorCompiler incorrectly saves a backtracking register for a child chain without descendant relation on the right
1814         https://bugs.webkit.org/show_bug.cgi?id=128944
1815
1816         Reviewed by Andreas Kling.
1817
1818         When resolving the backtracking relations, the value of ancestorPositionSinceDescendantRelation was incorrect for the
1819         rightmost child chain.
1820         What was happenning is updateChainStates() would increment ancestorPositionSinceDescendantRelation even if there was
1821         no descendant relation previously in the chain. As a result, the second SelectorFragment in the fragment chain would
1822         save a backtracking register.
1823
1824         Previously this would just be a wasted register but since r163850, the number of registers available for compilation
1825         is defined by SelectorCompiler::minimumRegisterRequirements(). Since we would have one less register available than computed,
1826         we could run out of register and RegisterAllocator would invoke WTFCrash to avoid generating incorrect code.
1827
1828         This patch fixes the issue by not updating ancestorPositionSinceDescendantRelation until the first descendant relation
1829         is seen. There was no need to fix the Adjacent relation because adjacentPositionSinceIndirectAdjacentTreeWalk already
1830         had the correct guard.
1831
1832         Test: fast/selectors/querySelector-rightmost-child-chain-attribute-matching.html
1833
1834         * cssjit/SelectorCompiler.cpp:
1835         (WebCore::SelectorCompiler::updateChainStates):
1836         (WebCore::SelectorCompiler::isFirstAdjacent): The name was a bad copy-paste, fix it.
1837
1838 2014-02-17  Dean Jackson  <dino@apple.com>
1839
1840         Constrain replaced element layout to from-intrinsic aspect ratio if specified
1841         https://bugs.webkit.org/show_bug.cgi?id=128629
1842
1843         Reviewed by Simon Fraser.
1844
1845         First pass at implementing -webkit-aspect-ratio: from-instrinsics;
1846
1847         After RenderReplaced has done layout, attempt to update the
1848         resulting size to match the desired aspect ratio. This step
1849         will only reduce the size of an element, and never below the
1850         minimum dimensions.
1851
1852         Tests: fast/css/aspect-ratio/columns.html
1853                fast/css/aspect-ratio/containers.html
1854                fast/css/aspect-ratio/simple.html
1855
1856         * rendering/RenderImage.cpp:
1857         (WebCore::RenderImage::imageDimensionsChanged): If we get an update
1858         to our intrinsic dimensions, and layout depends on this, trigger
1859         another layout pass.
1860         * rendering/RenderReplaced.cpp:
1861         (WebCore::RenderReplaced::layout): Implement the step described
1862         above.
1863
1864 2014-02-17  Sam Weinig  <sam@webkit.org>
1865
1866         Fix build.
1867
1868         * WebCore.exp.in:
1869
1870 2014-02-17  Anders Carlsson  <andersca@apple.com>
1871
1872         Remove ENABLE_GLOBAL_FASTMALLOC_NEW
1873         https://bugs.webkit.org/show_bug.cgi?id=127067
1874
1875         Reviewed by Geoffrey Garen.
1876
1877         * platform/Timer.h:
1878
1879 2014-02-17  Sam Weinig  <sam@webkit.org>
1880
1881         Move iOS only Settings into Settings.in and make them not-iOS only
1882         https://bugs.webkit.org/show_bug.cgi?id=128942
1883
1884         Reviewed by Tim Horton.
1885
1886         * page/Settings.cpp:
1887         * page/Settings.h:
1888         * page/Settings.in:
1889
1890 2014-02-17  Anders Carlsson  <andersca@apple.com>
1891
1892         Remove view source code
1893         https://bugs.webkit.org/show_bug.cgi?id=127233
1894
1895         Reviewed by Antti Koivisto.
1896
1897         * CMakeLists.txt:
1898         * DerivedSources.make:
1899         * GNUmakefile.am:
1900         * GNUmakefile.list.am:
1901         * WebCore.vcxproj/WebCore.vcxproj:
1902         * WebCore.vcxproj/WebCore.vcxproj.filters:
1903         * WebCore.xcodeproj/project.pbxproj:
1904         * bindings/js/ScriptController.cpp:
1905         (WebCore::ScriptController::canExecuteScripts):
1906         * css/CSSDefaultStyleSheets.cpp:
1907         * css/CSSDefaultStyleSheets.h:
1908         * css/DocumentRuleSets.cpp:
1909         (WebCore::DocumentRuleSets::appendAuthorStyleSheets):
1910         (WebCore::DocumentRuleSets::collectFeatures):
1911         * css/DocumentRuleSets.h:
1912         * css/ElementRuleCollector.cpp:
1913         (WebCore::ElementRuleCollector::matchUARules):
1914         * css/StyleResolver.cpp:
1915         (WebCore::StyleResolver::appendAuthorStyleSheets):
1916         (WebCore::StyleResolver::styleForElement):
1917         * css/view-source.css: Removed.
1918         * dom/DOMImplementation.cpp:
1919         (WebCore::DOMImplementation::createDocument):
1920         * dom/DOMImplementation.h:
1921         * dom/Document.cpp:
1922         (WebCore::Document::Document):
1923         * dom/Document.h:
1924         * html/HTMLAttributeNames.in:
1925         * html/HTMLFrameElementBase.cpp:
1926         (WebCore::HTMLFrameElementBase::HTMLFrameElementBase):
1927         (WebCore::HTMLFrameElementBase::openURL):
1928         * html/HTMLFrameElementBase.h:
1929         * html/HTMLViewSourceDocument.cpp: Removed.
1930         * html/HTMLViewSourceDocument.h: Removed.
1931         * html/parser/HTMLToken.h:
1932         * html/parser/HTMLViewSourceParser.cpp: Removed.
1933         * html/parser/HTMLViewSourceParser.h: Removed.
1934         * html/parser/TextViewSourceParser.cpp: Removed.
1935         * html/parser/TextViewSourceParser.h: Removed.
1936         * inspector/InspectorOverlayPage.css:
1937         (.tag-name):
1938         (.node-id):
1939         (.class-name):
1940         * loader/DocumentWriter.cpp:
1941         (WebCore::DocumentWriter::createDocument):
1942         * loader/FrameLoader.cpp:
1943         (WebCore::FrameLoader::receivedFirstData):
1944         * page/Frame.cpp:
1945         (WebCore::Frame::Frame):
1946         * page/Frame.h:
1947         * xml/DOMParser.cpp:
1948         (WebCore::DOMParser::parseFromString):
1949         * xml/XMLViewer.css:
1950         (.tag):
1951         * xml/XSLTProcessor.cpp:
1952         (WebCore::XSLTProcessor::createDocumentFromSource):
1953
1954 2014-02-17  Simon Fraser  <simon.fraser@apple.com>
1955
1956         box-shadows get truncated with a combination of transforms and clip: (affects Google Maps)
1957         https://bugs.webkit.org/show_bug.cgi?id=128937
1958
1959         Reviewed by Dean Jackson.
1960         
1961         RenderLayer::calculateLayerBounds() incorrectly assumed that if localClipRect() returns
1962         a non-infinite rect, that rect is OK to use as the compositing bounds.
1963         
1964         That is not a valid assumption when clip() has a larger rect than the element (e.g.
1965         with negative top/left in the rect). In that case, localClipRect() still just
1966         returns the background rect, but we actually need a larger compositing layer
1967         to show the unclipped parts of descendants.
1968         
1969         Fix by detecting clip() that exceeds the renderer bounds, and when it does,
1970         not early returning in the UseLocalClipRectIfPossible clause.
1971
1972         Test: compositing/geometry/css-clip-oversize.html
1973
1974         * rendering/RenderLayer.cpp:
1975         (WebCore::RenderLayer::localClipRect): Do a convertToLayerCoords()
1976         because we need offsetFromRoot later, and we can pass our value down to
1977         calculateRects(). Compute clipExceedsBounds based on the CSS clip rect.
1978         (WebCore::RenderLayer::calculateClipRects): Don't early return if clipExceedsBounds
1979         is true.
1980         * rendering/RenderLayer.h:
1981
1982 2014-02-17  Antti Koivisto  <antti@apple.com>
1983
1984         Make TreeScope::rootNode return a reference
1985         https://bugs.webkit.org/show_bug.cgi?id=128934
1986
1987         Reviewed by Andreas Kling.
1988
1989         It is never null.
1990
1991         * css/ElementRuleCollector.cpp:
1992         (WebCore::ElementRuleCollector::collectMatchingRules):
1993         * dom/ContainerNode.h:
1994         (WebCore::Node::isTreeScope):
1995         * dom/Document.cpp:
1996         (WebCore::Document::buildAccessKeyMap):
1997         * dom/DocumentOrderedMap.cpp:
1998         (WebCore::DocumentOrderedMap::add):
1999         (WebCore::DocumentOrderedMap::get):
2000         (WebCore::DocumentOrderedMap::getAllElementsById):
2001         * dom/EventDispatcher.cpp:
2002         (WebCore::EventRelatedNodeResolver::moveToParentOrShadowHost):
2003         (WebCore::eventTargetRespectingTargetRules):
2004         (WebCore::shouldEventCrossShadowBoundary):
2005         * dom/Node.cpp:
2006         (WebCore::Node::containingShadowRoot):
2007         (WebCore::Node::removedFrom):
2008         * dom/ShadowRoot.h:
2009         (WebCore::isShadowRoot):
2010         * dom/TreeScope.h:
2011         (WebCore::TreeScope::rootNode):
2012         * page/DOMSelection.cpp:
2013         (WebCore::DOMSelection::DOMSelection):
2014         * page/DragController.cpp:
2015         (WebCore::asFileInput):
2016         * page/FocusController.cpp:
2017         (WebCore::FocusNavigationScope::rootNode):
2018
2019 2014-02-17  Chris Fleizach  <cfleizach@apple.com>
2020
2021         AX: Invalid cast in WebCore::AccessibilityTable::isDataTable (CRBug 280352)
2022         <https://webkit.org/b/128925>
2023         <rdar://problem/16087351>
2024
2025         Merged from Blink (patch by Dominic Mazzoni):
2026         https://src.chromium.org/viewvc/blink?revision=159711&view=revision
2027
2028         Reviewed by Oliver Hunt.
2029
2030         Don't cast to a table cell element unless we are sure it is one.
2031
2032         Test: accessibility/display-table-cell-causes-crash.html
2033
2034         * accessibility/AccessibilityTable.cpp:
2035         (WebCore::AccessibilityTable::isDataTable):
2036
2037 2014-02-17  Antti Koivisto  <antti@apple.com>
2038
2039         Node constructor should take Document reference
2040         https://bugs.webkit.org/show_bug.cgi?id=128931
2041
2042         Reviewed by Geoff Garen.
2043
2044         * dom/Attr.cpp:
2045         (WebCore::Attr::Attr):
2046         * dom/CharacterData.h:
2047         (WebCore::CharacterData::CharacterData):
2048         * dom/ContainerNode.cpp:
2049         (WebCore::ContainerNode::~ContainerNode):
2050         * dom/ContainerNode.h:
2051         (WebCore::ContainerNode::ContainerNode):
2052         * dom/Document.cpp:
2053         (WebCore::Document::Document):
2054         * dom/Document.h:
2055         (WebCore::Node::Node):
2056         * dom/DocumentFragment.cpp:
2057         (WebCore::DocumentFragment::DocumentFragment):
2058         (WebCore::DocumentFragment::create):
2059         * dom/DocumentFragment.h:
2060         * dom/DocumentType.cpp:
2061         (WebCore::DocumentType::DocumentType):
2062         * dom/Element.h:
2063         (WebCore::Element::Element):
2064         * dom/Entity.h:
2065         (WebCore::Entity::Entity):
2066         * dom/EntityReference.cpp:
2067         (WebCore::EntityReference::EntityReference):
2068         * dom/Node.cpp:
2069         (WebCore::Node::~Node):
2070         (WebCore::Node::willBeDeletedFrom):
2071         * dom/Node.h:
2072         * dom/Notation.cpp:
2073         * dom/Notation.h:
2074         (WebCore::Notation::publicId):
2075         (WebCore::Notation::systemId):
2076         (WebCore::Notation::Notation):
2077         
2078             Remove cruft from this non-instantiated class.
2079
2080         * dom/ShadowRoot.cpp:
2081         (WebCore::ShadowRoot::ShadowRoot):
2082         (WebCore::ShadowRoot::~ShadowRoot):
2083         * dom/TemplateContentDocumentFragment.h:
2084
2085 2014-02-17  Sergio Correia  <sergio.correia@openbossa.org>
2086
2087         Replace uses of PassOwnPtr/OwnPtr with std::unique_ptr in WebCore/inspector
2088         https://bugs.webkit.org/show_bug.cgi?id=128681
2089
2090         Reviewed by Timothy Hatcher.
2091
2092         Another step towards getting rid of PassOwnPtr/OwnPtr, now targeting
2093         WebCore/inspector/*. Besides files in there, a few other files in
2094         JavaScriptCore/inspector, WebKit/, WebKit2/WebProcess/WebCoreSupport/
2095         and WebCore/testing were touched.
2096
2097         No new tests; no new behavior.
2098
2099         * WebCore.exp.in:
2100         * inspector/CommandLineAPIHost.cpp:
2101         * inspector/CommandLineAPIHost.h:
2102         * inspector/DOMEditor.cpp:
2103         * inspector/DOMPatchSupport.cpp:
2104         * inspector/DOMPatchSupport.h:
2105         * inspector/InspectorApplicationCacheAgent.h:
2106         * inspector/InspectorCSSAgent.cpp:
2107         * inspector/InspectorCSSAgent.h:
2108         * inspector/InspectorCanvasAgent.h:
2109         * inspector/InspectorDOMAgent.cpp:
2110         * inspector/InspectorDOMAgent.h:
2111         * inspector/InspectorDOMDebuggerAgent.h:
2112         * inspector/InspectorDOMStorageAgent.h:
2113         * inspector/InspectorDatabaseAgent.h:
2114         * inspector/InspectorFrontendClientLocal.cpp:
2115         * inspector/InspectorFrontendClientLocal.h:
2116         * inspector/InspectorHeapProfilerAgent.h:
2117         * inspector/InspectorHistory.cpp:
2118         * inspector/InspectorHistory.h:
2119         * inspector/InspectorIndexedDBAgent.h:
2120         * inspector/InspectorInputAgent.h:
2121         * inspector/InspectorLayerTreeAgent.h:
2122         * inspector/InspectorMemoryAgent.cpp:
2123         * inspector/InspectorMemoryAgent.h:
2124         * inspector/InspectorOverlay.cpp:
2125         * inspector/InspectorOverlay.h:
2126         * inspector/InspectorProfilerAgent.cpp:
2127         * inspector/InspectorProfilerAgent.h:
2128         * inspector/InspectorResourceAgent.cpp:
2129         * inspector/InspectorResourceAgent.h:
2130         * inspector/InspectorStyleSheet.cpp:
2131         * inspector/InspectorStyleSheet.h:
2132         * inspector/InspectorTimelineAgent.h:
2133         * inspector/InspectorWorkerAgent.cpp:
2134         * inspector/PageConsoleAgent.cpp:
2135         * inspector/PageRuntimeAgent.h:
2136         * inspector/WebConsoleAgent.cpp:
2137         * inspector/WorkerRuntimeAgent.h:
2138         * testing/Internals.cpp:
2139
2140 2014-02-17  Antti Koivisto  <antti@apple.com>
2141
2142         Rename Document::m_selfOnlyRefCount to m_referencingNodeCount
2143         https://bugs.webkit.org/show_bug.cgi?id=128916
2144
2145         Reviewed by Andreas Kling.
2146
2147         Make the name more informative. Also make it zero based (document is not considered to reference itself).
2148
2149         * dom/Document.cpp:
2150         (WebCore::Document::Document):
2151         (WebCore::Document::removedLastRef):
2152         * dom/Document.h:
2153         (WebCore::Document::increaseReferencingNodeCount):
2154         (WebCore::Document::decreaseReferencingNodeCount):
2155         (WebCore::Node::Node):
2156         * dom/Node.cpp:
2157         (WebCore::Node::~Node):
2158         * dom/TreeScopeAdopter.cpp:
2159         (WebCore::TreeScopeAdopter::moveTreeToNewScope):
2160         (WebCore::TreeScopeAdopter::moveNodeToNewDocument):
2161
2162 2014-02-17  ChangSeok Oh  <changseok.oh@collabora.com>
2163
2164         [GTK] Build failure caused by missing jsmin module
2165         https://bugs.webkit.org/show_bug.cgi?id=128742
2166
2167         Reviewed by Philippe Normand.
2168
2169         No new tests since no functionality changed.
2170
2171         * GNUmakefile.am: Relocate PYTHONPATH to make it meaningful.
2172
2173 2014-02-17  Radu Stavila  <stavila@adobe.com>
2174
2175         [CSS Regions] Make regions unsplittable
2176         https://bugs.webkit.org/show_bug.cgi?id=128811
2177
2178         Reviewed by David Hyatt.
2179
2180         At the moment, nested regions are not properly fragmented across regions. For the moment, 
2181         the regions will become unsplittable elements to avoid slicing. At a later time a proper
2182         fragmentation algorithm should be written, also taking into consideration pagination strut.
2183
2184         Test: fast/regions/unsplittable-nested-region.html
2185
2186         * rendering/RenderBox.cpp:
2187         (WebCore::RenderBox::isUnsplittableForPagination):
2188
2189 2014-02-17  Simon Fraser  <simon.fraser@apple.com>
2190
2191         Graphics buffer issue with clip-path and fixed positioned element
2192         https://bugs.webkit.org/show_bug.cgi?id=126262
2193
2194         Reviewed by Tim Horton.
2195         
2196         If an element has a clip-path, backgroundIsKnownToBeOpaqueInRect() needs
2197         to return false so that we don't try to make opaque compositing layers.
2198
2199         Test: compositing/contents-opaque/opaque-with-clip-path.html
2200
2201         * rendering/RenderBox.cpp:
2202         (WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect):
2203
2204 2014-02-17  Radu Stavila  <stavila@adobe.com>
2205
2206         [CSS Regions] The box decorations of an element overflowing a region should be clipped at the border box, not the content box
2207         https://bugs.webkit.org/show_bug.cgi?id=128815
2208
2209         Reviewed by Andrei Bucur.
2210
2211         Elements flowed into a region should not be painted past the region's content box
2212         if they continue to flow into another region in that direction.
2213         If they do not continue into another region in that direction, they should be
2214         painted all the way to the region's border box.
2215         Regions with overflow:hidden will apply clip at the border box, not the content box.
2216
2217         Tests: fast/regions/box-decorations-over-region-padding-fragmented.html
2218                fast/regions/box-decorations-over-region-padding-horiz-bt.html
2219                fast/regions/box-decorations-over-region-padding-vert-lr.html
2220                fast/regions/box-decorations-over-region-padding-vert-rl.html
2221                fast/regions/box-decorations-over-region-padding.html
2222
2223         * rendering/RenderNamedFlowFragment.cpp:
2224         (WebCore::RenderNamedFlowFragment::flowThreadPortionRectForClipping):
2225         * rendering/RenderNamedFlowFragment.h:
2226         * rendering/RenderRegion.cpp:
2227         (WebCore::RenderRegion::rectFlowPortionForBox):
2228
2229 2014-02-17  Brendan Long  <b.long@cablelabs.com>
2230
2231         DataCue.data should be a copy of the input ArrayBuffer, not a pointer
2232         https://bugs.webkit.org/show_bug.cgi?id=128886
2233
2234         Reviewed by Eric Carlson.
2235
2236         No new tests, just updated existing track-datacue.html test.
2237
2238         * html/track/DataCue.cpp:
2239         (WebCore::DataCue::DataCue): Add ExceptionCode and pass through to setData().
2240         (WebCore::DataCue::data): Return a copy of m_data instead of a pointer.
2241         (WebCore::DataCue::setData): Create a copy of the input data, or throw an exception if it's null.
2242         * html/track/DataCue.h: Add ExceptionCode parameters to constructor and data setter.
2243         * html/track/DataCue.idl: Same.
2244
2245 2014-02-17  David Kilzer  <ddkilzer@apple.com>
2246
2247         CounterContentData::counter() and ImageContentData::image() should return references
2248         <http://webkit.org/b/128671>
2249
2250         Reviewed by Darin Adler.
2251
2252         * css/CSSComputedStyleDeclaration.cpp:
2253         (WebCore::contentToCSSValue):
2254         - Update to use references.  Remove useless ASSERTs.
2255
2256         * css/StyleResolver.cpp:
2257         (WebCore::StyleResolver::loadPendingImages):
2258         - Update to use references.  StyleResolver::loadPendingImage()
2259           will be changed to take a reference in the near future.
2260
2261         * rendering/RenderElement.cpp:
2262         (WebCore::RenderElement::createFor):
2263         - Update to use references.  The auto keyword wanted to
2264           instantiate a StyleImage instead a reference, so it was
2265           replaced.
2266
2267         * rendering/style/ContentData.h:
2268         (WebCore::ImageContentData::ImageContentData): Add ASSERT that
2269         m_image is not NULL.
2270         (WebCore::ImageContentData::image): Return a reference.  Remove
2271         useless overload with identical name.
2272         (WebCore::ImageContentData::cloneInternal): Simplify by using
2273         implicit PassRefPtr constructor.
2274         (WebCore::operator==): Remove unneeded deref operators.
2275         (WebCore::CounterContentData::counter): Return a reference.
2276         (WebCore::CounterContentData::cloneInternal): Remove unneeded
2277         deref operator.
2278         (WebCore::operator==): Remove unneeded deref operators.
2279
2280 2014-02-17  Jer Noble  <jer.noble@apple.com>
2281
2282         [MediaControls][iOS] Make mediacontrols match the system inline controls
2283         https://bugs.webkit.org/show_bug.cgi?id=128833
2284
2285         Reviewed by Eric Carlson.
2286
2287         Move items slightly, fix button sizes, font sizes, and colors to match the
2288         inline controls from MoviePlayer.framework.
2289
2290         * Modules/mediacontrols/mediaControlsiOS.css:
2291         (audio::-webkit-media-controls-panel):
2292         (audio::-webkit-media-controls-fullscreen-button):
2293         (audio::-webkit-media-controls-play-button):
2294         (audio::-webkit-media-controls-play-button.paused):
2295         (audio::-webkit-media-controls-timeline):
2296         (audio::-webkit-media-controls-timeline::-webkit-slider-thumb):
2297         (audio::-webkit-media-controls-time-remaining-display):
2298         * Modules/mediacontrols/mediaControlsiOS.js:
2299         (ControllerIOS.prototype.configureInlineControls): Do not add the status text.
2300         (ControllerIOS.prototype.updateTime): Call updateProgress().
2301         (ControllerIOS.prototype.progressFillStyle): Draw a slightly different color.
2302         (ControllerIOS.prototype.updateProgress): Draw white to the left of the currentTime.
2303         (ControllerIOS.prototype.formatTime): Single leading zero in the time display fields.
2304         (ControllerIOS.prototype.handleTimelineChange): Call updateProgress().
2305
2306 2014-02-17  Manuel Rego Casasnovas  <rego@igalia.com>
2307
2308         [CSS Grid Layout] Fix missing layout in flexible and content sized columns
2309         https://bugs.webkit.org/show_bug.cgi?id=128672
2310
2311         Reviewed by Sergio Villar Senin.
2312
2313         RenderGrid::logicalContentHeightForChild() is called for some items at the beginning of RenderGrid::layoutGridItems()
2314         from RenderGrid::computeUsedBreadthOfGridTracks(). This causes that the comparison inside the for loop in
2315         RenderGrid::layoutGridItems() does not detect width changes, so elements won't be marked as needsLayout.
2316
2317         So the comparison is done in RenderGrid::logicalContentHeightForChild() and the element is marked to perform a layout if
2318         the width has changed.
2319
2320         The issue can be reproduced easily with a simple grid with one flexible or content sized column, all the available width
2321         is not used. On top of that, when you resize the window the flexible or content sized columns are not updating their
2322         size properly.
2323
2324         CSS Grid Layout perftest results are around 4% worse, which is expected as we're adding a missing layout.
2325
2326         Test: fast/css-grid-layout/flex-content-sized-column-use-available-width.html
2327
2328         * rendering/RenderGrid.cpp:
2329         (WebCore::RenderGrid::logicalContentHeightForChild): Check width changes and mark element as needed layout if required.
2330
2331 2014-02-16  Andreas Kling  <akling@apple.com>
2332
2333         Ensure that removing an iframe from the DOM tree disconnects its Frame.
2334         <https://webkit.org/b/128889>
2335         <rdar://problem/15671221>
2336
2337         Merged from Blink (patch by Adam Klein):
2338         https://src.chromium.org/viewvc/blink?revision=156174&view=revision
2339
2340         SubframeLoadingDisabler wasn't catching the case when an <iframe> was,
2341         in its unload handler, removed and re-added to the same parent.
2342         Fix this by using a count of SubframeLoadingDisablers that are on the
2343         stack for a given root, rather than a simple boolean.
2344
2345         Test: fast/frames/reattach-in-unload.html
2346
2347         * html/HTMLFrameOwnerElement.h:
2348         (WebCore::SubframeLoadingDisabler::disabledSubtreeRoots):
2349
2350 2014-02-16  Benjamin Poulain  <benjamin@webkit.org>
2351
2352         When applying style, attribute value matching should be case sensitive for SVG
2353         https://bugs.webkit.org/show_bug.cgi?id=128882
2354
2355         Reviewed by Andreas Kling.
2356
2357         SelectorChecker was incorrectly matching attribute values with a case insensitve comparison
2358         in some cases.
2359
2360         The choice to use case sensitive matching was taking into account the document type but not
2361         the element type. As a result, SVG (and likely MHTML) elements were incorrectly being tested
2362         as if they were HTML element.
2363
2364         With the patch, WebKit also matches the behavior of Firefox, which is great.
2365
2366         Tests: fast/css/case-insensitive-attribute-with-svg.html
2367                fast/selectors/querySelector-case-insensitive-attribute-match-with-svg.html
2368
2369         * css/SelectorChecker.cpp:
2370         (WebCore::SelectorChecker::checkOne):
2371
2372 2014-02-16  Benjamin Poulain  <benjamin@webkit.org>
2373
2374         Split compilation state between querySelector and CSS matching
2375         https://bugs.webkit.org/show_bug.cgi?id=128869
2376
2377         Reviewed by Antti Koivisto.
2378
2379         Cleanup after recent changes:
2380         -SelectorCompiler now has a SelectorContext defining if the code is compiled for QuerySelector
2381          or for ElementRuleCollector.
2382         -Generalize m_selectorCannotMatchAnything by making it part of the FunctionType. FunctionType now
2383          fully represent the type of code generation and we don't rely implicitly on m_selectorFragments being
2384          empty.
2385
2386         * css/ElementRuleCollector.cpp:
2387         (WebCore::ElementRuleCollector::ruleMatches):
2388
2389         * cssjit/SelectorCompiler.cpp:
2390         (WebCore::SelectorCompiler::compileSelector):
2391         (WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
2392         There is no tree marking for QuerySelector, so we can generate a simple selector
2393         for the sibling selectors.
2394
2395         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
2396         The code is split to make it simpler. The classic code generation has been moved
2397         to generateSelectorChecker().
2398         The decision on what to generate is reduced to a simple switch-case.
2399
2400         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
2401         The code that was previously in compile().
2402
2403         (WebCore::SelectorCompiler::SelectorCodeGenerator::markParentElementIfResolvingStyle):
2404         We should not generate tree marking on querySelector traversal. Since the constructor
2405         now generate a SimpleChecker, it would also be incorrect to attempt to access the checkingContext
2406         on the stack.
2407         We can just skip the marking entierly.
2408
2409         * cssjit/SelectorCompiler.h:
2410         * dom/SelectorQuery.cpp:
2411         (WebCore::SelectorDataList::execute):
2412         With the changes of SelectorContext, we can no longer generate a complex checker for querySelector.
2413         This code may come back in the future but at the moment it is useless.
2414
2415 2014-02-16  Benjamin Poulain  <bpoulain@apple.com>
2416
2417         The FTP view is squished to the left
2418         https://bugs.webkit.org/show_bug.cgi?id=128856
2419
2420         Reviewed by Andreas Kling.
2421
2422         * html/FTPDirectoryDocument.cpp:
2423         (WebCore::FTPDirectoryDocumentParser::createBasicDocument):
2424
2425 2014-02-16  Jae Hyun Park  <jae.park@company100.net>
2426
2427         [Coordinated Graphics] Make AreaAllocator fast allocated
2428         https://bugs.webkit.org/show_bug.cgi?id=124995
2429
2430         Reviewed by Anders Carlsson.
2431
2432         AreaAllocator can be created and destroyed frequently (at least once per
2433         frame) in case of animation with changing width or height. So, it's
2434         better to make AreaAllocator fast allocated.
2435
2436         * platform/graphics/texmap/coordinated/AreaAllocator.h:
2437
2438 2014-02-16  Pratik Solanki  <psolanki@apple.com>
2439
2440         [iOS] WebKit crashes if text is copied to pasteboard with style containing text-shadow
2441         https://bugs.webkit.org/show_bug.cgi?id=128888
2442         <rdar://problem/16065699>
2443
2444         Reviewed by Anders Carlsson.
2445
2446         Use the correct class on iOS so that we don't crash.
2447
2448         * platform/mac/HTMLConverter.mm:
2449         (_shadowForShadowStyle):
2450
2451 2014-02-16  Andreas Kling  <akling@apple.com>
2452
2453         Atomicize frequently identical ResourceResponse string members.
2454         <https://webkit.org/b/128887>
2455
2456         Store the mime type, text encoding and HTTP response status text in
2457         AtomicStrings instead of Strings to deduplicate frequently occurring
2458         values (e.g "text/html", "utf-8" and "OK".)
2459
2460         Reviewed by Geoffrey Garen.
2461
2462         * platform/network/ResourceResponseBase.h:
2463         * platform/network/cf/ResourceResponseCFNet.cpp:
2464         (WebCore::ResourceResponse::cfURLResponse):
2465         (WebCore::ResourceResponse::platformLazyInit):
2466         * platform/network/mac/ResourceResponseMac.mm:
2467         (WebCore::ResourceResponse::platformLazyInit):
2468
2469 2014-02-16  Dan Bernstein  <mitz@apple.com>
2470
2471         Speculative iOS build fix.
2472
2473         * dom/Document.cpp:
2474         (WebCore::Document::Document):
2475
2476 2014-02-15  Antti Koivisto  <antti@apple.com>
2477
2478         Move document life time management from TreeScope to Document
2479         https://bugs.webkit.org/show_bug.cgi?id=128877
2480
2481         Reviewed by Andreas Kling.
2482
2483         Document life time is managed in confusing manner by TreeScopes which are also inherited to ShadowRoots.
2484         
2485         This patches moves the life time management to Document. Nodes in shadow trees selfOnlyRef the Document instead
2486         of the ShadowRoot. ShadowRoot is treated like any other node and selfOnlyRefs the Document as well (which it
2487         also did earlier, indirectly).
2488         
2489         TreeScope is devirtualized.
2490
2491         * css/ElementRuleCollector.cpp:
2492         (WebCore::ElementRuleCollector::collectMatchingRules):
2493         
2494             Author stylesheets never match in UA shadow trees.
2495
2496         * dom/ContainerNode.cpp:
2497         (WebCore::ContainerNode::~ContainerNode):
2498         * dom/Document.cpp:
2499         (WebCore::Document::Document):
2500         (WebCore::Document::~Document):
2501         (WebCore::Document::removedLastRef):
2502         * dom/Document.h:
2503         (WebCore::Document::selfOnlyRef):
2504         (WebCore::Document::selfOnlyDeref):
2505
2506             To avoid branches Document self-refs itself like all other Nodes. This is why deletion will now happen on ref count of 1.
2507
2508         (WebCore::Node::isDocumentNode):
2509         (WebCore::Node::Node):
2510         * dom/DocumentOrderedMap.cpp:
2511         (WebCore::DocumentOrderedMap::add):
2512         * dom/Element.cpp:
2513         (WebCore::Element::insertedInto):
2514         (WebCore::Element::removedFrom):
2515         * dom/Node.cpp:
2516         (WebCore::Node::~Node):
2517         (WebCore::Node::removedLastRef):
2518         * dom/Node.h:
2519         (WebCore::Node::document):
2520         (WebCore::Node::inDocument):
2521         * dom/ShadowRoot.cpp:
2522         (WebCore::ShadowRoot::ShadowRoot):
2523         (WebCore::ShadowRoot::~ShadowRoot):
2524         * dom/ShadowRoot.h:
2525         * dom/TreeScope.cpp:
2526         (WebCore::TreeScope::TreeScope):
2527         (WebCore::TreeScope::~TreeScope):
2528         (WebCore::TreeScope::setParentTreeScope):
2529         * dom/TreeScope.h:
2530         (WebCore::TreeScope::documentScope):
2531         
2532             Document can no longer ever be null.
2533
2534         (WebCore::TreeScope::rootNode):
2535         (WebCore::TreeScope::setDocumentScope):
2536         * dom/TreeScopeAdopter.cpp:
2537         (WebCore::TreeScopeAdopter::moveTreeToNewScope):
2538         (WebCore::TreeScopeAdopter::moveShadowTreeToNewDocument):
2539         
2540             Manage Document selfOnlyRefs for nodes in shadow trees too.
2541
2542         (WebCore::TreeScopeAdopter::updateTreeScope):
2543         (WebCore::TreeScopeAdopter::moveNodeToNewDocument):
2544         * dom/TreeScopeAdopter.h:
2545
2546 2014-02-16  Ryosuke Niwa  <rniwa@webkit.org>
2547
2548         setSelectionRange shouldn't directly instantiate VisibleSelection
2549         https://bugs.webkit.org/show_bug.cgi?id=128881
2550
2551         Reviewed by Andreas Kling.
2552
2553         Added a new version of moveTo for setSelectionRange.
2554
2555         * editing/FrameSelection.cpp:
2556         (WebCore::FrameSelection::moveTo): Added.
2557         * editing/FrameSelection.h:
2558         * html/HTMLTextFormControlElement.cpp:
2559         (WebCore::HTMLTextFormControlElement::setSelectionRange): Use the newly added FrameSelection::moveTo
2560         instead of manually instantiating VisibleSelection here.
2561
2562 2014-02-16  Dan Bernstein  <mitz@apple.com>
2563
2564         Stop using PLATFORM(MAC) in Source except where it means “OS X but not iOS”
2565         https://bugs.webkit.org/show_bug.cgi?id=128885
2566
2567         Reviewed by Anders Carlsson.
2568
2569         * loader/FrameLoaderClient.h: Changed PLATFORM(MAC) to PLATFORM(COCOA).
2570         * platform/Cursor.h: Changed PLATFORM(MAC) to USE(APPKIT) around uses of NSCursor.
2571         * platform/LocalizedStrings.cpp: Changed PLATFORM(MAC) to PLATFORM(COCOA).
2572         * platform/graphics/PlatformLayer.h: Ditto.
2573         * platform/graphics/cg/PDFDocumentImage.cpp: Ditto.
2574         * rendering/RenderLayerCompositor.cpp: Ditto.
2575         (WebCore::RenderLayerCompositor::requiresContentShadowLayer):
2576         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
2577
2578 2014-02-16  Dan Bernstein  <mitz@apple.com>
2579
2580         Speculative iOS build fix after r164184.
2581
2582         * dom/Node.cpp:
2583         (WebCore::Node::defaultEventHandler):
2584
2585 2014-02-15  Ryosuke Niwa  <rniwa@webkit.org>
2586
2587         DOMSelection shouldn't instantiate VisibleSelection everywhere
2588         https://bugs.webkit.org/show_bug.cgi?id=128879
2589
2590         Reviewed by Antti Koivisto.
2591
2592         Removed explicit instantiation of VisibleSelection from various member functions of VisibleSelection.
2593
2594         * page/DOMSelection.cpp:
2595         (WebCore::DOMSelection::collapse):
2596         (WebCore::DOMSelection::collapseToEnd):
2597         (WebCore::DOMSelection::collapseToStart):
2598         (WebCore::DOMSelection::setBaseAndExtent):
2599         (WebCore::DOMSelection::setPosition):
2600         (WebCore::DOMSelection::extend):
2601         (WebCore::DOMSelection::getRangeAt):
2602         (WebCore::DOMSelection::addRange):
2603
2604 2014-02-15  Ryosuke Niwa  <rniwa@webkit.org>
2605
2606         Remove unused arguments from moveTo(Range*)
2607         https://bugs.webkit.org/show_bug.cgi?id=128878
2608
2609         Reviewed by Antti Koivisto.
2610
2611         Cleanup.
2612
2613         * bindings/objc/DOMUIKitExtensions.mm:
2614         (-[DOMRange move:inDirection:]):
2615         (-[DOMRange extend:inDirection:]):
2616         * editing/FrameSelection.cpp:
2617         (WebCore::FrameSelection::moveTo):
2618         * editing/FrameSelection.h:
2619
2620 2014-02-15  Filip Pizlo  <fpizlo@apple.com>
2621
2622         Vector with inline capacity should work with non-PODs
2623         https://bugs.webkit.org/show_bug.cgi?id=128864
2624
2625         Reviewed by Michael Saboff.
2626
2627         No new tests because no change behavior.
2628         
2629         Deques no longer have inline capacity because it was broken, and we didn't need it
2630         here anyway.
2631
2632         * page/WheelEventDeltaTracker.h:
2633
2634 2014-02-15  Andreas Kling  <akling@apple.com>
2635
2636         Add checked casts for Event.
2637         <https://webkit.org/b/128875>
2638
2639         Generate casting helpers for casting from Event to various subclasses
2640         and go on static_cast replacement spree.
2641
2642         Reviewed by Sam Weinig.
2643
2644 2014-02-15  Ryosuke Niwa  <rniwa@webkit.org>
2645
2646         HTMLTextFormControlElement::subtreeHasChanged should be called before updating selection
2647         https://bugs.webkit.org/show_bug.cgi?id=128870
2648
2649         Reviewed by Darin Adler.
2650
2651         Extracted HTMLTextFormControlElement::didEditInnerTextValue out of HTMLTextFormControlElement::defaultEventHandler
2652         and called it in appliedEditing, unappliedEditing, and reappliedEditing before updating selection.
2653
2654         * editing/Editor.cpp:
2655         (WebCore::notifyTextFromControls): Added.
2656         (WebCore::Editor::appliedEditing): Update text form control's internal states before updating selection.
2657         (WebCore::Editor::unappliedEditing): Ditto.
2658         (WebCore::Editor::reappliedEditing): Ditto.
2659         * html/HTMLTextFormControlElement.cpp:
2660         (WebCore::HTMLTextFormControlElement::didEditInnerTextValue):
2661         * html/TextFieldInputType.cpp:
2662         (WebCore::TextFieldInputType::subtreeHasChanged): Removed a stale assertion from the time we used to do
2663         everything in the render tree.
2664
2665 2014-02-15  Andreas Kling  <akling@apple.com>
2666
2667         Add checked casts for ScriptExecutionContext.
2668         <https://webkit.org/b/128874>
2669
2670         Generate casting helpers for casting from ScriptExecutionContext to
2671         Document and WorkerGlobalScope. Apply heartily.
2672
2673         Reviewed by Antti Koivisto.
2674
2675 2014-02-15  Alexey Proskuryakov  <ap@apple.com>
2676
2677         [Mac] All WebKit clients should encrypt WebCrypto keys automatically
2678         https://bugs.webkit.org/show_bug.cgi?id=128852
2679
2680         Reviewed by Oliver Hunt.
2681
2682         Install a persistent master key in Keychain on first use of WebCrypto key serialization.
2683         The key is per application, protected with ACL.
2684
2685         * English.lproj/Localizable.strings:
2686         * WebCore.exp.in:
2687         * crypto/SerializedCryptoKeyWrap.h:
2688         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
2689         (WebCore::masterKeyAccountNameForCurrentApplication):
2690         (WebCore::getDefaultWebCryptoMasterKey):
2691         (WebCore::createAndStoreMasterKey):
2692         (WebCore::findMasterKey):
2693         * platform/LocalizedStrings.cpp:
2694         (WebCore::webCryptoMasterKeyKeychainLabel):
2695         (WebCore::webCryptoMasterKeyKeychainComment):
2696         * platform/LocalizedStrings.h:
2697
2698 2014-02-15  Ryosuke Niwa  <rniwa@webkit.org>
2699
2700         computeSelectionStart and computeSelectionEnd shouldn't trigger synchronous layout
2701         https://bugs.webkit.org/show_bug.cgi?id=128806
2702
2703         Reviewed by Darin Adler.
2704
2705         Added indexForPosition to HTMLTextFormControlElement. Like r163825, this patch traverses the DOM tree
2706         instead of the render tree to compute the index for a given position.
2707
2708         We traverse the DOM Tree backwards starting at the specified Position all the way back to the beginning
2709         of the inner text element. The index is computed as the number of characters we encountered during
2710         this backwards DOM traversal.
2711
2712         It's worth noting that passedPosition.computeNodeBeforePosition() returns and only returns 0 when the
2713         position is before the first node of its parent or inside a text node. In such cases, we call
2714         passedPosition.containerNode() to find the parent or the text node.
2715
2716         * html/HTMLTextFormControlElement.cpp:
2717         (WebCore::HTMLTextFormControlElement::indexForVisiblePosition): Use indexForPosition.
2718         (WebCore::HTMLTextFormControlElement::computeSelectionStart): Ditto.
2719         (WebCore::HTMLTextFormControlElement::computeSelectionEnd): Dotto.
2720         (WebCore::finishText): Cleanup. Use newlineCharacter instead of hard-coding '\n'.
2721         (WebCore::HTMLTextFormControlElement::indexForPosition): Added. See above for the description.
2722         * html/HTMLTextFormControlElement.h:
2723
2724 2014-02-15  Brent Fulgham  <bfulgham@apple.com>
2725
2726         [Win] Avoid unnecessary asserts if "prepareToPlay" is called multiple times.
2727         https://bugs.webkit.org/show_bug.cgi?id=128859
2728
2729         Reviewed by Eric Carlson.
2730
2731         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2732         (WebCore::AVFWrapper::createPlayer): Don't assert if player exists; just return the
2733         existing copy.
2734         (WebCore::AVFWrapper::createPlayerItem): Ditto (but with Player Items).
2735
2736 2014-02-15  Darin Adler  <darin@apple.com>
2737
2738         Remove double hashing from DatasetDOMStringMap::deleteItem
2739         https://bugs.webkit.org/show_bug.cgi?id=128865
2740
2741         Reviewed by Benjamin Poulain.
2742
2743         * dom/DatasetDOMStringMap.cpp:
2744         (WebCore::DatasetDOMStringMap::deleteItem): Removed call to hasAttribute, using the
2745         result from removeAttribute instead.
2746
2747         * dom/Element.cpp:
2748         (WebCore::Element::removeAttribute): Add a return value, false if nothing is removed,
2749         and true if something is removed.
2750         (WebCore::Element::removeAttributeNS): Ditto.
2751         * dom/Element.h: Ditto.
2752
2753 2014-02-15  Piotr Grad  <p.grad@samsung.com>
2754
2755         Setting currentTime on HTMLMediaElement with media controller should throw exception.
2756         https://bugs.webkit.org/show_bug.cgi?id=128867.
2757
2758         Reviewed by Eric Carlson.
2759
2760         Added implementation for setting currentTime in HTMLMediaElement. Old implementation
2761         was left to be used internally.
2762
2763         Test: media/video-controller-currentTime.html
2764
2765         * html/HTMLMediaElement.cpp:
2766         (WebCore::HTMLMediaElement::parseAttribute):
2767         * html/HTMLMediaElement.h:
2768         * html/HTMLMediaElement.idl:
2769
2770 2014-02-15  Anders Carlsson  <andersca@apple.com>
2771
2772         Form controls are always painted in the active state
2773         https://bugs.webkit.org/show_bug.cgi?id=128872
2774         <rdar://problem/9422677>
2775
2776         Reviewed by Dan Bernstein.
2777
2778         AppKit will always paint form controls in the active state if the view doesn't have a
2779         window. Fix this by adding a fake window whose key appearance we'll update based on the 
2780         control state. Also, rename WebCoreFlippedView to WebCoreThemeView since it stopped being
2781         just about the flippedness a long time ago.
2782
2783         * platform/mac/ThemeMac.h:
2784         * platform/mac/ThemeMac.mm:
2785         (-[WebCoreThemeWindow hasKeyAppearance]):
2786         Return themeWindowHasKeyAppearance.
2787
2788         (-[WebCoreThemeView window]):
2789         Create a WebCoreThemeWindow object lazily and return it.
2790
2791         (WebCore::paintCheckbox):
2792         (WebCore::paintRadio):
2793         (WebCore::paintButton):
2794         Pass the control states to ThemeMac::ensuredView.
2795
2796         (WebCore::ThemeMac::ensuredView):
2797         Set themeWindowHasKeyAppearance based on the control state.
2798
2799         * rendering/RenderThemeMac.mm:
2800         (WebCore::RenderThemeMac::documentViewFor):
2801         Pass the control states to ThemeMac::ensuredView.
2802
2803 2014-02-15  Renata Hodovan  <rhodovan.u-szeged@partner.samsung.com>
2804
2805         ASSERT_WITH_SECURITY_IMPLICATION in WebCore::toElement
2806         https://bugs.webkit.org/show_bug.cgi?id=128810
2807
2808         Reviewed by Ryosuke Niwa.
2809
2810         Make CompositeEditCommand::cloneParagraphUnderNewElement() to work when |outerNode|
2811         doesn't contain |start|.
2812
2813         Before this patch, CompositeEditCommand::cloneParagraphUnderNewElement() tried to copy
2814         ancestry nodes from |start| to Document node when |start| position isn't in |outerNode|. This
2815         patch changes CompositeEditCommand::cloneParagraphUnderNewElement() to copy |start| to
2816         |outerNode| only if |outerNode| contains |start| position.
2817
2818         Merged from Blink https://src.chromium.org/viewvc/blink?revision=161762&view=revision by yosin@chromium.org.
2819
2820         Test: editing/execCommand/indent-with-uneditable-crash.html
2821
2822         * editing/CompositeEditCommand.cpp:
2823         (WebCore::CompositeEditCommand::cloneParagraphUnderNewElement):
2824
2825 2014-02-15  Samuel White  <samuel_white@apple.com>
2826
2827         AX: Add ability to specify descendant type when using AXUIElementsForSearchPredicate.
2828         https://bugs.webkit.org/show_bug.cgi?id=128747
2829
2830         Reviewed by Chris Fleizach.
2831
2832         Added support for 'immediate descendant only' to existing predicate based searching. This
2833         addition allows VoiceOver to fetch each child element lazily (rather than all at once via AXChildren).
2834
2835         Test: platform/mac/accessibility/search-predicate-immediate-descendants-only.html
2836
2837         * accessibility/AccessibilityObject.cpp:
2838         (WebCore::AccessibilityObject::findMatchingObjects):
2839         * accessibility/AccessibilityObject.h:
2840         (WebCore::AccessibilitySearchCriteria::AccessibilitySearchCriteria):
2841         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2842         (accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute):
2843
2844 2014-02-15  Jeremy Jones  <jeremyj@apple.com>
2845
2846         WK2 AVKit enter fullscreen doesn't work a second time.
2847         https://bugs.webkit.org/show_bug.cgi?id=128558
2848
2849         Reviewed by Jer Noble.
2850
2851         Lazily create WebAVPlayerController when needed.
2852
2853         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
2854         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2855         (WebVideoFullscreenInterfaceAVKit::WebVideoFullscreenInterfaceAVKit):
2856         (WebVideoFullscreenInterfaceAVKit::getPlayerController):
2857         Add getPlayerController()
2858
2859         (WebVideoFullscreenInterfaceAVKit::setWebVideoFullscreenModel):
2860         (WebVideoFullscreenInterfaceAVKit::setDuration):
2861         (WebVideoFullscreenInterfaceAVKit::setCurrentTime):
2862         (WebVideoFullscreenInterfaceAVKit::setRate):
2863         (WebVideoFullscreenInterfaceAVKit::setVideoDimensions):
2864         (WebVideoFullscreenInterfaceAVKit::setVideoLayer):
2865         (WebVideoFullscreenInterfaceAVKit::enterFullscreenWithCompletionHandler):
2866         use getPlayerController();
2867
2868 2014-02-15  Jer Noble  <jer.noble@apple.com>
2869
2870         [Mac] 10X slower than Chrome when drawing a video into a canvas
2871         https://bugs.webkit.org/show_bug.cgi?id=124599
2872
2873         Reviewed by Darin Adler.
2874
2875         Follow up patch to r159518 to address Darin's post-commit review.
2876
2877         * html/HTMLVideoElement.cpp:
2878         (WebCore::HTMLVideoElement::nativeImageForCurrentTime): Use nullptr.
2879         * platform/graphics/MediaPlayerPrivate.h:
2880         (WebCore::MediaPlayerPrivateInterface::nativeImageForCurrentTime): Ditto.
2881         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2882         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): Ditto.
2883         (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC): Clear the
2884                 AVPlayerItemVideoOutput's delegate callback.
2885         (WebCore::CVPixelBufferGetBytePointerCallback): Use static_cast.
2886         (WebCore::CVPixelBufferReleaseBytePointerCallback): Ditto.
2887         (WebCore::CVPixelBufferReleaseInfoCallback): Ditto.
2888         (-[WebCoreAVFPullDelegate initWithCallback:]): Space changes.
2889         (-[WebCoreAVFPullDelegate setCallback:]): Added.
2890         (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]): Check the value of m_callback.
2891
2892 2014-02-14  Andreas Kling  <akling@apple.com>
2893
2894         CTTE: WorkerGlobalScope is always owned by a WorkerThread.
2895         <https://webkit.org/b/128834>
2896
2897         Codify this by storing the owner thread as a WorkerThread& and making
2898         thread() return a reference.
2899
2900         This exposed a couple of unnecessary assertions.
2901
2902         Reviewed by Anders Carlsson.
2903
2904         * Modules/notifications/WorkerGlobalScopeNotifications.cpp:
2905         (WebCore::WorkerGlobalScopeNotifications::webkitNotifications):
2906         * Modules/websockets/ThreadableWebSocketChannel.cpp:
2907         (WebCore::ThreadableWebSocketChannel::create):
2908         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
2909         (WebCore::WorkerThreadableWebSocketChannel::Bridge::Bridge):
2910         (WebCore::WorkerThreadableWebSocketChannel::Bridge::waitForMethodCompletion):
2911         * bindings/js/ScheduledAction.cpp:
2912         (WebCore::ScheduledAction::execute):
2913         * bindings/js/WorkerScriptDebugServer.cpp:
2914         (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
2915         * dom/ScriptExecutionContext.cpp:
2916         (WebCore::ScriptExecutionContext::createdMessagePort):
2917         (WebCore::ScriptExecutionContext::destroyedMessagePort):
2918         * inspector/WorkerDebuggerAgent.cpp:
2919         (WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
2920         (WebCore::WorkerDebuggerAgent::~WorkerDebuggerAgent):
2921         * inspector/WorkerInspectorController.cpp:
2922         * inspector/WorkerRuntimeAgent.cpp:
2923         (WebCore::WorkerRuntimeAgent::pauseWorkerGlobalScope):
2924         * loader/WorkerThreadableLoader.cpp:
2925         (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
2926         (WebCore::WorkerThreadableLoader::loadResourceSynchronously):
2927         * loader/cache/MemoryCache.cpp:
2928         (WebCore::MemoryCache::removeRequestFromCache):
2929         * workers/DedicatedWorkerGlobalScope.cpp:
2930         (WebCore::DedicatedWorkerGlobalScope::create):
2931         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
2932         (WebCore::DedicatedWorkerGlobalScope::postMessage):
2933         (WebCore::DedicatedWorkerGlobalScope::importScripts):
2934         (WebCore::DedicatedWorkerGlobalScope::thread):
2935         * workers/DedicatedWorkerGlobalScope.h:
2936         * workers/DedicatedWorkerThread.cpp:
2937         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
2938         * workers/SharedWorkerGlobalScope.cpp:
2939         (WebCore::SharedWorkerGlobalScope::create):
2940         (WebCore::SharedWorkerGlobalScope::SharedWorkerGlobalScope):
2941         (WebCore::SharedWorkerGlobalScope::thread):
2942         * workers/SharedWorkerGlobalScope.h:
2943         * workers/SharedWorkerThread.cpp:
2944         (WebCore::SharedWorkerThread::createWorkerGlobalScope):
2945         * workers/WorkerGlobalScope.cpp:
2946         (WebCore::CloseWorkerGlobalScopeTask::performTask):
2947         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
2948         (WebCore::WorkerGlobalScope::~WorkerGlobalScope):
2949         (WebCore::WorkerGlobalScope::postTask):
2950         (WebCore::WorkerGlobalScope::logExceptionToConsole):
2951         (WebCore::WorkerGlobalScope::addConsoleMessage):
2952         (WebCore::WorkerGlobalScope::addMessage):
2953         (WebCore::WorkerGlobalScope::isContextThread):
2954         * workers/WorkerGlobalScope.h:
2955         (WebCore::WorkerGlobalScope::thread):
2956         * workers/WorkerMessagingProxy.cpp:
2957         (WebCore::MessageWorkerGlobalScopeTask::performTask):
2958         (WebCore::WorkerMessagingProxy::WorkerMessagingProxy):
2959         (WebCore::WorkerMessagingProxy::~WorkerMessagingProxy):
2960         * workers/WorkerRunLoop.cpp:
2961         (WebCore::WorkerRunLoop::runInMode):
2962         (WebCore::WorkerRunLoop::runCleanupTasks):
2963
2964 2014-02-14  Ryosuke Niwa  <rniwa@webkit.org>
2965
2966         setSelectionRange shouldn't trigger a synchronous layout to check focusability when text field is already focused
2967         https://bugs.webkit.org/show_bug.cgi?id=128804
2968
2969         Reviewed by Enrica Casucci.
2970
2971         Don't trigger a synchronous layout at the beginning of setSelectionRange if the element is already focused
2972         since we don't have to check the size of render box in that case.
2973
2974         We should be able to get rid of this synchronous layout entirely once we fix https://webkit.org/b/128797
2975         but that's somewhat risky behavioral change so we'll do that in a separate patch.
2976
2977         * editing/FrameSelection.cpp:
2978         (WebCore::FrameSelection::selectAll): Fixed the bug where selectAll selects the entire document even if the text
2979         form contol is focused if the selection is none (i.e. not anchored to any node).
2980         * html/HTMLTextFormControlElement.cpp:
2981         (WebCore::HTMLTextFormControlElement::setSelectionRange): Only update the layout if the element is not focused
2982         already. Also pass in DoNotSetFocus option to setSelection since we already have the focus in that case.
2983
2984 2014-02-14  Dan Bernstein  <mitz@apple.com>
2985
2986         REGRESSION (r157443): Search fields with a non-white background don’t have a round bezel
2987         https://bugs.webkit.org/show_bug.cgi?id=126295
2988
2989         Reviewed by Ryosuke Niwa.
2990
2991         Reverted r157443 and improved comment.
2992
2993         * rendering/RenderTheme.cpp:
2994         (WebCore::RenderTheme::isControlStyled):
2995
2996 2014-02-14  Brian Burg  <bburg@apple.com>
2997
2998         Web Replay: AtomicString replay input names should be stored in a thread-local table
2999         https://bugs.webkit.org/show_bug.cgi?id=128829
3000
3001         Reviewed by Andreas Kling.
3002
3003         Similar to how DOM event names are frequently-used AtomicStrings, replay input
3004         names are also checked in many places as a "type tag". This patch puts all known
3005         input names into a class held by ThreadGlobalData and adds the shortcut `inputTypes()`
3006         so that replay input types can be referenced with `inputTypes.InputName()`.
3007
3008         * WebCore.xcodeproj/project.pbxproj:
3009         * platform/ThreadGlobalData.cpp: Add inputTypes() shortcut.
3010         (WebCore::ThreadGlobalData::ThreadGlobalData):
3011         * platform/ThreadGlobalData.h: Add inputTypes() shortcut.
3012         (WebCore::ThreadGlobalData::inputTypes):
3013         * replay/ReplayInputTypes.cpp: Added.
3014         (WebCore::ReplayInputTypes::ReplayInputTypes):
3015         * replay/ReplayInputTypes.h: Added.
3016         (WebCore::inputTypes): The input names are provided by per-framework macros that
3017         are generated by the replay inputs code generator.
3018
3019 2014-02-14  Jer Noble  <jer.noble@apple.com>
3020
3021         Add support for specced event handlers to HTMLMediaElement
3022         https://bugs.webkit.org/show_bug.cgi?id=128292
3023
3024         Reviewed by Andreas Kling.
3025
3026         Test: media/media-event-listeners.html
3027
3028         Add explicit event listener IDL attributes to HTMLMediaElement.
3029
3030         * html/HTMLMediaElement.h:
3031         * html/HTMLMediaElement.idl:
3032
3033 2014-02-14  Oliver Hunt  <oliver@apple.com>
3034
3035         Implement a few more Array prototype functions in JS
3036         https://bugs.webkit.org/show_bug.cgi?id=128788
3037
3038         Reviewed by Gavin Barraclough.
3039
3040         Minor change to ensure that the inspector is treating builtins
3041         as host functions.
3042
3043         Tests: js/regress/array-prototype-filter.html
3044                js/regress/array-prototype-forEach.html
3045                js/regress/array-prototype-map.html
3046                js/regress/array-prototype-some.html
3047
3048         * inspector/InspectorDOMAgent.cpp:
3049         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
3050           Make sure we treat builtins as regular host functions
3051
3052 2014-02-14  Beth Dakin  <bdakin@apple.com>
3053
3054         Margin tiles are not created for the top and left sides when there is a < 1.0 
3055         scale factor
3056         https://bugs.webkit.org/show_bug.cgi?id=128842
3057
3058         Reviewed by Simon Fraser.
3059
3060         floor the result of the computation whenever we have a negative origin, to ensure 
3061         that we are rounding 'up' to a larger number of tiles. 
3062         * platform/graphics/ca/mac/TileController.mm:
3063         (WebCore::TileController::getTileIndexRangeForRect):
3064
3065 2014-02-13  Ryosuke Niwa  <rniwa@webkit.org>
3066
3067         setSelection should not synchronously trigger layout
3068         https://bugs.webkit.org/show_bug.cgi?id=128797
3069
3070         Reviewed by Antti Koivisto.
3071
3072         Only update the appearance and reveal selection when the style and the layout is already up to date.
3073         Otherwise, do so in performPostLayoutTasks.
3074
3075         * editing/FrameSelection.cpp:
3076         (WebCore::FrameSelection::FrameSelection):
3077         (WebCore::FrameSelection::setSelection): Set m_pendingSelectionUpdate and synchronously update caret rect
3078         if we don't need to update style or layout.
3079         (WebCore::updateSelectionByUpdatingLayoutOrStyle): Added. Used by FrameSelection member functions to
3080         trigger layout or style recalc whichever is needed.
3081         (WebCore::FrameSelection::updateAndRevealSelection): Extracted from setSelection.
3082         (WebCore::FrameSelection::absoluteCaretBounds): Call updateSelectionByUpdatingLayoutOrStyle since caret rect
3083         is no longer updated synchronously in setSelection.
3084         (WebCore::FrameSelection::recomputeCaretRect): Don't assert that visibleStart().absoluteCaretBounds() is
3085         equal to m_absCaretBounds since selection may no longer be caret at this point.
3086         (WebCore::FrameSelection::setCaretVisibility): Call updateSelectionByUpdatingLayoutOrStyle since we're
3087         synchronously calling into updateAppearance here. In the future, we should make this asynchronous as well.
3088         (WebCore::FrameSelection::selectionBounds): Call updateSelectionByUpdatingLayoutOrStyle since selection bounds
3089         could be outdated. This code only triggering style recalc was presumably a bug.
3090         * editing/FrameSelection.h:
3091
3092         * page/FrameView.cpp:
3093         (WebCore::FrameView::performPostLayoutTasks): Update selection's appearance and scroll to reveal selection
3094         as needed.
3095
3096 2014-02-14  Andreas Kling  <akling@apple.com>
3097
3098         Purge remaining ENABLE(SHADOW_DOM) cruft.
3099         <https://webkit.org/b/128827>
3100
3101         Remove the remaining 8.8 million lines of Shadow DOM code to align
3102         with goals for intent to ship 60fps on mobile in 2014.
3103
3104         Reviewed by Antti Koivisto.
3105
3106 2014-02-13  Jer Noble  <jer.noble@apple.com>
3107
3108         [MediaControls][iOS] Embedded YouTube does not show a 'paused' button state after starting
3109         https://bugs.webkit.org/show_bug.cgi?id=128755
3110
3111         Reviewed by Eric Carlson.
3112
3113         Don't rely on "canPlay()", instead, take the information directly from the event itself. I.e., when
3114         handling the 'play' event, switch mode to playing, and vice versa for the 'pause' event.
3115
3116         * Modules/mediacontrols/mediaControlsApple.js:
3117         (Controller.prototype.handlePlay):
3118         (Controller.prototype.handlePause):
3119         (Controller.prototype.updatePlaying):
3120         (Controller.prototype.setPlaying):
3121
3122 2014-02-13  Jer Noble  <jer.noble@apple.com>
3123
3124         [MediaControls][iOS] Start playback button is visible when playing embedded YouTube
3125         https://bugs.webkit.org/show_bug.cgi?id=128754
3126
3127         Reviewed by Eric Carlson.
3128
3129         Update shouldHaveStartPlaybackButton to match the behavior of the plugin proxy.
3130
3131         Add a accessor to determine whether playback has been requested:
3132         * Modules/mediacontrols/MediaControlsHost.cpp:
3133         (WebCore::MediaControlsHost::userGestureRequired):
3134         * Modules/mediacontrols/MediaControlsHost.h:
3135         * Modules/mediacontrols/MediaControlsHost.idl:
3136
3137         Update the logic of shouldHaveStartPlaybackButton.
3138         * Modules/mediacontrols/mediaControlsiOS.js:
3139         (ControllerIOS.prototype.shouldHaveStartPlaybackButton):
3140
3141 2014-02-13  Jer Noble  <jer.noble@apple.com>
3142
3143         [MediaControls] Add support for a loading progress meter
3144         https://bugs.webkit.org/show_bug.cgi?id=128651
3145
3146         Reviewed by Eric Carlson.
3147
3148         Draw the loaded ranges underneath the timeline slider. Use a -webkit-canvas()
3149         CSS function to allow the track of the slider to reflect the current state of
3150         the video's loadedTimeRanges property.
3151
3152         Since -webkit-canvas() will share a backing store with all other CSS images using
3153         the same identifier, use a monotonically increasing identifier to uniquely identify the timeline on a per-document basis.
3154
3155         * Modules/mediacontrols/mediaControlsApple.css:
3156         (audio::-webkit-media-controls-timeline):
3157         * Modules/mediacontrols/mediaControlsApple.js:
3158         (Controller): Call updateProgress().
3159         (Controller.prototype.createControls): Set up the canvas style and identifier.
3160         (Controller.prototype.handleLoadStart): Call updateProgress().
3161         (Controller.prototype.handleStalled): Ditto.
3162         (Controller.prototype.handleReadyStateChange): Ditto.
3163         (Controller.prototype.handleDurationChange): Ditto.
3164         (Controller.prototype.handleProgress): Ditto.
3165         (Controller.prototype.progressFillStyle): Added an easily overridable method
3166             to determine the fill color of the progress bar.
3167         (Controller.prototype.updateProgress): Draw the loadedTimeRanges into the timeline slider.
3168         * Modules/mediacontrols/mediaControlsiOS.js:
3169         (ControllerIOS.prototype.progressFillStyle): Override.
3170
3171 2014-02-14  Benjamin Poulain  <benjamin@webkit.org>
3172
3173         Clean up JSDOMStringMap::deleteProperty
3174         https://bugs.webkit.org/show_bug.cgi?id=128801
3175
3176         Reviewed by Geoffrey Garen.
3177
3178         Follow up on my cleaning of JSDOMStringMapCustom, this time for deletion.
3179
3180         Previously, we would query for the name, then call deleteItem() if the name was
3181         found. Instead, everything is moved to deleteItem which then return if the deletion
3182         is successful or not.
3183
3184         By using convertPropertyNameToAttributeName, we can use Element::hasAttribute() directly
3185         to find if the attribute exists or not. If it exists, we remove it.
3186
3187         Theoretically we could have a single pass over the attributes to find->delete but this
3188         code is not hot enough to justify anything fancy at this point.
3189
3190         Finally, we no longer check for isValidPropertyName() on deletion. JSDOMStringMapCustom
3191         was the last client of DatasetDOMStringMap::deleteItem() and it could not call deleteItem()
3192         with invalid name since the name would have failed DatasetDOMStringMap::contains().
3193         The spec does not specify any name checking either for deletion so we are safe just ignoring
3194         invalid input.
3195
3196         * bindings/js/JSDOMStringMapCustom.cpp:
3197         (WebCore::JSDOMStringMap::deleteProperty):
3198         * dom/DatasetDOMStringMap.cpp:
3199         (WebCore::DatasetDOMStringMap::deleteItem):
3200         * dom/DatasetDOMStringMap.h:
3201
3202 2014-02-14  Benjamin Poulain  <bpoulain@apple.com>
3203
3204         Improve the performance on mobile of FTPDirectoryDocument
3205         https://bugs.webkit.org/show_bug.cgi?id=128778
3206
3207         Reviewed by Antti Koivisto.
3208
3209         Little cleanup.
3210
3211         * html/FTPDirectoryDocument.cpp:
3212         (WebCore::FTPDirectoryDocumentParser::appendEntry):
3213         (WebCore::FTPDirectoryDocumentParser::createTDForFilename):
3214         (WebCore::processFilesizeString):
3215         (WebCore::wasLastDayOfMonth):
3216         (WebCore::processFileDateString):
3217         (WebCore::FTPDirectoryDocumentParser::parseAndAppendOneLine):
3218         (WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate):
3219         (WebCore::FTPDirectoryDocumentParser::createBasicDocument):
3220
3221 2014-02-14  Benjamin Poulain  <benjamin@webkit.org>
3222
3223         Do not attempt to synchronize attributes when no Simple Selector could match an animatable attribute
3224         https://bugs.webkit.org/show_bug.cgi?id=128728
3225
3226         Reviewed by Andreas Kling.
3227
3228         In most cases, we don't even need to test for the flag animatedSVGAttributesNotDirty.
3229         If the selector filter could never match an animatable attribute, there is no point in testing for one.
3230
3231         * cssjit/SelectorCompiler.cpp:
3232         (WebCore::SelectorCompiler::canMatchStyleAttribute):
3233         Skip the second test when the local name is equal to canonicalLocalName. That is the common case.
3234
3235         (WebCore::SelectorCompiler::canMatchAnimatableSVGAttribute):
3236         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributesMatching):
3237
3238         * svg/SVGElement.cpp:
3239         (WebCore::addQualifiedName):
3240         (WebCore::SVGElement::animatableAttributeForName):
3241         (WebCore::SVGElement::isAnimatableAttribute):
3242         (WebCore::SVGElement::filterOutAnimatableAttribute):
3243         * svg/SVGElement.h:
3244         * svg/SVGScriptElement.cpp:
3245         (WebCore::SVGScriptElement::filterOutAnimatableAttribute):
3246         * svg/SVGScriptElement.h:
3247         Move the list of animatable attribute to a static function available in Release.
3248         Selector matching is a lot more flexible than normal name matching. Since the local name must
3249         always match, it is used as a key to get the full QualifiedName to compare to the selector.
3250
3251         Separating the list of animatable attributes between Selectors and SVGElement::isAnimatableAttribute
3252         would be error prone. Instead, SVGElement::isAnimatableAttribute() is modified to use
3253         SVGElement::animatableAttributeForName so that the two never get out of sync.
3254
3255         Since SVGScriptElement has one additional restriction to isAnimatableAttribute(), the function
3256         filterOutAnimatableAttribute() is added to remove a qualified name from the complete list of animatable attributes.
3257         This ensure SVGElement::animatableAttributeForName() always has the complete list, and subclasses of SVGElement
3258         can only remove QualifiedNames, not add them.
3259
3260 2014-02-14  Benjamin Poulain  <benjamin@webkit.org>
3261
3262         Make code generation of the unoptimized pseudo classes separate
3263         https://bugs.webkit.org/show_bug.cgi?id=128704
3264
3265         Reviewed by Andreas Kling.
3266
3267         Mapping the unoptimized selectors when generating the code was useful for debugging
3268         but those cases are so common that looping over unoptimizedPseudoCheckers was more
3269         costly than anticipated.
3270
3271         This patch moves the unoptimized pseudo selector in their own array to simplify code generation.
3272
3273         * cssjit/SelectorCompiler.cpp:
3274         (WebCore::SelectorCompiler::addPseudoType):
3275         (WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
3276         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
3277
3278 2014-02-14  Myles C. Maxfield  <mmaxfield@apple.com>
3279
3280         Implement text-decoration-skip: auto
3281         https://bugs.webkit.org/show_bug.cgi?id=128786
3282
3283         Reviewed by Dean Jackson.
3284
3285         http://lists.w3.org/Archives/Public/www-style/2014Feb/0485.html
3286         We are updating the initial value of text-decoration-skip to a new value, "auto".
3287         On Mac + iOS, this will have the same behavior as "skip".
3288
3289         Test: fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-default.html
3290
3291         * css/CSSComputedStyleDeclaration.cpp:
3292         (WebCore::renderTextDecorationSkipFlagsToCSSValue):
3293         * css/CSSParser.cpp:
3294         (WebCore::CSSParser::parseTextDecorationSkip):
3295         * css/DeprecatedStyleBuilder.cpp:
3296         (WebCore::valueToDecorationSkip):
3297         * rendering/InlineTextBox.cpp:
3298         (WebCore::InlineTextBox::paintDecoration):
3299         * rendering/style/RenderStyle.h:
3300         * rendering/style/RenderStyleConstants.h:
3301
3302 2014-02-13  Simon Fraser  <simon.fraser@apple.com>
3303
3304         Give ScrollingTree(State)Nodes a reference to another layer, which is used for moving overflow:scroll contents around
3305         https://bugs.webkit.org/show_bug.cgi?id=128790
3306
3307         Reviewed by Beth Dakin.
3308
3309         Have scrolling tree nodes and state nodes track another layer, the
3310         "scrolled contents layer", for accelerated overflow:scroll.
3311         
3312         When making ScrollingTreeScrollingNodes for overflow:scroll, the node's
3313         layer will point to the composited element's primary layer, and its
3314         scrolledContentsLayer to the layer that gets moved around by scrolling.
3315         
3316         Do some other cleanup on AsyncScrollingCoordinator, removing
3317         functions that just called through to nodes.
3318
3319         * WebCore.exp.in:
3320         * page/scrolling/AsyncScrollingCoordinator.cpp:
3321         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
3322         (WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged):
3323         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
3324         (WebCore::AsyncScrollingCoordinator::updateScrollingNode):
3325         (WebCore::AsyncScrollingCoordinator::updateViewportConstrainedNode):
3326         (WebCore::AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView):
3327         * page/scrolling/AsyncScrollingCoordinator.h:
3328         * page/scrolling/ScrollingCoordinator.h:
3329         (WebCore::ScrollingCoordinator::updateScrollingNode):
3330         * page/scrolling/ScrollingStateScrollingNode.cpp:
3331         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
3332         (WebCore::ScrollingStateScrollingNode::setScrolledContentsLayer):
3333         (WebCore::ScrollingStateScrollingNode::setCounterScrollingLayer):
3334         (WebCore::ScrollingStateScrollingNode::setHeaderLayer):
3335         (WebCore::ScrollingStateScrollingNode::setFooterLayer):