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