[CSS Grid Layout] Add parsing for named grid lines
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2013-08-28  Sergio Villar Senin  <svillar@igalia.com>
2
3         [CSS Grid Layout] Add parsing for named grid lines
4         https://bugs.webkit.org/show_bug.cgi?id=119540
5
6         Reviewed by Andreas Kling.
7
8         From Blink r150381,r150587 by <jchaffraix@chromium.org>
9
10         Adds parsing support for named grid lines at <grid-line> level,
11         i.e., inside grid-{row|column}-{start|end}. This change covers
12         only the parsing, layout changes coming in a follow up patch.
13
14         * css/CSSComputedStyleDeclaration.cpp:
15         (WebCore::valueForGridPosition):
16         * css/CSSParser.cpp:
17         (WebCore::CSSParser::parseIntegerOrStringFromGridPosition):
18         (WebCore::CSSParser::parseGridPosition):
19         * css/CSSParser.h:
20         * css/StyleResolver.cpp:
21         (WebCore::createGridPosition):
22         * rendering/RenderGrid.cpp:
23         (WebCore::RenderGrid::resolveGridPositionFromStyle):
24         * rendering/style/GridPosition.h:
25         (WebCore::GridPosition::setExplicitPosition):
26         (WebCore::GridPosition::setSpanPosition):
27         (WebCore::GridPosition::integerPosition):
28         (WebCore::GridPosition::namedGridLine):
29
30 2013-09-03  Alexey Proskuryakov  <ap@apple.com>
31
32         [Mac] Hyphenation respects regional format settings language instead of primary language
33         https://bugs.webkit.org/show_bug.cgi?id=120641
34
35         Reviewed by Dan Bernstein.
36
37         Fixes hyphenation tests on my machine with non-English regional format settings.
38
39         * platform/text/cf/HyphenationCF.cpp: (createValueForNullKey):
40         Use primary UI language for hyphenation, not regional settings language.
41
42 2013-09-03  Danilo Cesar Lemes de Paula  <danilo.cesar@collabora.co.uk>
43
44         [GTK][EFL] include missing localized strings for subtitle auto track
45         https://bugs.webkit.org/show_bug.cgi?id=120629
46
47         those methods are necessary to show the "Auto" track on webkitgtk
48
49         Reviewed by Gustavo Noronha Silva.
50
51         * platform/efl/LocalizedStringsEfl.cpp:
52         (WebCore::textTrackAutomaticMenuItemText):
53         * platform/gtk/LocalizedStringsGtk.cpp:
54         (WebCore::textTrackAutomaticMenuItemText):
55
56 2013-09-03  Daniel Bates  <dabates@apple.com>
57
58         Require layout when -webkit-overflow-scrolling changes
59         https://bugs.webkit.org/show_bug.cgi?id=120535
60
61         Reviewed by Darin Adler.
62
63         Test: fast/repaint/overflow-scroll-touch-repaint.html
64
65         We want to require a layout when the value of -webkit-overflow-scrolling changes
66         since -webkit-overflow-scrolling creates a stacking context.
67
68         * rendering/style/RenderStyle.cpp:
69         (WebCore::RenderStyle::changeRequiresLayout):
70
71 2013-09-02  Ryosuke Niwa  <rniwa@webkit.org>
72
73         Support the "json" responseType and JSON response entity in XHR
74         https://bugs.webkit.org/show_bug.cgi?id=73648
75
76         Reviewed by Oliver Hunt.
77
78         Based on the patch written by Jarred Nicholls.
79
80         Implement 'json' type for XMLHttpRequest.response. We cache the result on JSC side as a cached attribute
81         unlike other response types like 'document' and 'blob' for which the parsed response object is cached
82         in XMLHttpRequest itself. In the long run, we should do the same for other types of response types.
83
84         Also refactored the various code to share the code.
85
86         Tests: fast/xmlhttprequest/xmlhttprequest-responsetype-json-invalid.html
87                fast/xmlhttprequest/xmlhttprequest-responsetype-json-utf16.html
88                fast/xmlhttprequest/xmlhttprequest-responsetype-json-valid.html
89
90         * ForwardingHeaders/runtime/JSONObject.h: Added.
91
92         * bindings/js/JSXMLHttpRequestCustom.cpp:
93         (WebCore::JSXMLHttpRequest::visitChildren):
94         (WebCore::JSXMLHttpRequest::response): Use JSONParse to parse the response text and cache the result.
95         Call didCacheResponseJSON to set the cache status and clear the original response buffer.
96
97         * xml/XMLHttpRequest.cpp:
98         (WebCore::XMLHttpRequest::XMLHttpRequest): Added m_responseCacheIsValid to invalidate the cache of
99         a json response.
100         (WebCore::XMLHttpRequest::responseText):
101         (WebCore::XMLHttpRequest::didCacheResponseJSON): Added; Updates m_responseCacheIsValid and clears the
102         response buffer to save memory.
103         (WebCore::XMLHttpRequest::responseXML):
104         (WebCore::XMLHttpRequest::setResponseType):
105         (WebCore::XMLHttpRequest::responseType):
106         (WebCore::XMLHttpRequest::clearResponseBuffers):
107         (WebCore::XMLHttpRequest::didReceiveData):
108
109         * xml/XMLHttpRequest.h:
110         (WebCore::XMLHttpRequest::doneWithoutErrors): Extracted from responseXML.
111         (WebCore::XMLHttpRequest::responseTextIgnoringResponseType): Extracted from responseText.
112         (WebCore::XMLHttpRequest::responseCacheIsValid): Added.
113         (WebCore::XMLHttpRequest::shouldDecodeResponse): Extracted from didReceiveData.
114         Also modified to decode when the response type is ResponseTypeJSON.
115
116         * xml/XMLHttpRequest.idl: Added CachedAttribute IDL extention on response property. This cache is
117         used when the response type is 'json'.
118
119 2013-09-03  Commit Queue  <commit-queue@webkit.org>
120
121         Unreviewed, rolling out r154881.
122         http://trac.webkit.org/changeset/154881
123         https://bugs.webkit.org/show_bug.cgi?id=120643
124
125         Crashes on macworld.com (Requested by kling on #webkit).
126
127         * dom/Element.cpp:
128         (WebCore::Element::setAttributeInternal):
129
130 2013-09-03  Andre Moreira Magalhaes   <andre.magalhaes@collabora.co.uk>
131
132         [GStreamer] Don't set state to NULL until element is destroyed
133         https://bugs.webkit.org/show_bug.cgi?id=117354
134
135         Reviewed by Philippe Normand.
136
137         Don't set playbin to NULL until it is going to be destroyed or if we stay
138         for too long on the READY state. Instead only set the state to READY as this
139         allows much faster state changes to PAUSED/PLAYING again. playbin internally
140         caches some state that is destroyed when setting it to NULL.
141         This state is independent of the URI and it is even possible to change the
142         URI in READY state.
143
144         To avoid having resources (e.g. audio devices) open indefinitely,
145         when setting the state to READY we create a timeout and if the timeout
146         is reached we reset the pipeline state to NULL to free resources.
147
148         Also now all state changes use the changePipelineState method instead of setting
149         the playbin state directly with gst_element_set_state, so we have a better control
150         of when we are requesting state changes.
151
152         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
153         (WebCore::mediaPlayerPrivateReadyStateTimeoutCallback):
154         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
155         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
156         (WebCore::MediaPlayerPrivateGStreamer::commitLoad):
157         (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
158         (WebCore::MediaPlayerPrivateGStreamer::setRate):
159         (WebCore::MediaPlayerPrivateGStreamer::handlePluginInstallerResult):
160         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
161
162 2013-09-03  peavo@outlook.com  <peavo@outlook.com>
163
164         [WinCairo] Unneeded code in method GlyphPage::fill().
165         https://bugs.webkit.org/show_bug.cgi?id=120634
166
167         Reviewed by Andreas Kling.
168
169         * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
170         (WebCore::GlyphPage::fill): Remove unneeded call to GetTextMetrics() function.
171
172 2013-09-03  Mihnea Ovidenie  <mihnea@adobe.com>
173
174         [CSSRegions] Pseudo-elements as regions should not be exposed to JS
175         https://bugs.webkit.org/show_bug.cgi?id=120633
176
177         Reviewed by Andreas Kling.
178
179         Until we properly implement the Region interface (http://dev.w3.org/csswg/css-regions/#the-region-interface)
180         for pseudo-elements, we should not return these as regions in JS.
181
182         Tests: fast/regions/get-regions-by-content-pseudo.html
183                fast/regions/webkit-named-flow-get-regions-pseudo.html
184
185         * dom/WebKitNamedFlow.cpp:
186         (WebCore::WebKitNamedFlow::firstEmptyRegionIndex): Skip pseudo-elements as regions here too,
187         otherwise we may get an index that cannot be used with getRegions().
188         (WebCore::WebKitNamedFlow::getRegionsByContent):
189         (WebCore::WebKitNamedFlow::getRegions):
190
191 2013-09-03  Zan Dobersek  <zdobersek@igalia.com>
192
193         REGRESSION(r154967): http appcache tests crashing on WK1
194         https://bugs.webkit.org/show_bug.cgi?id=120620
195
196         Reviewed by Andreas Kling.
197
198         * loader/appcache/ApplicationCacheGroup.cpp:
199         (WebCore::ApplicationCacheGroup::cacheDestroyed): Reintroduce pre-r154967 behavior that returned early in
200         this method if the passed-in ApplicationCache object was not found in the ApplicationCacheGroup's HashSet
201         of all the caches. This is now done by checking that the HashSet<T>::remove(T) returns true (meaning the
202         object was found in the HashSet and removed from it) in addition to that HashSet being subsequently empty
203         before the method moves on to destroying its ApplicationCacheGroup instance.
204
205 2013-09-03  Andre Moreira Magalhaes   <andre.magalhaes@collabora.co.uk>
206
207         [gstreamer] Disable HTTP request "Accept-Encoding:" header field on gstreamer source element to avoid receiving the wrong size when retrieving data
208         https://bugs.webkit.org/show_bug.cgi?id=115354
209
210         Reviewed by Philippe Normand.
211
212         Also disable Accept-Encoding on ResourceRequest::toSoupMessage accordingly.
213
214         * platform/network/soup/ResourceRequestSoup.cpp:
215         (WebCore::ResourceRequest::toSoupMessage):
216         Call ResourceRequest::updateSoupMessage from ResourceRequest::toSoupMessage so that the
217         Accept-Encoding header is also respected.
218
219 2013-09-03  Krzysztof Czech  <k.czech@samsung.com>
220
221         [AX][ATK] Added support for sort and help attributes.
222         https://bugs.webkit.org/show_bug.cgi?id=120456
223
224         Reviewed by Chris Fleizach.
225
226         Added support for aria-sort and aria-help attributes.
227
228         Test: accessibility/aria-sort.html
229
230         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
231         (webkitAccessibleGetAttributes):
232
233 2013-09-03  Allan Sandfeld Jensen  <allan.jensen@digia.com>
234
235         [Qt] Remove dead code for QtXmlPatterns
236         https://bugs.webkit.org/show_bug.cgi?id=120624
237
238         Reviewed by Simon Hausmann.
239
240         Remove code supporting XSLT using QtXmlPatterns which has been
241         dead for some time.
242
243         * Target.pri:
244         * WebCore.pri:
245         * dom/TransformSourceQt.cpp: Removed.
246         * xml/XSLStyleSheetQt.cpp: Removed.
247         * xml/XSLTProcessorQt.cpp: Removed.
248         * xml/parser/XMLDocumentParserQt.cpp:
249         (WebCore::XMLDocumentParser::doEnd):
250         (WebCore::XMLDocumentParser::parseProcessingInstruction):
251
252 2013-09-03  Mihnea Ovidenie  <mihnea@adobe.com>
253
254         [CSS Regions] position: fixed is computed relative to the first region, not the viewport
255         https://bugs.webkit.org/show_bug.cgi?id=111176
256
257         Reviewed by David Hyatt.
258
259         Fixed positioned elements inside a named flow should be positioned and sized relative to the viewport,
260         not on the first region, as described in the spec: http://dev.w3.org/csswg/css-regions/#the-flow-into-property.
261         While the flow thread will still act as containing block for the fixed positioned elements, the painting and hit
262         testing for the fixed positioned elements is done by RenderView. The layers for the fixed positioned elements
263         are collected by the flow thread.
264  
265         Tests: fast/regions/element-in-named-flow-absolute-from-fixed.html
266                fast/regions/element-in-named-flow-fixed-from-absolute.html
267                fast/regions/element-inflow-fixed-from-outflow-static.html
268                fast/regions/element-outflow-static-from-inflow-fixed.html
269                fast/regions/fixed-element-transformed-parent.html
270                fast/regions/fixed-in-named-flow-scroll.html
271                fast/regions/fixed-inside-fixed-in-named-flow.html
272                fast/regions/fixed-inside-named-flow-zIndex.html
273                fast/regions/fixed-pos-elem-in-namedflow-noregions.html
274                fast/regions/fixed-pos-region-in-nested-flow.html
275
276         * rendering/FlowThreadController.cpp:
277         (WebCore::FlowThreadController::collectFixedPositionedLayers):
278         Return the list of layers for the fixed positioned elements with named flows as containing blocks.
279         Used in RenderLayer:: paintFixedLayersInNamedFlows and RenderLayer:: hitTestFixedLayersInNamedFlows.
280         * rendering/FlowThreadController.h:
281         * rendering/RenderBox.cpp:
282         (WebCore::RenderBox::mapLocalToContainer):
283         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
284         (WebCore::RenderBox::containingBlockLogicalHeightForPositioned):
285         For fixed positioned elements, width and height are given by the view instead of the first region.
286         * rendering/RenderLayer.cpp:
287         (WebCore::accumulateOffsetTowardsAncestor):
288         Modified for the fixed positioned elements inside named flows with the named flows as containing block
289         to take into account the view scroll.
290         (WebCore::compareZIndex):
291         Moved upwards because it is used in RenderLayer::paintFixedLayersInNamedFlows.
292         (WebCore::RenderLayer::paintFixedLayersInNamedFlows):
293         Paint the list of fixed layers directly from the RenderView instead of painting them through regions -> named flows.
294         (WebCore::RenderLayer::paintLayerContents):
295         (WebCore::RenderLayer::paintList):
296         (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
297         Hit test the layers for the fix positioned elements inside named flows from the RenderView layer
298         instead of the region -> named flow layer.
299         (WebCore::RenderLayer::hitTestLayer):
300         (WebCore::RenderLayer::calculateRects):
301         * rendering/RenderLayer.h:
302         * rendering/RenderLayerCompositor.cpp:
303         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
304         We do not support yet the accelerated compositing for elements in named flows,
305         so bail out early here. We need to revisit fixed elements once we finish accelerated compositing for elements in named flows.
306         * rendering/RenderObject.cpp:
307         (WebCore::RenderObject::fixedPositionedWithNamedFlowContainingBlock):
308         (WebCore::hasFixedPosInNamedFlowContainingBlock):
309         (WebCore::RenderObject::containerForRepaint):
310         Changed to take into account that RenderView should be the repaintContainer for the
311         fixed positioned elements with named flow as the containing block.
312         * rendering/RenderObject.h:
313
314 2013-09-03  Arvid Nilsson  <anilsson@rim.com>
315
316         [BlackBerry] Remove LayerData::LayerProgram
317         https://bugs.webkit.org/show_bug.cgi?id=120601
318
319         Reviewed by Anders Carlsson.
320
321         JIRA 490672
322         All layer contents are RGBA now, so there's no need to support BGRA any
323         more and the LayerData::LayerProgram enum can be removed. Related dead
324         code was removed.
325
326         No new tests, no change in behavior.
327
328         * platform/graphics/blackberry/EGLImageLayerWebKitThread.cpp:
329         (WebCore::EGLImageLayerWebKitThread::EGLImageLayerWebKitThread):
330         * platform/graphics/blackberry/LayerData.h:
331         (WebCore::LayerData::LayerData):
332         * platform/graphics/blackberry/LayerRenderer.cpp:
333         (WebCore::LayerRenderer::compositeLayersRecursive):
334         (WebCore::LayerRenderer::createProgram):
335         * platform/graphics/blackberry/LayerRenderer.h:
336         * platform/graphics/blackberry/LayerWebKitThread.h:
337         * platform/graphics/blackberry/PluginLayerWebKitThread.cpp:
338         (WebCore::PluginLayerWebKitThread::setPluginView):
339
340 2013-09-03  Xabier Rodriguez Calvar  <calvaris@igalia.com>
341
342         [GStreamer] Video player sets system volume to 100%
343         https://bugs.webkit.org/show_bug.cgi?id=118974
344
345         Reviewed by Philippe Normand.
346
347         In order to preserve the system volume we need to keep track of
348         the volume being initialized in the HTMLMediaElement and then just
349         setting the volume to the sink when initializing the pipeline if
350         that volume was changed before.
351
352         * html/HTMLMediaElement.cpp:
353         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialized
354         attribute to false.
355         (WebCore::HTMLMediaElement::setVolume): Set the attribute to true
356         when volume is changed.
357         (WebCore::HTMLMediaElement::updateVolume): Set the volume only if
358         volume was initialized.
359         (WebCore::HTMLMediaElement::mediaPlayerPlatformVolumeConfigurationRequired):
360         Platform volume configuration is required only if volume was not
361         initialized before.
362         * html/HTMLMediaElement.h: Added attribute and interface method.
363         * platform/graphics/MediaPlayer.h:
364         (WebCore::MediaPlayerClient::mediaPlayerPlatformVolumeConfigurationRequired):
365         Declared and added default implementation for the interface method.
366         (WebCore::MediaPlayer::platformVolumeConfigurationRequired):
367         Asked the client, meaning the HTMLMediaElement if the platform
368         volume configuration is required.
369         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
370         (WebCore::mediaPlayerPrivateVolumeChangedCallback): Added log.
371         (WebCore::MediaPlayerPrivateGStreamerBase::setVolume): Added log.
372         (WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement):
373         Set the volume only if not platform volume is required and added log.
374
375 2013-09-02  Darin Adler  <darin@apple.com>
376
377         * inspector/InspectorProfilerAgent.cpp:
378         (WebCore::InspectorProfilerAgent::removeProfile): Fix braces here; a review
379         comment I forgot to address in my last check-in.
380
381 2013-09-02  Darin Adler  <darin@apple.com>
382
383         Cut down on double hashing and code needlessly using hash table iterators
384         https://bugs.webkit.org/show_bug.cgi?id=120611
385
386         Reviewed by Andreas Kling.
387
388         Some of these changes are primarily code cleanup, but others could provide
389         a small code size and speed improvement by avoiding extra hashing.
390
391         * Modules/geolocation/Geolocation.cpp:
392         (WebCore::Geolocation::Watchers::find): Use get instead of find.
393         (WebCore::Geolocation::Watchers::remove): Use take instead of find.
394         (WebCore::Geolocation::makeCachedPositionCallbacks): Use the return
395         value from remove to avoid hashing twice.
396
397         * Modules/webaudio/AudioContext.cpp:
398         (WebCore::AudioContext::addAutomaticPullNode): Use the return value from
399         add to avoid hashing twice.
400         (WebCore::AudioContext::removeAutomaticPullNode): Use the return value
401         from remove to avoid hashing twice.
402
403         * Modules/webaudio/AudioNodeInput.cpp:
404         (WebCore::AudioNodeInput::connect): Use the return value from add to avoid
405         hashing twice.
406         (WebCore::AudioNodeInput::disconnect): Use the return value from remove
407         to avoid hashing twice.
408
409         * Modules/webaudio/AudioParam.cpp:
410         (WebCore::AudioParam::connect): Use the return value from add to avoid
411         hashing twice.
412         (WebCore::AudioParam::disconnect): Use the return value from remove to
413         avoid hashing twice.
414
415         * bridge/NP_jsobject.cpp:
416         (ObjectMap::remove): Use remove instead of find/remove.
417
418         * dom/Node.cpp:
419         (WebCore::Node::~Node): Use the return value from remove instead of
420         find/remove.
421
422         * inspector/InspectorProfilerAgent.cpp:
423         (WebCore::InspectorProfilerAgent::removeProfile): Remove needless
424         calls to contains.
425
426         * loader/DocumentLoader.cpp:
427         (WebCore::DocumentLoader::removeSubresourceLoader): Use the return
428         value from remove instead of find/remove.
429
430         * loader/ResourceLoadScheduler.cpp:
431         (WebCore::ResourceLoadScheduler::HostInformation::remove): Use the
432         return value from remove to avoid hashing twice.
433
434         * loader/appcache/ApplicationCacheGroup.cpp:
435         (WebCore::ApplicationCacheGroup::disassociateDocumentLoader): Use
436         remove instead of find/remove.
437         (WebCore::ApplicationCacheGroup::cacheDestroyed): Removed a needless
438         call to contains to avoid hashing twice. It's fine to do the check
439         for an empty hash table unconditionally.
440
441         * page/DOMWindow.cpp:
442         (WebCore::addUnloadEventListener): Eliminated a local variable for clarity.
443         (WebCore::removeUnloadEventListener): Ditto. Also use remove instead
444         of find/remove.
445         (WebCore::removeAllUnloadEventListeners): Ditto. Also use removeAll instead
446         of find/removeAll.
447         (WebCore::addBeforeUnloadEventListener): Ditto.
448         (WebCore::removeBeforeUnloadEventListener): Ditto.
449         (WebCore::removeAllBeforeUnloadEventListeners): Ditto.
450
451         * page/FrameView.cpp:
452         (WebCore::FrameView::removeViewportConstrainedObject): Use the return
453         value from remove to avoid hashing twice.
454         (WebCore::FrameView::removeScrollableArea): Use the return value from
455         remove instead of find/remove.
456         (WebCore::FrameView::containsScrollableArea): Use && instead of an if
457         statement in a way that is idiomatic for this kind of function.
458
459         * page/Page.cpp:
460         (WebCore::Page::addRelevantRepaintedObject): Use the return value from
461         remove instead of find/remove.
462
463         * page/PageGroup.cpp:
464         (WebCore::PageGroup::removeUserScriptsFromWorld): Use remove instead
465         of find/remove.
466         (WebCore::PageGroup::removeUserStyleSheetsFromWorld): Use the return
467         value from remove instead of find/remove.
468
469         * page/PerformanceUserTiming.cpp:
470         (WebCore::clearPeformanceEntries): Removed a needless call to contains.
471
472         * platform/graphics/DisplayRefreshMonitor.cpp:
473         (WebCore::DisplayRefreshMonitor::removeClient): Use the return value
474         from remove instead of find/remove.
475         (WebCore::DisplayRefreshMonitorManager::displayDidRefresh): Use remove
476         instead of find/remove.
477
478         * platform/graphics/blackberry/LayerRenderer.cpp:
479         (WebCore::LayerRenderer::removeLayer): Use the return value from remove
480         instead of find/remove.
481
482         * platform/win/WindowMessageBroadcaster.cpp:
483         (WebCore::WindowMessageBroadcaster::removeListener): Use remove instead
484         of find/remove. It's fine to do the check for an empty hash table unconditionally.
485
486         * plugins/PluginDatabase.cpp:
487         (WebCore::PluginDatabase::removeDisabledPluginFile): Use the return value
488         from remove instead of find/remove.
489
490         * rendering/style/StyleCustomFilterProgramCache.cpp:
491         (WebCore::StyleCustomFilterProgramCache::lookup): Use get instead of find.
492         (WebCore::StyleCustomFilterProgramCache::add): Use contains instead of find
493         in an assertion.
494         (WebCore::StyleCustomFilterProgramCache::remove): Use remove instead of
495         find/remove.
496
497         * svg/SVGCursorElement.cpp:
498         (WebCore::SVGCursorElement::removeClient): Use the return value from remove
499         instead of find/remove.
500
501         * svg/SVGDocumentExtensions.cpp:
502         (WebCore::SVGDocumentExtensions::removeResource): Removed an unneeded call
503         to contains.
504         (WebCore::SVGDocumentExtensions::removeAllTargetReferencesForElement): Use
505         remove instead of find/remove. It's fine to do the check for an empty hash
506         table unconditionally.
507         (WebCore::SVGDocumentExtensions::removeAllElementReferencesForTarget): Use
508         remove instead of find/remove. Also removed unhelpful assertions. One is
509         already done by HashMap, and the other is just checking a basic invariant
510         of every HashMap that doesn't need to be checked.
511
512         * svg/graphics/SVGImageCache.cpp:
513         (WebCore::SVGImageCache::removeClientFromCache): Removed an unneeded call
514         to contains.
515
516         * svg/properties/SVGAnimatedProperty.cpp:
517         (WebCore::SVGAnimatedProperty::~SVGAnimatedProperty): Use the version of
518         remove that takes an iterator rather than the one that takes a key, so
519         we don't need to redo the hashing.
520
521 2013-09-02  Andreas Kling  <akling@apple.com>
522
523         Generate isFooElement() functions from tagname data.
524         <https://webkit.org/b/120584>
525
526         Reviewed by Antti Koivisto.
527
528         Add a "generateTypeChecks" attribute that can be used in HTMLTagNames.in & friends.
529         If present, isFooElement() style helpers will be added to HTMLElementTypeChecks.h.
530         This also outputs an isElementOfType<T> check for the Element iterators.
531
532         Removed all the hand-written isFooElement() functions that only checked tag name.
533
534         * html/HTMLTagNames.in:
535         * svg/svgtags.in:
536
537             Added "generateTypeChecks" attribute as appropriate.
538
539         * GNUmakefile.am:
540         * GNUmakefile.list.am:
541         * WebCore.vcxproj/WebCore.vcxproj:
542         * WebCore.xcodeproj/project.pbxproj:
543
544             Added to build systems based on how HTMLNames.h was done.
545             We're just outputting an additional header file in the generated code directory
546             so I suspect most ports will just pick this up automagically.
547
548         * dom/make_names.pl:
549         (defaultTagPropertyHash):
550         (printLicenseHeader):
551         (printTypeChecks):
552         (printTypeChecksHeaderFile):
553
554             Generate a separate file for each namespace with isFooElement() helpers for
555             elements with "generateTypeChecks" attribute set.
556
557 2013-09-02  Darin Adler  <darin@apple.com>
558
559         [Mac] No need for HardAutorelease, which is same as CFBridgingRelease
560         https://bugs.webkit.org/show_bug.cgi?id=120569
561
562         Reviewed by Andy Estes.
563
564         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
565         (AXTextMarkerRange):
566         (AXTextMarkerRangeStart):
567         (AXTextMarkerRangeEnd):
568         (textMarkerForVisiblePosition):
569         Use CFBridgingRelease.
570
571         * platform/mac/KURLMac.mm:
572         (WebCore::KURL::operator NSURL *): Use CFBridgingRelease.
573         (WebCore::KURL::createCFURL): Get rid of needless local variable.
574
575         * platform/mac/WebCoreNSURLExtras.mm:
576         (WebCore::mapHostNameWithRange):
577         (WebCore::URLWithData):
578         (WebCore::userVisibleString):
579         * platform/text/mac/StringImplMac.mm:
580         (WTF::StringImpl::operator NSString *):
581         Use CFBridgingRelease.
582
583 2013-09-01  Andreas Kling  <akling@apple.com>
584
585         Ref: A smart pointer for the reference age.
586         <https://webkit.org/b/120570>
587
588         Reviewed by Antti Koivisto.
589
590         Use Ref<T> for various stack guards where null checking isn't needed.
591
592 2013-09-02  Andreas Kling  <akling@apple.com>
593
594         Simplify DocumentType handling.
595         <https://webkit.org/b/120529>
596
597         Reviewed by Antti Koivisto.
598
599         Removed the insertedInto()/removedFrom() handlers from DocumentType.
600
601         Document no longer keeps a pointer to its doctype node, it was only used for the
602         document.doctype DOM API, which now just looks through the list of (<=2) children.
603
604         The ENABLE(LEGACY_VIEWPORT_ADAPTION) hunk from Document::setDocType() was moved
605         into Document::childrenChanged().
606
607         We no longer clear the style resolver on doctype insertion/removal since it
608         doesn't actually affect style anyway.
609
610         Also made doctype() return a PassRefPtr<DocumentType> instead of a raw pointer.
611
612         * dom/Document.cpp:
613         (WebCore::Document::dispose):
614         (WebCore::Document::doctype):
615         (WebCore::Document::childrenChanged):
616         * dom/Document.h:
617         * dom/DocumentType.cpp:
618         * dom/DocumentType.h:
619         * editing/markup.cpp:
620         (WebCore::documentTypeString):
621
622 2013-09-02  Anton Obzhirov  <a.obzhirov@samsung.com>
623
624         <https://webkit.org/b/98350> [GTK] accessibility/aria-invalid.html times out
625
626         Reviewed by Mario Sanchez Prada.
627
628         The patch exposes aria-invalid attribute to ATK.
629
630         * accessibility/atk/AXObjectCacheAtk.cpp:
631         (WebCore::AXObjectCache::postPlatformNotification):
632         Added emitting state-change signal for aria-invalid event.
633         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
634         (webkitAccessibleGetAttributes):
635         Added aria-invalid attribute.
636
637 2013-09-02  Commit Queue  <commit-queue@webkit.org>
638
639         Unreviewed, rolling out r154955.
640         http://trac.webkit.org/changeset/154955
641         https://bugs.webkit.org/show_bug.cgi?id=120605
642
643         broke xcode4 build :| (Requested by kling on #webkit).
644
645         * GNUmakefile.am:
646         * GNUmakefile.list.am:
647         * WebCore.vcxproj/WebCore.vcxproj:
648         * WebCore.xcodeproj/project.pbxproj:
649         * dom/make_names.pl:
650         (defaultTagPropertyHash):
651         (printLicenseHeader):
652         * html/HTMLAnchorElement.h:
653         (WebCore::isHTMLAnchorElement):
654         (WebCore::HTMLAnchorElement):
655         * html/HTMLAreaElement.h:
656         (WebCore::isHTMLAreaElement):
657         (WebCore::HTMLAreaElement):
658         * html/HTMLAudioElement.h:
659         (WebCore::isHTMLAudioElement):
660         * html/HTMLBaseElement.h:
661         (WebCore::isHTMLBaseElement):
662         (WebCore::HTMLBaseElement):
663         * html/HTMLCanvasElement.h:
664         (WebCore::isHTMLCanvasElement):
665         * html/HTMLElement.h:
666         * html/HTMLFieldSetElement.h:
667         (WebCore::isHTMLFieldSetElement):
668         (WebCore::HTMLFieldSetElement):
669         * html/HTMLFormElement.h:
670         (WebCore::isHTMLFormElement):
671         * html/HTMLFrameSetElement.h:
672         (WebCore::isHTMLFrameSetElement):
673         (WebCore::HTMLFrameSetElement):
674         * html/HTMLImageElement.h:
675         (WebCore::isHTMLImageElement):
676         * html/HTMLInputElement.h:
677         (WebCore::isHTMLInputElement):
678         * html/HTMLLabelElement.h:
679         (WebCore::isHTMLLabelElement):
680         (WebCore::HTMLLabelElement):
681         * html/HTMLLegendElement.h:
682         (WebCore::isHTMLLegendElement):
683         (WebCore::HTMLLegendElement):
684         * html/HTMLMapElement.h:
685         (WebCore::isHTMLMapElement):
686         * html/HTMLMeterElement.h:
687         (WebCore::isHTMLMeterElement):
688         * html/HTMLOptGroupElement.h:
689         (WebCore::isHTMLOptGroupElement):
690         * html/HTMLOptionElement.h:
691         (WebCore::isHTMLOptionElement):
692         * html/HTMLParamElement.h:
693         (WebCore::isHTMLParamElement):
694         (WebCore::HTMLParamElement):
695         * html/HTMLProgressElement.h:
696         (WebCore::isHTMLProgressElement):
697         * html/HTMLScriptElement.h:
698         (WebCore::isHTMLScriptElement):
699         * html/HTMLSourceElement.h:
700         (WebCore::isHTMLSourceElement):
701         (WebCore::HTMLSourceElement):
702         * html/HTMLStyleElement.h:
703         (WebCore::isHTMLStyleElement):
704         (WebCore::HTMLStyleElement):
705         * html/HTMLTableElement.h:
706         (WebCore::isHTMLTableElement):
707         * html/HTMLTableRowElement.h:
708         (WebCore::isHTMLTableRowElement):
709         (WebCore::HTMLTableRowElement):
710         * html/HTMLTagNames.in:
711         * html/HTMLTextAreaElement.h:
712         (WebCore::isHTMLTextAreaElement):
713         * html/HTMLTitleElement.h:
714         (WebCore::isHTMLTitleElement):
715         (WebCore::HTMLTitleElement):
716         * html/HTMLTrackElement.h:
717         (WebCore::isHTMLTrackElement):
718         (WebCore::HTMLTrackElement):
719         * svg/SVGElement.h:
720         * svg/SVGFontElement.h:
721         (WebCore::isSVGFontElement):
722         * svg/SVGFontFaceElement.h:
723         (WebCore::isSVGFontFaceElement):
724         (WebCore::SVGFontFaceElement):
725         * svg/SVGForeignObjectElement.h:
726         (WebCore::isSVGForeignObjectElement):
727         (WebCore::SVGForeignObjectElement):
728         * svg/SVGImageElement.h:
729         (WebCore::isSVGImageElement):
730         * svg/SVGScriptElement.h:
731         (WebCore::isSVGScriptElement):
732         * svg/svgtags.in:
733
734 2013-09-02  Antti Koivisto  <antti@apple.com>
735
736         Clean up ContainerNode::childrenChanged
737         https://bugs.webkit.org/show_bug.cgi?id=120599
738
739         Reviewed by Andreas Kling.
740
741         - Make childrenChanged take a single struct argument instead of a long list of arguments.
742         - Use enum instead of childCountDelta. It was always -1, 0, 1 or the total number of children (in case of removing them all).
743         - Remove use of Node*, give the change range as Elements.
744         - Related cleanups.
745
746         * dom/Attr.cpp:
747         (WebCore::Attr::childrenChanged):
748         * dom/Attr.h:
749         * dom/CharacterData.cpp:
750         (WebCore::CharacterData::parserAppendData):
751         (WebCore::CharacterData::dispatchModifiedEvent):
752         * dom/ContainerNode.cpp:
753         (WebCore::ContainerNode::insertBefore):
754         (WebCore::ContainerNode::notifyChildInserted):
755         (WebCore::ContainerNode::notifyChildRemoved):
756         
757             Add private helpers for setting up the struct.
758
759         (WebCore::ContainerNode::parserInsertBefore):
760         (WebCore::ContainerNode::replaceChild):
761         (WebCore::ContainerNode::removeChild):
762         (WebCore::ContainerNode::parserRemoveChild):
763         (WebCore::ContainerNode::removeChildren):
764         (WebCore::ContainerNode::appendChild):
765         (WebCore::ContainerNode::parserAppendChild):
766         (WebCore::ContainerNode::childrenChanged):
767         (WebCore::ContainerNode::updateTreeAfterInsertion):
768         * dom/ContainerNode.h:
769         * dom/Document.cpp:
770         (WebCore::Document::childrenChanged):
771         * dom/Document.h:
772         * dom/Element.cpp:
773         (WebCore::checkForSiblingStyleChanges):
774         
775             Clean up and simplify. Since we now get element range automatically we don't need to compute it.
776
777         (WebCore::Element::childrenChanged):
778         (WebCore::Element::finishParsingChildren):
779         * dom/Element.h:
780         * dom/ShadowRoot.cpp:
781         (WebCore::ShadowRoot::childrenChanged):
782         * dom/ShadowRoot.h:
783         * html/HTMLElement.cpp:
784         (WebCore::HTMLElement::childrenChanged):
785         (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged):
786         
787             Try to keep the existing behavior. This code needs  more cleanup to be sane. It shouldn't operate on Nodes
788             as it only really cares about Elements.
789
790         * html/HTMLElement.h:
791         * html/HTMLFieldSetElement.cpp:
792         (WebCore::HTMLFieldSetElement::childrenChanged):
793         * html/HTMLFieldSetElement.h:
794         * html/HTMLObjectElement.cpp:
795         (WebCore::HTMLObjectElement::childrenChanged):
796         * html/HTMLObjectElement.h:
797         * html/HTMLOptGroupElement.cpp:
798         (WebCore::HTMLOptGroupElement::childrenChanged):
799         * html/HTMLOptGroupElement.h:
800         * html/HTMLOptionElement.cpp:
801         (WebCore::HTMLOptionElement::childrenChanged):
802         * html/HTMLOptionElement.h:
803         * html/HTMLOutputElement.cpp:
804         (WebCore::HTMLOutputElement::childrenChanged):
805         * html/HTMLOutputElement.h:
806         * html/HTMLScriptElement.cpp:
807         (WebCore::HTMLScriptElement::childrenChanged):
808         * html/HTMLScriptElement.h:
809         * html/HTMLSelectElement.cpp:
810         (WebCore::HTMLSelectElement::childrenChanged):
811         * html/HTMLSelectElement.h:
812         * html/HTMLStyleElement.cpp:
813         (WebCore::HTMLStyleElement::childrenChanged):
814         * html/HTMLStyleElement.h:
815         * html/HTMLTextAreaElement.cpp:
816         (WebCore::HTMLTextAreaElement::childrenChanged):
817         * html/HTMLTextAreaElement.h:
818         * html/HTMLTitleElement.cpp:
819         (WebCore::HTMLTitleElement::childrenChanged):
820         * html/HTMLTitleElement.h:
821         * html/shadow/InsertionPoint.cpp:
822         (WebCore::InsertionPoint::childrenChanged):
823         * html/shadow/InsertionPoint.h:
824         * svg/SVGClipPathElement.cpp:
825         (WebCore::SVGClipPathElement::childrenChanged):
826         * svg/SVGClipPathElement.h:
827         * svg/SVGElement.cpp:
828         (WebCore::SVGElement::childrenChanged):
829         * svg/SVGElement.h:
830         * svg/SVGFELightElement.cpp:
831         (WebCore::SVGFELightElement::childrenChanged):
832         * svg/SVGFELightElement.h:
833         * svg/SVGFilterElement.cpp:
834         (WebCore::SVGFilterElement::childrenChanged):
835         * svg/SVGFilterElement.h:
836         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
837         (WebCore::SVGFilterPrimitiveStandardAttributes::childrenChanged):
838         * svg/SVGFilterPrimitiveStandardAttributes.h:
839         * svg/SVGFontFaceElement.cpp:
840         (WebCore::SVGFontFaceElement::childrenChanged):
841         * svg/SVGFontFaceElement.h:
842         * svg/SVGFontFaceFormatElement.cpp:
843         (WebCore::SVGFontFaceFormatElement::childrenChanged):
844         * svg/SVGFontFaceFormatElement.h:
845         * svg/SVGFontFaceSrcElement.cpp:
846         (WebCore::SVGFontFaceSrcElement::childrenChanged):
847         * svg/SVGFontFaceSrcElement.h:
848         * svg/SVGFontFaceUriElement.cpp:
849         (WebCore::SVGFontFaceUriElement::childrenChanged):
850         * svg/SVGFontFaceUriElement.h:
851         * svg/SVGGradientElement.cpp:
852         (WebCore::SVGGradientElement::childrenChanged):
853         * svg/SVGGradientElement.h:
854         * svg/SVGMarkerElement.cpp:
855         (WebCore::SVGMarkerElement::childrenChanged):
856         * svg/SVGMarkerElement.h:
857         * svg/SVGMaskElement.cpp:
858         (WebCore::SVGMaskElement::childrenChanged):
859         * svg/SVGMaskElement.h:
860         * svg/SVGPatternElement.cpp:
861         (WebCore::SVGPatternElement::childrenChanged):
862         * svg/SVGPatternElement.h:
863         * svg/SVGScriptElement.cpp:
864         (WebCore::SVGScriptElement::childrenChanged):
865         * svg/SVGScriptElement.h:
866         * svg/SVGStyleElement.cpp:
867         (WebCore::SVGStyleElement::childrenChanged):
868         * svg/SVGStyleElement.h:
869         * svg/SVGTitleElement.cpp:
870         (WebCore::SVGTitleElement::childrenChanged):
871         * svg/SVGTitleElement.h:
872
873 2013-09-02  Andreas Kling  <akling@apple.com>
874
875         Generate isFooElement() functions from tagname data.
876         <https://webkit.org/b/120584>
877
878         Reviewed by Antti Koivisto.
879
880         Add a "generateTypeChecks" attribute that can be used in HTMLTagNames.in & friends.
881         If present, isFooElement() style helpers will be added to HTMLElementTypeChecks.h.
882         This also outputs an isElementOfType<T> check for the Element iterators.
883
884         Removed all the hand-written isFooElement() functions that only checked tag name.
885
886         * html/HTMLTagNames.in:
887         * svg/svgtags.in:
888
889             Added "generateTypeChecks" attribute as appropriate.
890
891         * GNUmakefile.am:
892         * GNUmakefile.list.am:
893         * WebCore.vcxproj/WebCore.vcxproj:
894         * WebCore.xcodeproj/project.pbxproj:
895
896             Added to build systems based on how HTMLNames.h was done.
897             We're just outputting an additional header file in the generated code directory
898             so I suspect most ports will just pick this up automagically.
899
900         * dom/make_names.pl:
901         (defaultTagPropertyHash):
902         (printLicenseHeader):
903         (printTypeChecks):
904         (printTypeChecksHeaderFile):
905
906             Generate a separate file for each namespace with isFooElement() helpers for
907             elements with "generateTypeChecks" attribute set.
908
909 2013-09-02  Dirk Schulze  <krit@webkit.org>
910
911         Use edgeMode=duplicate for blurring on filter() function
912         https://bugs.webkit.org/show_bug.cgi?id=120590
913
914         Reviewed by Antti Koivisto.
915
916         Filters on the CSS Image function filter() are not allowed to extend the
917         dimension of the input image. This causes weird results on blurring an image,
918         where the fading on the edges is clipped at the half of the fading.
919         We shouldn't fade edges at all and use the edgeMode=duplicate instead.
920         This will duplicate the pixel value on the nearest edge of the input image
921         instead of taking transparent black and results in nice blurred images with
922         sharp edges.
923
924         Spec: http://dev.w3.org/fxtf/filters/#blurEquivalent
925
926         Test: fast/filter-image/filter-image-blur.html
927
928         * css/CSSFilterImageValue.cpp: Pass consumer information to the renderer.
929         (WebCore::CSSFilterImageValue::image):
930         * rendering/FilterEffectRenderer.cpp: Set edgeMode for feGaussianBlur to
931             'duplicate' or 'none' depending on the consumer.
932         (WebCore::FilterEffectRenderer::build):
933         * rendering/FilterEffectRenderer.h: Add enumeration to differ between the 
934             different consumers of the renderer.
935         * rendering/RenderLayer.cpp:
936         (WebCore::RenderLayer::updateOrRemoveFilterEffectRenderer):  Pass consumer
937             information to the renderer.
938
939 2013-09-01  Dirk Schulze  <krit@webkit.org>
940
941         Add 'edgeMode' attribute to SVGFEGaussianBlur
942         https://bugs.webkit.org/show_bug.cgi?id=120582
943
944         Add 'edgeMode' attribute to the SVGFEGaussianBlur element. This attribute
945         allows users to define the behavior on edges with the values 'none' where
946         pixel values outside the input image are treated as transparent black. (The
947         current blurring behavior.) 'duplicate' which repeats the values on the
948         nearest edge and 'warp', which takes the pixel of the opposite site of
949         the input image.
950         Beside the attribute, this patch implements the behavior of 'duplicate'.
951
952         http://dev.w3.org/fxtf/filters/#feGaussianBlurEdgeModeAttribute
953
954         Reviewed by Rob Buis.
955
956         Tests: svg/dynamic-updates/SVGFEGaussianBlurElement-dom-edgeMode-attr.html
957                svg/dynamic-updates/SVGFEGaussianBlurElement-svgdom-edgeMode-prop.html
958                svg/filters/svg-gaussianblur-edgeMode-duplicate-expected.svg
959                svg/filters/svg-gaussianblur-edgeMode-duplicate.svg
960
961         * platform/graphics/filters/FEGaussianBlur.cpp:
962         (WebCore::FEGaussianBlur::FEGaussianBlur):
963         (WebCore::FEGaussianBlur::create):
964         (WebCore::FEGaussianBlur::edgeMode):
965         (WebCore::FEGaussianBlur::setEdgeMode):
966         (WebCore::boxBlur):
967         (WebCore::FEGaussianBlur::platformApplyGeneric):
968         (WebCore::FEGaussianBlur::determineAbsolutePaintRect):
969         * platform/graphics/filters/FEGaussianBlur.h:
970         * rendering/FilterEffectRenderer.cpp:
971         (WebCore::FilterEffectRenderer::build):
972         * svg/SVGFEGaussianBlurElement.cpp:
973         (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement):
974         (WebCore::SVGFEGaussianBlurElement::isSupportedAttribute):
975         (WebCore::SVGFEGaussianBlurElement::parseAttribute):
976         (WebCore::SVGFEGaussianBlurElement::svgAttributeChanged):
977         (WebCore::SVGFEGaussianBlurElement::build):
978         * svg/SVGFEGaussianBlurElement.h:
979         * svg/SVGFEGaussianBlurElement.idl:
980
981 2013-09-01  Andreas Kling  <akling@apple.com>
982
983         EventHandler::m_frame should be a Frame&.
984         <https://webkit.org/b/120580>
985
986         Reviewed by Darin Adler.
987
988         EventHandler is tied to the lifetime of its frame, so let m_frame be a Frame&.
989         A handful of null checks and assertions removed.
990
991 2013-09-01  Darin Adler  <darin@apple.com>
992
993         Fix a mistake in my recent pasteboard/editor refactoring that was causing tests to fail.
994
995         * editing/mac/EditorMac.mm:
996         (WebCore::getImage): One place this said cachedImage but it should have said tentativeCachedImage.
997
998 2013-09-01  Darin Adler  <darin@apple.com>
999
1000         HitTestResult should have innerNonSharedElement
1001         https://bugs.webkit.org/show_bug.cgi?id=120579
1002
1003         Reviewed by Andreas Kling.
1004
1005         * editing/Editor.cpp:
1006         (WebCore::Editor::copyImage): Call HitTestResult member function version of
1007         innerNonSharedElement instead of a local function that does it.
1008
1009         * page/Chrome.cpp:
1010         (WebCore::Chrome::setToolTip): Use innerNonSharedElement instead of getting
1011         the node and checking if it's an input element. Also added some missing braces.
1012
1013         * page/EventHandler.cpp:
1014         (WebCore::EventHandler::selectClosestWordFromHitTestResult): Use targetNode for
1015         local variables instead of innerNode to match the HitTestResult function name.
1016         (WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent): Ditto.
1017         (WebCore::EventHandler::handleMousePressEventTripleClick): Ditto.
1018         (WebCore::EventHandler::handleMousePressEventSingleClick): Ditto.
1019         (WebCore::EventHandler::handleMousePressEvent): Ditto.
1020
1021         * rendering/HitTestResult.cpp:
1022         (WebCore::HitTestResult::innerElement): Rewrote so there there is no loop.
1023         (WebCore::HitTestResult::innerNonSharedElement): Ditto.
1024
1025         * rendering/HitTestResult.h: Added innerNonSharedElement. Generally speaking,
1026         we'd like to avoid using Node unless there is some real need.
1027
1028 2013-09-01  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1029
1030         Volume slider value should be 0 when audio is muted
1031         https://bugs.webkit.org/show_bug.cgi?id=120553
1032
1033         Reviewed by Eric Carlson.
1034
1035         Fixed the problem of showing a non empty slider when audio is
1036         muted.
1037
1038         Test: media/volume-bar-empty-when-muted.html.
1039
1040         * html/shadow/MediaControls.cpp:
1041         (WebCore::MediaControls::reset): Use setSliderVolume.
1042         (WebCore::MediaControls::changedVolume): Use setSliderVolume.
1043         (WebCore::MediaControls::setSliderVolume): Added to set the volume
1044         to 0 when muted and to its value otherwise.
1045         * html/shadow/MediaControls.h: Added setSliderVolume.
1046         * html/shadow/MediaControlsApple.cpp:
1047         (WebCore::MediaControlsApple::reset): Used setSliderVolume and
1048         setFullscreenSliderVolume.
1049         (WebCore::MediaControlsApple::changedVolume): Used
1050         setFullscreenSliderVolume.
1051         (WebCore::MediaControlsApple::setFullscreenSliderVolume): Added to
1052         set the volume to 0 when muted and to its value otherwise.
1053         * html/shadow/MediaControlsApple.h: Added setFullscreenSliderVolume
1054         * html/shadow/MediaControlsBlackBerry.cpp:
1055         (WebCore::MediaControlsBlackBerry::reset): Used setSliderVolume.
1056
1057 2013-09-01  Andreas Kling  <akling@apple.com>
1058
1059         Give EditCommand a protected Frame& getter.
1060         <https://webkit.org/b/120574>
1061
1062         Reviewed by Darin Adler.
1063
1064         EditCommand is only created for documents that are attached to a Frame,
1065         we already ASSERTed as much in the EditCommand constructor.
1066
1067         This patch adds a "Frame& EditCommand::frame()" helper, so EditCommand
1068         and its subclasses don't have to fumble around with pointers.
1069
1070 2013-08-31  Antti Koivisto  <antti@apple.com>
1071
1072         Add element ancestor iterator
1073         https://bugs.webkit.org/show_bug.cgi?id=120563
1074
1075         Reviewed by Andreas Kling.
1076
1077         This patch adds ancestor iterators. They iterate over elements parent chain up to the root.
1078         
1079         To iterate over Element ancestors:
1080         
1081         auto ancestors = elementAncestors(this);
1082         for (auto it = ancestors.begin(), end = ancestors.end(); it != end; ++it) {
1083             Element& element = *it;
1084             ...
1085
1086         To iterate over Element ancestors including the current element:
1087         
1088         auto lineage = elementLineage(this);
1089         for (auto it = lineage.begin(), end = lineage.end(); it != end; ++it) {
1090             Element& element = *it;
1091             ...
1092             
1093         To iterate over ancestors of a specific Element subclass:
1094
1095         auto htmlAncestors = ancestorsOfType<HTMLElement>(this);
1096         for (auto it = htmlAncestors.begin(), end = htmlAncestors.end(); it != end; ++it) {
1097             HTMLElement& htmlElement = *it;
1098             ...
1099             
1100         To iterate over ancestors of a specific Element subclass including the current element:
1101
1102         auto htmlLineage = lineageOfType<HTMLElement>(this);
1103         for (auto it = htmlLineage.begin(), end = htmlLineage.end(); it != end; ++it) {
1104             HTMLElement& htmlElement = *it;
1105             ...
1106             
1107         The patch also uses the new types in a few places.
1108
1109         * WebCore.xcodeproj/project.pbxproj:
1110         * accessibility/AccessibilityNodeObject.cpp:
1111         (WebCore::AccessibilityNodeObject::mouseButtonListener):
1112         (WebCore::AccessibilityNodeObject::labelForElement):
1113         * dom/ElementAncestorIterator.h: Added.
1114         (WebCore::::ElementAncestorIterator):
1115         (WebCore::::operator):
1116         (WebCore::::ElementAncestorConstIterator):
1117         (WebCore::::ElementAncestorIteratorAdapter):
1118         (WebCore::::begin):
1119         (WebCore::::end):
1120         (WebCore::::ElementAncestorConstIteratorAdapter):
1121         (WebCore::elementLineage):
1122         (WebCore::elementAncestors):
1123         (WebCore::ancestorsOfType):
1124         * dom/ElementIterator.h:
1125         (WebCore::findElementAncestorOfType):
1126         (WebCore::::traverseAncestor):
1127         (WebCore::=):
1128         * html/HTMLElement.cpp:
1129         (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged):
1130         * html/HTMLFieldSetElement.h:
1131         (WebCore::isHTMLFieldSetElement):
1132         (WebCore::HTMLFieldSetElement):
1133         * html/HTMLFrameSetElement.cpp:
1134         (WebCore::HTMLFrameSetElement::findContaining):
1135         * html/HTMLFrameSetElement.h:
1136         (WebCore::HTMLFrameSetElement):
1137         * html/HTMLInputElement.h:
1138         (WebCore::isHTMLInputElement):
1139         (WebCore::toHTMLInputElement):
1140         * html/HTMLLegendElement.cpp:
1141         (WebCore::HTMLLegendElement::associatedControl):
1142
1143 2013-08-31  Darin Adler  <darin@apple.com>
1144
1145         Refactor URL and image writing so layer-violating parts are in Editor, not Pasteboard (Mac-only at first)
1146         https://bugs.webkit.org/show_bug.cgi?id=120573
1147
1148         Reviewed by Andreas Kling.
1149
1150         * editing/Editor.cpp:
1151         (WebCore::Editor::copy): Use writeImageToPasteboard instead of Pasteboard::writeImage on Mac.
1152         (WebCore::Editor::copyURL): Use writeURLToPasteboard instead of Pasteboard::writeURL on Mac.
1153         (WebCore::innerNonSharedElement): Added. Used in copyImage.
1154         (WebCore::Editor::copyImage): Use innerNonSharedElement instead of innerNonSharedNode.
1155         Use writeImageToPasteboard instead of Pasteboard::writeImage on Mac.
1156
1157         * editing/Editor.h: Add new functions, writeURLToPasteboard and writeImageToPasteboard,
1158         both Mac-only for now.
1159
1160         * editing/mac/EditorMac.mm:
1161         (WebCore::Editor::pasteWithPasteboard): Removed unneeded "m_frame.editor()" round trip that
1162         was left behind in this function.
1163         (WebCore::getImage): Added. Helper used by writeImageToPasteboard.
1164         (WebCore::Editor::writeURLToPasteboard): Added. Sets up PasteboardURL and then calls
1165         Pasteboard::write with it.
1166         (WebCore::Editor::writeImageToPasteboard): Added. Sets up PasteboardImage and then calls
1167         Pasteboard::write with it.
1168         * page/DragController.cpp:
1169         (WebCore::DragController::startDrag): Use Editor::writeURLToPasteboard instead of
1170         Pasteboard::writeURL on Mac.
1171
1172         * platform/Pasteboard.h: Added PasteboardURL and PasteboardImage structures.
1173         Declare write functions for PasteboardWebContent, PasteboardURL, and PasteboardImage.
1174         Guard writeURL and writeImage with !PLATFORM(MAC).
1175
1176         * platform/mac/PasteboardMac.mm:
1177         (WebCore::writeURLForTypes): Changed this to take a PasteboardURL.
1178         (WebCore::Pasteboard::write): Renamed writeURL and writeImage to this. Refactor both
1179         to take PasteboardURL and PasteboardImage arguments.
1180         (WebCore::fileWrapper): Renamed from fileWrapperForImage since the fact that this is
1181         for an image is now clear from its argument, a PasteboardImage.
1182         (WebCore::writeFileWrapperAsRTFDAttachment): Changed this function to use early return.
1183
1184 2013-08-31  Andreas Kling  <akling@apple.com>
1185
1186         EditCommand constructors should take Document&.
1187         <https://webkit.org/b/120566>
1188
1189         Reviewed by Darin Adler.
1190
1191         Let EditCommand's and all subclass constructors take Document& instead of Document*.
1192         EditCommand::document() now returns a Document&.
1193
1194         Added Editor::document() which returns Editor::frame().document() after asserting
1195         that it's non-null, to make passing a Document& from Editor functions easier.
1196
1197 2013-08-31  Andreas Kling  <akling@apple.com>
1198
1199         Make more use of toRenderFoo(RenderObject&) cast helpers.
1200         <https://webkit.org/b/120565>
1201
1202         Reviewed by Darin Adler.
1203
1204         To make amends for putting ugly toRenderFoo(&renderer) casts everywhere,
1205         here's a patch that switches a bunch of code over to using reference-based casts.
1206
1207         I removed pointer-based casts altogether for these renderers:
1208
1209             - RenderBR
1210             - RenderCombineText
1211             - RenderListMarker
1212             - RenderVideo
1213             - RenderView
1214
1215 2013-08-31  Santosh Mahto  <santosh.ma@samsung.com>
1216
1217         warning: unused parameter ‘renderingMode'  in ImageBufferCairo.cpp:94
1218         https://bugs.webkit.org/show_bug.cgi?id=120543
1219
1220         Reviewed by Darin Adler.
1221
1222         Fixing warning by adding ASSERT_UNUSED.
1223
1224         * platform/graphics/cairo/ImageBufferCairo.cpp:
1225         (WebCore::ImageBuffer::ImageBuffer):
1226
1227 2013-08-31  Andreas Kling  <akling@apple.com>
1228
1229         Fix typo in r154931 that caused assertions in continuation tests.
1230
1231         * rendering/InlineFlowBox.cpp:
1232         (WebCore::InlineFlowBox::paint):
1233
1234 2013-08-31  Rob Buis  <rwlbuis@webkit.org>
1235
1236         XMLSerializer-attribute-namespace-prefix-conflicts can't produce reliable results
1237         https://bugs.webkit.org/show_bug.cgi?id=120490
1238
1239         Reviewed by Ryosuke Niwa.
1240
1241         Retain the key of the namespaces map by using AtomicString as key instead of AtomicStringImpl*.
1242
1243         * editing/MarkupAccumulator.h:
1244
1245 2013-08-31  Andreas Kling  <akling@apple.com>
1246
1247         InlineBox::renderer() and pals should return references.
1248         <https://webkit.org/b/120562>
1249
1250         Reviewed by Antti Koivisto.
1251
1252         Make InlineBox::renderer() and its friends return references instead of pointers.
1253         Every box always has a renderer, so this clears up any ambiguity, and a number of
1254         weird assertions in SVG code.
1255
1256         Made InlineBox::m_renderer private so subclasses have to go through renderer().
1257         The next step will be to replace renderer() with tightly-typed accessors where
1258         applicable (e.g InlineTextBox's renderer is always a RenderText.)
1259
1260         Also added reference versions of these RenderObject casts:
1261
1262             - toRenderBox()
1263             - toRenderBlock()
1264             - toRenderInline()
1265             - toRenderSVGInlineText()
1266
1267 2013-08-31  Andreas Kling  <akling@apple.com>
1268
1269         PostAttachCallbackDisabler should take a ContainerNode&.
1270         <https://webkit.org/b/120560>
1271
1272         Reviewed by Antti Koivisto.
1273
1274         Let PostAttachCallbackDisabler take a reference and remove an ugly assertion.
1275
1276         * dom/ContainerNode.h:
1277         (WebCore::PostAttachCallbackDisabler::PostAttachCallbackDisabler):
1278         (WebCore::PostAttachCallbackDisabler::~PostAttachCallbackDisabler):
1279         * dom/Document.cpp:
1280         (WebCore::Document::recalcStyle):
1281         * style/StyleResolveTree.cpp:
1282         (WebCore::Style::attachRenderTree):
1283
1284 2013-08-31  Antti Koivisto  <antti@apple.com>
1285
1286         Rename ChildIterator -> ElementChildIterator, DescendantIterator -> ElementDescendantIterator
1287         https://bugs.webkit.org/show_bug.cgi?id=120561
1288
1289         Reviewed by Andreas Kling.
1290
1291         New names are more descriptive and consistent. They also put related iterator files close by in file lists.
1292         The types are always used with auto so longer names don't make them any clumsier to use.
1293
1294         For simplicity included all Element iterator types from ElementIterator.h so it is the only file that has
1295         to be included by the clients.
1296
1297         * GNUmakefile.list.am:
1298         * Target.pri:
1299         * WebCore.vcxproj/WebCore.vcxproj:
1300         * WebCore.xcodeproj/project.pbxproj:
1301         * accessibility/AccessibilityNodeObject.cpp:
1302         * accessibility/AccessibilityRenderObject.cpp:
1303         * accessibility/AccessibilityTable.cpp:
1304         * css/CSSFontFaceSource.cpp:
1305         * dom/ChildIterator.h: Removed.
1306         * dom/DescendantIterator.h: Removed.
1307         * dom/Document.cpp:
1308         * dom/ElementChildIterator.h: Copied from Source/WebCore/dom/ChildIterator.h.
1309         (WebCore::::ElementChildIterator):
1310         (WebCore::::operator):
1311         (WebCore::::ElementChildConstIterator):
1312         (WebCore::::ElementChildIteratorAdapter):
1313         (WebCore::::begin):
1314         (WebCore::::end):
1315         (WebCore::::ElementChildConstIteratorAdapter):
1316         (WebCore::elementChildren):
1317         (WebCore::childrenOfType):
1318         * dom/ElementDescendantIterator.h: Copied from Source/WebCore/dom/DescendantIterator.h.
1319         (WebCore::::ElementDescendantIterator):
1320         (WebCore::::operator):
1321         (WebCore::::ElementDescendantConstIterator):
1322         (WebCore::::ElementDescendantIteratorAdapter):
1323         (WebCore::::begin):
1324         (WebCore::::end):
1325         (WebCore::::ElementDescendantConstIteratorAdapter):
1326         (WebCore::elementDescendants):
1327         (WebCore::descendantsOfType):
1328         * dom/ElementIterator.h:
1329         * dom/Node.cpp:
1330         * dom/TreeScope.cpp:
1331         * editing/ApplyStyleCommand.cpp:
1332         * editing/markup.cpp:
1333         * html/HTMLAppletElement.cpp:
1334         * html/HTMLFieldSetElement.cpp:
1335         * html/HTMLLabelElement.cpp:
1336         * html/HTMLMapElement.cpp:
1337         * html/HTMLMediaElement.cpp:
1338         * html/HTMLObjectElement.cpp:
1339         * loader/PlaceholderDocument.cpp:
1340         * rendering/FilterEffectRenderer.cpp:
1341         * style/StyleResolveTree.cpp:
1342         * svg/SVGElement.cpp:
1343         * svg/SVGSVGElement.cpp:
1344         * svg/animation/SMILTimeContainer.cpp:
1345         * svg/graphics/SVGImage.cpp:
1346
1347 2013-08-31  Andreas Kling  <akling@apple.com>
1348
1349         Don't do document style recalc unless there's a RenderView.
1350         <https://webkit.org/b/120558>
1351
1352         Reviewed by Antti Koivisto.
1353
1354         There's no sense in computing style for a Document that has no RenderView.
1355         Checking this before continuing also lets us know that there's a Frame & FrameView
1356         present, simplifying some things later on.
1357
1358         * dom/Document.cpp:
1359         (WebCore::Document::recalcStyle):
1360         * style/StyleResolveForDocument.cpp:
1361         (WebCore::Style::resolveForDocument):
1362
1363 2013-08-31  Antti Koivisto  <antti@apple.com>
1364
1365         Add common base for element iterators
1366         https://bugs.webkit.org/show_bug.cgi?id=120557
1367
1368         Reviewed by Andreas Kling.
1369
1370         Add ElementIterator and use it as the base for child and descendant iterators. The only difference is the definition of operator++.
1371         
1372         Also renamed DescendantIteratorAssertions to ElementIteratorAssertions.
1373
1374         * GNUmakefile.list.am:
1375         * Target.pri:
1376         * WebCore.vcxproj/WebCore.vcxproj:
1377         * WebCore.xcodeproj/project.pbxproj:
1378         * dom/ChildIterator.h:
1379         (WebCore::::ChildIterator):
1380         (WebCore::::operator):
1381         (WebCore::::ChildConstIterator):
1382         (WebCore::::begin):
1383         (WebCore::::end):
1384         * dom/DescendantIterator.h:
1385         (WebCore::::DescendantIterator):
1386         (WebCore::::operator):
1387         (WebCore::::DescendantConstIterator):
1388         * dom/DescendantIteratorAssertions.h: Removed.
1389         * dom/ElementIterator.h: Added.
1390         (WebCore::::ElementIterator):
1391         (WebCore::::traverseNext):
1392         (WebCore::::traversePrevious):
1393         (WebCore::::traverseNextSibling):
1394         (WebCore::::traversePreviousSibling):
1395         (WebCore::::operator):
1396         (WebCore::=):
1397         (WebCore::::ElementConstIterator):
1398         * dom/ElementIteratorAssertions.h: Copied from Source/WebCore/dom/DescendantIteratorAssertions.h.
1399         (WebCore::ElementIteratorAssertions::ElementIteratorAssertions):
1400         (WebCore::ElementIteratorAssertions::domTreeHasMutated):
1401         (WebCore::ElementIteratorAssertions::dropEventDispatchAssertion):
1402
1403 2013-08-30  Brent Fulgham  <bfulgham@apple.com>
1404
1405         [Windows] Build fix after r154921.
1406
1407         AVFoundationCF uses an internal wrapper object around the C-API. The call point
1408         in the original patch was inside the wrapper, which did not (yet) provide
1409         a method implementation.
1410
1411         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1412         (WebCore::MediaPlayerPrivateAVFoundationCF::updateVideoLayerGravity):
1413         (WebCore::AVFWrapper::updateVideoLayerGravity):
1414
1415 2013-08-30  Simon Fraser  <simon.fraser@apple.com>
1416
1417         Video with object-fit: cover can spill outside the box
1418         https://bugs.webkit.org/show_bug.cgi?id=52103
1419
1420         Reviewed by Dean Jackson.
1421         
1422         object-fit on renderers which use accelerated compositing needs special
1423         treatment.
1424         
1425         For directly composited images, and video, GraphicsLayer needs to know
1426         both the size of the content layer, and also a rectangle at which this
1427         should be clipped (because, for the first time, that content layer can be
1428         larger than the renderer's content box).
1429         
1430         AVFoundation would always aspect-ratio fit video by default, so plumb
1431         through MediaPlayer a way to override that when object-fit requires it.
1432         
1433         Added a LAYER_TREE_INCLUDES_CONTENT_LAYERS enum to the layerTreeAsText()
1434         flags so we can dump content layers for testing.
1435
1436         Tests: compositing/images/direct-image-object-fit.html
1437                compositing/reflections/direct-image-object-fit-reflected.html
1438                compositing/video/video-object-fit.html
1439
1440         * page/Frame.h: New LayerTreeFlagsIncludeContentLayers flag.
1441         * platform/graphics/GraphicsLayer.h: New flag.
1442         * platform/graphics/MediaPlayer.cpp:
1443         (WebCore::MediaPlayer::shouldMaintainAspectRatio):
1444         (WebCore::MediaPlayer::setShouldMaintainAspectRatio):
1445         * platform/graphics/MediaPlayer.h:
1446         * platform/graphics/MediaPlayerPrivate.h:
1447         (WebCore::MediaPlayerPrivateInterface::shouldMaintainAspectRatio):
1448         (WebCore::MediaPlayerPrivateInterface::setShouldMaintainAspectRatio):
1449         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1450         (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
1451         (WebCore::MediaPlayerPrivateAVFoundation::setShouldMaintainAspectRatio):
1452         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1453         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1454         (WebCore::MediaPlayerPrivateAVFoundationCF::updateVideoLayerGravity):
1455         (WebCore::AVFWrapper::platformLayer):
1456         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
1457         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1458         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1459         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
1460         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity):
1461         * platform/graphics/ca/GraphicsLayerCA.cpp: We need a new m_contentsClippingLayer to
1462         clip the contents layer, which only gets created when necessary. It has to be cloned
1463         for reflections.
1464         (WebCore::GraphicsLayerCA::willBeDestroyed):
1465         (WebCore::GraphicsLayerCA::setContentsRect):
1466         (WebCore::GraphicsLayerCA::setContentsClippingRect):
1467         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
1468         (WebCore::GraphicsLayerCA::updateSublayerList):
1469         (WebCore::GraphicsLayerCA::updateContentsImage):
1470         (WebCore::GraphicsLayerCA::updateContentsMediaLayer):
1471         (WebCore::GraphicsLayerCA::updateContentsCanvasLayer):
1472         (WebCore::GraphicsLayerCA::updateContentsColorLayer):
1473         (WebCore::GraphicsLayerCA::updateContentsRects):
1474         (WebCore::GraphicsLayerCA::dumpAdditionalProperties):
1475         (WebCore::GraphicsLayerCA::ensureCloneLayers):
1476         (WebCore::GraphicsLayerCA::removeCloneLayers):
1477         (WebCore::GraphicsLayerCA::fetchCloneLayers):
1478         * platform/graphics/ca/GraphicsLayerCA.h:
1479         * rendering/RenderLayerBacking.cpp: Need to push both the contentsRect and
1480         the contentsClippingRect down to the GraphicsLayers. Most of the time they
1481         are the same, unless object-fit makes them different.
1482         (WebCore::RenderLayerBacking::resetContentsRect):
1483         (WebCore::RenderLayerBacking::positionOverflowControlsLayers):
1484         (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundColor):
1485         (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage):
1486         (WebCore::RenderLayerBacking::updateImageContents):
1487         (WebCore::RenderLayerBacking::contentsBox):
1488         * rendering/RenderLayerCompositor.cpp:
1489         (WebCore::RenderLayerCompositor::layerTreeAsText):
1490         * rendering/RenderVideo.cpp:
1491         (WebCore::RenderVideo::updatePlayer):
1492         * testing/Internals.cpp:
1493         (WebCore::Internals::layerTreeAsText):
1494         * testing/Internals.h:
1495         * testing/Internals.idl:
1496
1497 2013-08-30  Brent Fulgham  <bfulgham@apple.com>
1498
1499         [Windows] Update to incorporate additional suggestions
1500         https://bugs.webkit.org/show_bug.cgi?id=120448
1501
1502         Reviewed by Darin Adler
1503
1504         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: Add
1505         notes as to why AVFoundationCF needs this extra method call.
1506         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h: Use OVERRIDE
1507         * rendering/RenderVideo.cpp: Replace ternary operator with logical &&.
1508
1509 2013-08-30  Brent Fulgham  <bfulgham@apple.com>
1510
1511         [Windows] Vide element in page always uses non-hw accelerated mode.
1512         https://bugs.webkit.org/show_bug.cgi?id=120448
1513
1514         Reviewed by Darin Adler
1515
1516         This patch is unfortunately larger than my original idea, but seems to make the
1517         layout system happier. Instead of switching into composited mode when building
1518         the media player, we now build the original layout tree with compositing active
1519         if the underlying media element requires it. The AVFoundationCF player needs to
1520         have the compositor available at construction time so it can attach to the
1521         rendering device. Otherwise it falls back to CPU-only mode.
1522
1523         * platform/graphics/MediaPlayer.cpp:
1524         (WebCore::MediaPlayer::requiresImmediateCompositing): Added
1525         * platform/graphics/MediaPlayer.h:
1526         * platform/graphics/MediaPlayerPrivate.h:
1527         (WebCore::MediaPlayerPrivateInterface::requiresImmediateCompositing): Added
1528         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1529         (WebCore::MediaPlayerPrivateAVFoundationCF::createAVPlayer): Added
1530         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
1531         (WebCore::MediaPlayerPrivateAVFoundationCF::requiresImmediateCompositing):
1532         * rendering/RenderLayerCompositor.cpp:
1533         (WebCore::RenderLayerCompositor::requiresCompositingForVideo): Uses new
1534         'requiresImmediateCompositing' to short-circuit check for whether a
1535         compositor is required.
1536         * rendering/RenderVideo.cpp:
1537         (WebCore::RenderVideo::requiresImmediateCompositing):
1538         * rendering/RenderVideo.h:
1539
1540 2013-08-30  Joseph Pecoraro  <pecoraro@apple.com>
1541
1542         Web Inspector: Breakpoints should have Automatically Continue Option
1543         https://bugs.webkit.org/show_bug.cgi?id=120187
1544
1545         Reviewed by Timothy Hatcher.
1546
1547         Tests: inspector-protocol/debugger/removeBreakpoint.html
1548                inspector-protocol/debugger/setBreakpoint-autoContinue.html
1549                inspector-protocol/debugger/setBreakpoint-column.html
1550                inspector-protocol/debugger/setBreakpoint-condition.html
1551                inspector-protocol/debugger/setBreakpoint.html
1552
1553         * inspector/Inspector.json:
1554         Convert the "condition" argument of setBreakpoint and setBreakpointByUrl
1555         to a BreakpointOptions object with optional properties. One of which
1556         is "condition" and a new option "autoContinue".
1557
1558         * bindings/js/ScriptDebugServer.h:
1559         * bindings/js/ScriptDebugServer.cpp:
1560         (WebCore::ScriptDebugServer::hasBreakpoint):
1561         (WebCore::ScriptDebugServer::pauseIfNeeded):
1562         Automatically continue if the breakpoint was hit and has autoContinue.
1563
1564         * inspector/InspectorDebuggerAgent.h:
1565         * inspector/InspectorDebuggerAgent.cpp:
1566         (WebCore::buildObjectForBreakpointCookie):
1567         (WebCore::InspectorDebuggerAgent::setBreakpointByUrl):
1568         (WebCore::InspectorDebuggerAgent::setBreakpoint):
1569         (WebCore::InspectorDebuggerAgent::continueToLocation):
1570         (WebCore::InspectorDebuggerAgent::didParseSource):
1571         * inspector/ScriptBreakpoint.h:
1572         (WebCore::ScriptBreakpoint::ScriptBreakpoint):
1573         Handle the new incoming BreakpointOptions type, and set the
1574         autoContinue state on ScriptBreakpoints.
1575
1576         * inspector/front-end/DebuggerModel.js:
1577         (WebInspector.DebuggerModel.prototype.setBreakpointByURL):
1578         (WebInspector.DebuggerModel.prototype.setBreakpointBySourceId):
1579         Update old front-end to be compatible with the new API.
1580
1581 2013-08-30  Dean Jackson  <dino@apple.com>
1582
1583         Animations should use double for key values, not floats
1584         https://bugs.webkit.org/show_bug.cgi?id=120547
1585
1586         Reviewed by Simon Fraser.
1587
1588         Merge https://chromium.googlesource.com/chromium/blink/+/71de046541c77120874b9bff82958ee9e0e20c7c
1589
1590         Some files have been renamed in the Blink port, and they have made some
1591         improvements, but I took what applied to us.
1592
1593         All our existing tests passed.
1594
1595         * css/StyleResolver.cpp:
1596         (WebCore::StyleResolver::keyframeStylesForAnimation):
1597         * css/WebKitCSSKeyframeRule.cpp:
1598         (WebCore::StyleKeyframe::parseKeyString):
1599         * css/WebKitCSSKeyframeRule.h:
1600         (WebCore::StyleKeyframe::getKeys):
1601         * platform/graphics/GraphicsLayer.h:
1602         (WebCore::AnimationValue::keyTime):
1603         (WebCore::AnimationValue::AnimationValue):
1604         (WebCore::FloatAnimationValue::create):
1605         (WebCore::FloatAnimationValue::FloatAnimationValue):
1606         (WebCore::TransformAnimationValue::create):
1607         (WebCore::TransformAnimationValue::TransformAnimationValue):
1608         (WebCore::FilterAnimationValue::create):
1609         (WebCore::FilterAnimationValue::FilterAnimationValue):
1610         * rendering/RenderLayerBacking.cpp:
1611         (WebCore::RenderLayerBacking::startAnimation):
1612         * rendering/style/KeyframeList.h:
1613         (WebCore::KeyframeValue::KeyframeValue):
1614         (WebCore::KeyframeValue::key):
1615         (WebCore::KeyframeValue::setKey):
1616
1617 2013-08-30  Brendan Long  <b.long@cablelabs.com>
1618
1619         [GStreamer] support in-band text tracks
1620         https://bugs.webkit.org/show_bug.cgi?id=103771
1621
1622         Reviewed by Eric Carlson.
1623
1624         Tests: New tests added because existing tests were too specific.
1625            media/track/in-band/track-in-band-kate-ogg-cues-added-once.html
1626            media/track/in-band/track-in-band-kate-ogg-kind.html
1627            media/track/in-band/track-in-band-kate-ogg-language.html
1628            media/track/in-band/track-in-band-kate-ogg-mode.html
1629            media/track/in-band/track-in-band-kate-ogg-style.html
1630            media/track/in-band/track-in-band-kate-ogg-track-order.html
1631            media/track/in-band/track-in-band-srt-mkv-cues-added-once.html
1632            media/track/in-band/track-in-band-srt-mkv-kind.html
1633            media/track/in-band/track-in-band-srt-mkv-language.html
1634            media/track/in-band/track-in-band-srt-mkv-mode.html
1635            media/track/in-band/track-in-band-srt-mkv-style.html
1636            media/track/in-band/track-in-band-srt-mkv-track-order.html
1637
1638         * CMakeLists.txt: Add InbandTextTrackPrivateGStreamer, InbandGenericTextTrack, InbandWebVTTTextTrack, and TextCombinerGStreamer files.
1639         * GNUmakefile.list.am: Same.
1640         * PlatformEfl.cmake: Same.
1641         * Target.pri: Same.
1642         * WebCore.vcxproj/WebCore.vcxproj: Same.
1643         * WebCore.vcxproj/WebCore.vcxproj.filters: Same.
1644         * WebCore.xcodeproj/project.pbxproj: Same.
1645         * html/track/InbandGenericTextTrack.cpp: Split out code for handling generic cues.
1646         (WebCore::GenericTextTrackCueMap::GenericTextTrackCueMap): Move from InbandTextTrack.
1647         (WebCore::GenericTextTrackCueMap::~GenericTextTrackCueMap): Same.
1648         (WebCore::GenericTextTrackCueMap::add): Same.
1649         (WebCore::GenericTextTrackCueMap::find): Same.
1650         (WebCore::GenericTextTrackCueMap::remove): Same.
1651         (WebCore::InbandGenericTextTrack::create): Same.
1652         (WebCore::InbandGenericTextTrack::updateCueFromCueData): Same.
1653         (WebCore::InbandGenericTextTrack::addGenericCue): Same.
1654         (WebCore::InbandGenericTextTrack::updateGenericCue): Same.
1655         (WebCore::InbandGenericTextTrack::removeGenericCue): Same.
1656         (WebCore::InbandGenericTextTrack::removeCue): Same.
1657         (WebCore::InbandGenericTextTrack::InbandGenericTextTrack): Empty.
1658         (WebCore::InbandGenericTextTrack::~InbandGenericTextTrack): Empty.
1659         * html/track/InbandGenericTextTrack.h: Copied from Source/WebCore/html/track/InbandTextTrack.h.
1660         The only addition is the ASSERT_NOT_REACHED() for WebVTT cues.
1661         * html/track/InbandTextTrack.cpp: Add label and language changed callbacks.
1662         (WebCore::InbandTextTrack::create): Return a generic or WebVTT text track based on the private CueFormat.
1663         (WebCore::InbandTextTrack::labelChanged): Added.
1664         (WebCore::InbandTextTrack::languageChanged): Added.
1665         * html/track/InbandTextTrack.h: Add label and language changed callbacks.
1666         * html/track/InbandWebVTTTextTrack.cpp: Added, based on InbandTextTrack.
1667         (WebCore::InbandWebVTTTextTrack::create): Same.
1668         (WebCore::InbandWebVTTTextTrack::InbandWebVTTTextTrack): Empty.
1669         (WebCore::InbandWebVTTTextTrack::~InbandWebVTTTextTrack): Empty.
1670         (WebCore::InbandWebVTTTextTrack::parseWebVTTCueData): Sends data to a WebVTTParser.
1671         (WebCore::InbandWebVTTTextTrack::newCuesParsed): Adds cues when WebVTTParser parses them.
1672         (WebCore::InbandWebVTTTextTrack::fileFailedToParse): Prints a warning when WebVTTParser has a problem.
1673         * html/track/InbandWebVTTTextTrack.h: Added.
1674         * platform/graphics/InbandTextTrackPrivate.h:
1675         (WebCore::InbandTextTrackPrivate::cueFormat): For determining if the track will have generic or WebVTT cues.
1676         (WebCore::InbandTextTrackPrivate::InbandTextTrackPrivate): Pass CueFormat in the constructor.
1677         * platform/graphics/InbandTextTrackPrivateClient.h: Same.
1678         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
1679         (WebCore::InbandTextTrackPrivateAVF::InbandTextTrackPrivateAVF): Pass CueFormat (Generic) to InbandTextTrackPrivate.
1680         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp: Add GRefPtr specializations for GstSample and GstEvent.
1681         * platform/graphics/gstreamer/GRefPtrGStreamer.h: Same.
1682         * platform/graphics/gstreamer/GStreamerUtilities.h: Add WARN_MEDIA_MESSAGE.
1683         * platform/graphics/gstreamer/GStreamerVersioning.h: Add a function to check GStreamer version at runtime.
1684         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp: Added.
1685         (WebCore::textTrackPrivateEventCallback): Watches for tag and stream start events.
1686         (WebCore::textTrackPrivateSampleTimeoutCallback): See notifyTrackOfSample();
1687         (WebCore::textTrackPrivateStreamTimeoutCallback): See notifyTrackOfStreamChanged();
1688         (WebCore::textTrackPrivateTagsChangeTimeoutCallback): See notifyTrackOfTagsChanged();
1689         (WebCore::InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer): Initializes tags and stream and sets up event callback.
1690         (WebCore::InbandTextTrackPrivateGStreamer::~InbandTextTrackPrivateGStreamer): Calls disconnect:
1691         (WebCore::InbandTextTrackPrivateGStreamer::disconnect): Removes signal handlers and frees some memory.
1692         (WebCore::InbandTextTrackPrivateGStreamer::handleSample): Adds samples to a list and sets up callback.
1693         (WebCore::InbandTextTrackPrivateGStreamer::streamChanged): Sets up callback.
1694         (WebCore::InbandTextTrackPrivateGStreamer::tagsChanged): Same.
1695         (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample): Parses all queued samples with WebVTTParser.
1696         (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfStreamChanged): Keeps track of current stream.
1697         (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfTagsChanged): Sets label and language from tags.
1698         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h: Added.
1699         (WebCore::InbandTextTrackPrivateGStreamer::create): Basic RefPtr create function.
1700         (WebCore::InbandTextTrackPrivateGStreamer::pad): Returns the pad this track is associated with (used
1701         to determine if a playbin text stream has already been associated with a text track).
1702         (WebCore::InbandTextTrackPrivateGStreamer::setIndex): Sets the track index (used for sorting).
1703         (WebCore::InbandTextTrackPrivateGStreamer::streamId): Returns the stream ID (used to handle new samples).
1704         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1705         (WebCore::mediaPlayerPrivateTextChangedCallback): Called for playbin "text-changed" event. See textChanged().
1706         (WebCore::mediaPlayerPrivateTextChangeTimeoutCallback): See notifyPlayerOfText().
1707         (WebCore::mediaPlayerPrivateNewTextSampleCallback): See newTextSample().
1708         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer): Initialize m_textTimerHandler.
1709         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): Disconnect text tracks (they don't necessarily
1710         get freed here, since a script could hold a reference).
1711         (WebCore::MediaPlayerPrivateGStreamer::textChanged): Setup callback for notifyPlayerOfText.
1712         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): Create text tracks.
1713         (WebCore::MediaPlayerPrivateGStreamer::newTextSample): Handle new samples by giving them to a text track
1714         with a matching stream. This method is syncryonous because we need to get the stream start sticky event
1715         immediately.
1716         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1717         * platform/graphics/gstreamer/TextCombinerGStreamer.cpp: Added. This element forwards buffers from all
1718         of its input pads, but also converts plain text to WebVTT as needed.
1719         (webkit_text_combiner_init): Setup internal funnel.
1720         (webkitTextCombinerPadEvent): If the caps are plain text make sure we have a webvttenv, otherwise connect
1721         directly to the funnel.
1722         (webkitTextCombinerRequestNewPad): Setup ghostpad and event callback.
1723         (webkitTextCombinerReleasePad): Release pad and optional associated webvttenc.
1724         (webkit_text_combiner_class_init): Setup pad templates and request/release pad functions.
1725         (webkitTextCombinerNew): Returns a new WebKitTextCombiner.
1726         * platform/graphics/gstreamer/TextCombinerGStreamer.h: Added.
1727         * platform/graphics/gstreamer/TextSinkGStreamer.cpp: Added.
1728         (webkit_text_sink_init): Set sync=false.
1729         (webkitTextSinkGetProperty): Ignore sync property.
1730         (webkitTextSinkSetProperty): Same.
1731         (webkitTextSinkQuery): Ignore position and duration queries, forward everything else to appsink.
1732         (webkit_text_sink_class_init): Setup property and query functions.
1733         (webkitTextSinkNew): Return a new WebKitTextSink.
1734         * platform/graphics/gstreamer/TextSinkGStreamer.h: Added.
1735
1736 2013-08-30  Dirk Schulze  <krit@webkit.org>
1737
1738         Animate CSS Image filter() function
1739         https://bugs.webkit.org/show_bug.cgi?id=119938
1740
1741         Reviewed by Simon Fraser.
1742
1743         With this patch, the new introduced CSS Image function filter() can be
1744         animated. According to the spec, just filter functions can be
1745         interpolated.
1746
1747         The patch also prepares StyleImage blending for interpolation of other
1748         generated images like gradients or cross-fade().
1749
1750         http://dev.w3.org/fxtf/filters/#interpolating-filter-image
1751
1752         Test: fast/filter-image/filter-image-animation.html
1753
1754         * css/CSSComputedStyleDeclaration.cpp: Reuse the code that creates a
1755             CSSValueList from ComputeStyle logic.
1756         (WebCore::valueForPixel):
1757             For StyleRules we want to have not-adjusted length values.
1758         (WebCore::ComputedStyleExtractor::valueForShadow):
1759             Add argument to switch between adjusted and not-adjusted length.
1760         (WebCore::ComputedStyleExtractor::valueForFilter):
1761             Ditto.
1762         (WebCore::ComputedStyleExtractor::propertyValue):
1763         * css/CSSComputedStyleDeclaration.h:
1764         * css/CSSFilterImageValue.h: Add helper functions
1765             for animating filters. We need to pass the FilterOperations for
1766             the image generation and the CSSValueList for StyleRule.
1767         (WebCore::CSSFilterImageValue::filterOperations):
1768         (WebCore::CSSFilterImageValue::setFilterOperations):
1769         (WebCore::CSSFilterImageValue::cachedImage):
1770         * page/animation/CSSPropertyAnimation.cpp:
1771             Add animation code to support animations between two filter()
1772             function values.
1773         (WebCore::blendFilterOperations):
1774         (WebCore::blendFunc):
1775         (WebCore::filterBlend):
1776         * rendering/style/StyleGeneratedImage.h: Add helper functions.
1777         (WebCore::CSSFilterImageValue::imageValue):
1778
1779
1780 2013-08-30  Leo Yang  <leoyang@blackberry.com>
1781
1782         Make sure remove CachedResourceClient when destructing IconLoader
1783         https://bugs.webkit.org/show_bug.cgi?id=120541
1784
1785         Reviewed by Darin Adler.
1786
1787         It's a good practice to call CachedResource::removeClient(client)
1788         when the client is being destructed. We need to do this for InconLoader
1789         to prevent m_resource from keeping dangling client in case m_resource
1790         is referenced by someone else in the future.
1791
1792         Found by code inspection. Just a defensive enhancement no new tests.
1793
1794         * loader/icon/IconLoader.cpp:
1795         (WebCore::IconLoader::~IconLoader):
1796
1797 2013-08-30  Hans Muller  <hmuller@adobe.com>
1798
1799         [CSS Shapes] Redefine the ShapeIntervals class as a template
1800         https://bugs.webkit.org/show_bug.cgi?id=120381
1801
1802         Reviewed by Alexandru Chiculita.
1803
1804         No new tests, this was just an internal refactoring.
1805
1806         The existing ShapeIntervals class has been converted into a template whose
1807         type specifies the type of the interval's x1 and x2 horizontal endpoints
1808         (formerly float). There were several other minor changes, all in the realm
1809         of refactoring:
1810
1811         - The original type was a struct with public x1 and x2 fields. It's now a class
1812         with x1 and x2 accessors. ASSERTS are now used to maintain the x2 >= x1 invariant.
1813         In the original code the invariant was not checked.
1814
1815         - The logical comparison operators have been overloaded for ShapeInterval.
1816         This obviates the IntervalX1Comparator class which has been removed.
1817
1818         - The names of the global ShapeInterval Vector set operation methods have been
1819         changed to reflect the fact that they're now members of the template class,
1820         rather than globals.
1821
1822         PolygonShape.cpp depended on the ShapeInterval class. In the one or two places
1823         where an interval's x1 or x1 fields had been set explicitly, ShapeInterval::set()
1824         is now used to set both fields. This also enables the invariant check mentioned
1825         earlier. The other changes to this class are syntatic, to account for the ShapeInterval
1826         class's changes.
1827
1828         * CMakeLists.txt:
1829         * GNUmakefile.list.am:
1830         * WebCore.vcxproj/WebCore.vcxproj:
1831         * WebCore.xcodeproj/project.pbxproj:
1832         * rendering/shapes/PolygonShape.cpp:
1833         (WebCore::appendIntervalX):
1834         (WebCore::computeXIntersections):
1835         (WebCore::computeOverlappingEdgeXProjections):
1836         (WebCore::PolygonShape::getExcludedIntervals):
1837         (WebCore::PolygonShape::getIncludedIntervals):
1838         * rendering/shapes/PolygonShape.h:
1839         * rendering/shapes/ShapeInterval.cpp: Removed.
1840         * rendering/shapes/ShapeInterval.h: The entire implementation is now here. 
1841         (WebCore::ShapeInterval::ShapeInterval):
1842         (WebCore::ShapeInterval::x1):
1843         (WebCore::ShapeInterval::x2):
1844         (WebCore::ShapeInterval::set):
1845         (WebCore::ShapeInterval::overlaps):
1846         (WebCore::ShapeInterval::intersect):
1847         (WebCore::ShapeInterval::sortVector):
1848         (WebCore::ShapeInterval::uniteVectors):
1849         (WebCore::ShapeInterval::intersectVectors):
1850         (WebCore::ShapeInterval::subtractVectors):
1851         (WebCore::operator==):
1852         (WebCore::operator!=):
1853         (WebCore::operator< ):
1854         (WebCore::operator> ):
1855         (WebCore::operator<=):
1856         (WebCore::operator>=):
1857
1858 2013-08-30  Antti Koivisto  <antti@apple.com>
1859
1860         Use Element& in StyleResolveTree
1861         https://bugs.webkit.org/show_bug.cgi?id=120540
1862
1863         Reviewed by Andreas Kling.
1864
1865         * dom/ContainerNode.cpp:
1866         (WebCore::attachChild):
1867         (WebCore::detachChild):
1868         * dom/Document.cpp:
1869         (WebCore::Document::recalcStyle):
1870         (WebCore::Document::createRenderTree):
1871         (WebCore::Document::detach):
1872         * dom/Element.cpp:
1873         (WebCore::Element::lazyReattach):
1874         (WebCore::Element::updateExistingPseudoElement):
1875         (WebCore::Element::createPseudoElementIfNeeded):
1876         (WebCore::disconnectPseudoElement):
1877         * dom/ShadowRoot.cpp:
1878         (WebCore::ShadowRoot::setResetStyleInheritance):
1879         * html/HTMLDetailsElement.cpp:
1880         (WebCore::HTMLDetailsElement::parseAttribute):
1881         * html/HTMLInputElement.cpp:
1882         (WebCore::HTMLInputElement::updateType):
1883         (WebCore::HTMLInputElement::parseAttribute):
1884         * html/HTMLObjectElement.cpp:
1885         (WebCore::HTMLObjectElement::renderFallbackContent):
1886         * html/HTMLPlugInImageElement.cpp:
1887         (WebCore::HTMLPlugInImageElement::willRecalcStyle):
1888         (WebCore::HTMLPlugInImageElement::documentWillSuspendForPageCache):
1889         (WebCore::HTMLPlugInImageElement::documentDidResumeFromPageCache):
1890         (WebCore::HTMLPlugInImageElement::restartSnapshottedPlugIn):
1891         * html/HTMLSelectElement.cpp:
1892         (WebCore::HTMLSelectElement::parseAttribute):
1893         (WebCore::HTMLSelectElement::parseMultipleAttribute):
1894         * html/HTMLViewSourceDocument.cpp:
1895         (WebCore::HTMLViewSourceDocument::createContainingTable):
1896         (WebCore::HTMLViewSourceDocument::addSpanWithClassName):
1897         (WebCore::HTMLViewSourceDocument::addLine):
1898         (WebCore::HTMLViewSourceDocument::finishLine):
1899         (WebCore::HTMLViewSourceDocument::addBase):
1900         (WebCore::HTMLViewSourceDocument::addLink):
1901         * html/parser/HTMLConstructionSite.cpp:
1902         (WebCore::executeTask):
1903         * html/parser/HTMLTreeBuilder.cpp:
1904         (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
1905         * html/shadow/InsertionPoint.cpp:
1906         (WebCore::InsertionPoint::willAttachRenderers):
1907         (WebCore::InsertionPoint::willDetachRenderers):
1908         * loader/PlaceholderDocument.cpp:
1909         (WebCore::PlaceholderDocument::createRenderTree):
1910         * style/StyleResolveTree.cpp:
1911         (WebCore::Style::attachChildren):
1912         (WebCore::Style::attachRenderTree):
1913         (WebCore::Style::detachChildren):
1914         (WebCore::Style::detachRenderTree):
1915         (WebCore::Style::resolveLocal):
1916         (WebCore::Style::updateTextStyle):
1917         (WebCore::Style::resolveShadowTree):
1918         (WebCore::Style::resolveTree):
1919         
1920             Documents only ever have one child element. Remove the loop.
1921
1922         (WebCore::Style::detachRenderTreeInReattachMode):
1923         (WebCore::Style::reattachRenderTree):
1924         * style/StyleResolveTree.h:
1925         * svg/SVGTests.cpp:
1926         (WebCore::SVGTests::handleAttributeChange):
1927         * xml/XMLErrors.cpp:
1928         (WebCore::XMLErrors::insertErrorMessageBlock):
1929         * xml/parser/XMLDocumentParserLibxml2.cpp:
1930         (WebCore::XMLDocumentParser::startElementNs):
1931
1932 2013-08-30  Andreas Kling  <akling@apple.com>
1933
1934         Document style resolve should take Document&.
1935         <https://webkit.org/b/120534>
1936
1937         Reviewed by Darin Adler.
1938
1939         Tweak Style::resolveTree(Document*) and Style::resolveForDocument(Document*) to take Document& instead.
1940
1941         * dom/Document.cpp:
1942         (WebCore::Document::recalcStyle):
1943         * html/HTMLLinkElement.cpp:
1944         (WebCore::HTMLLinkElement::process):
1945         * style/StyleResolveForDocument.cpp:
1946         (WebCore::Style::resolveForDocument):
1947         * style/StyleResolveForDocument.h:
1948         * style/StyleResolveTree.cpp:
1949         (WebCore::Style::resolveTree):
1950         * style/StyleResolveTree.h:
1951
1952 2013-08-30  Darin Adler  <darin@apple.com>
1953
1954         [Mac] No need for Pasteboard::getDataSelection
1955         https://bugs.webkit.org/show_bug.cgi?id=120536
1956
1957         Reviewed by Anders Carlsson.
1958
1959         * editing/Editor.h: Added some Mac-only private member functions.
1960
1961         * editing/mac/EditorMac.mm:
1962         (WebCore::Editor::selectionInWebArchiveFormat): Added.
1963         (WebCore::Editor::adjustedSelectionRange): Added.
1964         (WebCore::attributedStringForRange): Added.
1965         (WebCore::dataInRTFDFormat): Added.
1966         (WebCore::dataInRTFFormat): Added.
1967         (WebCore::Editor::dataSelectionForPasteboard): Moved the implementation
1968         of Pasteboard::getDataSelection here, refactoring to share code with the
1969         writeSelectionToPasteboard function.
1970         (WebCore::Editor::writeSelectionToPasteboard): Refactored to share code
1971         with the new function above.
1972
1973         * platform/Pasteboard.h: Removed getDataSelection. One less layering violation.
1974         * platform/mac/PasteboardMac.mm: Ditto.
1975
1976 2013-08-30  Rob Buis  <rwlbuis@webkit.org>
1977
1978         SVG error parsing empty path
1979         https://bugs.webkit.org/show_bug.cgi?id=78980
1980
1981         Reviewed by Darin Adler.
1982
1983         According to the spec (http://www.w3.org/TR/SVG/paths.html#PathData), path 'd' attribute can be empty.
1984         No error should be reported in this case.
1985
1986         * svg/SVGPathParser.cpp:
1987         (WebCore::SVGPathParser::parsePathDataFromSource):
1988         * svg/SVGPathUtilities.cpp:
1989         (WebCore::buildPathFromString):
1990         (WebCore::buildSVGPathByteStreamFromSVGPathSegList):
1991         (WebCore::buildPathFromByteStream):
1992         (WebCore::buildSVGPathSegListFromByteStream):
1993         (WebCore::buildStringFromByteStream):
1994         (WebCore::buildStringFromSVGPathSegList):
1995         (WebCore::buildSVGPathByteStreamFromString):
1996         (WebCore::buildAnimatedSVGPathByteStream):
1997         (WebCore::addToSVGPathByteStream):
1998
1999 2013-08-30  Andreas Kling  <akling@apple.com>
2000
2001         Try to fix CSS_VARIABLES and CSS_DEVICE_ADAPTATION builds.
2002
2003         * css/StyleResolver.cpp:
2004         (WebCore::StyleResolver::StyleResolver):
2005         (WebCore::StyleResolver::resolveVariables):
2006
2007 2013-08-30  Commit Queue  <commit-queue@webkit.org>
2008
2009         Unreviewed, rolling out r154891.
2010         http://trac.webkit.org/changeset/154891
2011         https://bugs.webkit.org/show_bug.cgi?id=120539
2012
2013         broke the mac build (Requested by Ossy on #webkit).
2014
2015         * platform/network/SynchronousLoaderClient.h:
2016
2017 2013-08-30  Csaba Osztrogonác  <ossy@webkit.org>
2018
2019         Add USE(CFNETWORK) guard to SynchronousLoaderClient::didReceiveAuthenticationChallengedidReceiveAuthenticationChallenge()
2020         https://bugs.webkit.org/show_bug.cgi?id=120532
2021
2022         Reviewed by Darin Adler.
2023
2024         * platform/network/SynchronousLoaderClient.h:
2025
2026 2013-08-30  Brent Fulgham  <bfulgham@apple.com>
2027
2028         [Windows] Video inside page always uses non-hardware accelerated playback
2029         https://bugs.webkit.org/show_bug.cgi?id=120448
2030
2031         Reviewed by Eric Carlson.
2032
2033         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2034         (WebCore::MediaPlayerPrivateAVFoundationCF::createAVPlayer): Check for
2035         D3D device. If it doesn't exist, switch to compositing mode and try again.
2036
2037 2013-08-30  Leo Yang  <leoyang@blackberry.com>
2038
2039         Possible dangling CachedResourceClient of StyleRuleImport and XSLImportRule
2040         https://bugs.webkit.org/show_bug.cgi?id=120479
2041
2042         Reviewed by Darin Adler.
2043
2044         In StyleRuleImport::requestStyleSheet() and XSLImportRule::loadSheet() we
2045         didn't call removeClient() for m_cachedSheet before assigning m_cachedSheet
2046         a new value. This could leave the client as a client of the old cached
2047         sheet and dangling after the client is deleted. Fix them by calling removeClient()
2048         before assigning m_cacheSheet a new value.
2049
2050         Found by code inspection. Seems no way to test it automatically.
2051
2052         * css/StyleRuleImport.cpp:
2053         (WebCore::StyleRuleImport::requestStyleSheet):
2054         * xml/XSLImportRule.cpp:
2055         (WebCore::XSLImportRule::loadSheet):
2056
2057 2013-08-30  Gabor Abraham  <abrhm@inf.u-szeged.hu>
2058
2059         Fix unused parameter warning in graphics/cairo/GraphicsContextCairo.cpp file.
2060         https://bugs.webkit.org/show_bug.cgi?id=120524
2061
2062         Reviewed by Darin Adler.
2063
2064         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2065         (WebCore::GraphicsContext::fillRectWithRoundedHole):
2066
2067 2013-08-30  Andreas Kling  <akling@apple.com>
2068
2069         StyleResolver & friends should use Document&.
2070         <https://webkit.org/b/120527>
2071
2072         Reviewed by Antti Koivisto.
2073
2074         Document&-ify StyleResolver, ElementRuleCollector and SelectorChecker.
2075
2076 2013-08-30  Brent Fulgham  <bfulgham@apple.com>
2077
2078         [Windows] Unreviewed build correction after r154835. Only seen when doing a
2079         full (clean) rebuild.
2080
2081         * DerivedSources.cpp: Remove reference to deleted JSHTMLDialogElement.cpp
2082
2083 2013-08-30  Tamas Czene  <tczene@inf.u-szeged.hu>
2084
2085         Resolve unused parameter warning in FindController.cpp
2086         https://bugs.webkit.org/show_bug.cgi?id=120407
2087
2088         Reviewed by Darin Adler.
2089
2090         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
2091         (wordAtPositionForAtkBoundary):
2092
2093 2013-08-30  Arpita Bahuguna  <a.bah@samsung.com>
2094
2095         setAttributeNode() does not set the new value to an existing attribute if specified attribute is in a different case.
2096         https://bugs.webkit.org/show_bug.cgi?id=120293
2097
2098         Reviewed by Darin Adler.
2099
2100         setAttributeNode() performs a case-insensitive search for an existing
2101         attribute. If an existing attribute is found, it retrieves the index of
2102         such an attribute. For setting the attribute's new value, we call upon
2103         setAttributeInternal() to which both the index as well as the name of
2104         the attribute is passed.
2105         The name passed to this method is the same as the one passed to the
2106         setAttributeNode() API from the webpage and thus can be in any case.
2107
2108         However, setAttributeInternal() uses this name to get the corresponding
2109         existing attribute node. Since this retrieval is not case-insensitive,
2110         the existing node is not returned and thus the new value is not set on
2111         the existing node.
2112         We should instead use the passed index and use that to retrieve the
2113         existing node.
2114
2115         Note that obtaining the attribute's value using getAttributeNode() would
2116         still return the correct value, i.e. the new one.
2117
2118         Also, this change shall make our behavior similar to that of FF and IE.
2119
2120         Test: fast/dom/Element/setAttributeNode-for-existing-attribute.html
2121
2122         * dom/Element.cpp:
2123         (WebCore::Element::setAttributeInternal):
2124         If the passed index is not equal to attributeNotFound, we use that index
2125         to retrieve the existing attribute.
2126
2127 2013-08-30  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
2128
2129         SimpleClassVectorTraits shall be used for RuleData
2130         https://bugs.webkit.org/show_bug.cgi?id=120526
2131
2132         Reviewed by Andreas Kling.
2133
2134         Whereas RuleData is POD type and whereas there are quite a lot of Vector<RuleData> occurrences in the code,
2135         it makes sense to use SimpleClassVectorTraits for RuleData and hence to allow using more efficient mem functions
2136         in vectors.
2137
2138         * css/RuleSet.h:
2139
2140 2013-08-30  Andreas Kling  <akling@apple.com>
2141
2142         Node::document() should return a reference.
2143         <https://webkit.org/b/120496>
2144
2145         Reviewed by Antti Koivisto.
2146
2147         Now that orphan DocumentType nodes also have document pointers, it's no longer
2148         possible to have a null Node::document().
2149
2150         Cement this by making document() return a reference, and remove the various
2151         null checks exposed by this.
2152
2153 2013-08-30  Andrei Parvu  <parvu@adobe.com>
2154
2155         [CSS Masking] -webkit-mask-repeat: space does not work
2156         Added the space option to background-repeat and -webkit-mask-repeat.
2157         With the property value 'space', the background or mask image gets repeated as often as it fits within the background positioning
2158         area. The repeated images are spaced equally to fill the unused area.
2159         https://bugs.webkit.org/show_bug.cgi?id=119324
2160
2161         Reviewed by Dirk Schulze.
2162
2163         Tests: css3/background/background-repeat-space-border.html
2164                css3/background/background-repeat-space-content.html
2165                css3/background/background-repeat-space-padding.html
2166                css3/masking/mask-repeat-space-border.html
2167                css3/masking/mask-repeat-space-content.html
2168                css3/masking/mask-repeat-space-padding.html
2169
2170         * platform/graphics/GeneratorGeneratedImage.cpp:
2171         (WebCore::GeneratorGeneratedImage::drawPattern): Passed the space values to the image buffer.
2172         * platform/graphics/Image.cpp:
2173         (WebCore::Image::drawTiled): Added the space values when computing the location of the tile.
2174         * platform/graphics/Image.h: Added the space property.
2175         (WebCore::Image::spaceSize):
2176         (WebCore::Image::setSpaceSize):
2177         * platform/graphics/ImageBuffer.h: Added the space property.
2178         (WebCore::ImageBuffer::spaceSize):
2179         (WebCore::ImageBuffer::setSpaceSize):
2180         * platform/graphics/cg/ImageBufferCG.cpp: Passed the space values when copying an image.
2181         (WebCore::ImageBuffer::copyImage):
2182         * platform/graphics/cg/ImageCG.cpp: Added the space values when creating a platform pattern.
2183         (WebCore::Image::drawPattern):
2184         * rendering/RenderBoxModelObject.cpp:
2185         (WebCore::RenderBoxModelObject::paintFillLayerExtended): Computed the space values on x and y axis.
2186         (WebCore::getSpace):
2187         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry): Pass the space values to the Image class.
2188         * rendering/RenderBoxModelObject.h: Added the space property.
2189         (WebCore::RenderBoxModelObject::BackgroundImageGeometry::spaceSize):
2190         (WebCore::RenderBoxModelObject::BackgroundImageGeometry::setSpaceSize):
2191         * svg/graphics/SVGImage.cpp: Passed the space property to the created image.
2192         (WebCore::SVGImage::drawPatternForContainer):
2193         * svg/graphics/SVGImageForContainer.cpp: Passed the space property to the image property.
2194         (WebCore::SVGImageForContainer::drawPattern):
2195
2196 2013-08-30  Antti Koivisto  <antti@apple.com>
2197
2198         Remove AttachContext
2199         https://bugs.webkit.org/show_bug.cgi?id=120518
2200
2201         Reviewed by Andreas Kling.
2202
2203         This type is not useful anymore. Just pass the precomputed style to attachRenderTree and reattach-or-not flag to detachRenderTree.
2204
2205         * style/StyleResolveTree.cpp:
2206         (WebCore::Style::createRendererIfNeeded):
2207         (WebCore::Style::attachChildren):
2208         (WebCore::Style::attachShadowRoot):
2209         (WebCore::Style::attachRenderTree):
2210         (WebCore::Style::detachChildren):
2211         (WebCore::Style::detachShadowRoot):
2212         (WebCore::Style::detachRenderTree):
2213         (WebCore::Style::reattachRenderTree):
2214         (WebCore::Style::resolveLocal):
2215         * style/StyleResolveTree.h:
2216
2217 2013-08-30  Commit Queue  <commit-queue@webkit.org>
2218
2219         Unreviewed, rolling out r154826.
2220         http://trac.webkit.org/changeset/154826
2221         https://bugs.webkit.org/show_bug.cgi?id=120517
2222
2223         Still breaks icloud.com (Requested by mwenge_ on #webkit).
2224
2225         * rendering/RenderBox.cpp:
2226         (WebCore::RenderBox::computePositionedLogicalWidth):
2227         (WebCore::RenderBox::computePositionedLogicalHeight):
2228         * rendering/RenderBox.h:
2229         (WebCore::RenderBox::intrinsicSize):
2230         * rendering/RenderButton.h:
2231         * rendering/RenderFileUploadControl.cpp:
2232         (WebCore::RenderFileUploadControl::computePreferredLogicalWidths):
2233         * rendering/RenderListBox.cpp:
2234         (WebCore::RenderListBox::RenderListBox):
2235         (WebCore::RenderListBox::computePreferredLogicalWidths):
2236         (WebCore::RenderListBox::computeLogicalHeight):
2237         * rendering/RenderListBox.h:
2238         * rendering/RenderMenuList.h:
2239         * rendering/RenderSlider.cpp:
2240         (WebCore::RenderSlider::computePreferredLogicalWidths):
2241         * rendering/RenderTextControl.cpp:
2242         (WebCore::RenderTextControl::RenderTextControl):
2243         (WebCore::RenderTextControl::computeLogicalHeight):
2244         * rendering/RenderTextControl.h:
2245
2246 2013-08-29  Ryosuke Niwa  <rniwa@webkit.org>
2247
2248         Unduplicate the code to convert between VisiblePosition and index
2249         https://bugs.webkit.org/show_bug.cgi?id=120506
2250
2251         Reviewed by Darin Adler.
2252
2253         Encapsulate the conversion between VisiblePosition and index into indexForVisiblePosition
2254         and visiblePositionForIndexUsingCharacterIterator. It's unfortunate that these two functions
2255         are different from the two other existing functions of similar names but we've at least
2256         confined problems into a single cpp file now.
2257
2258         * accessibility/AccessibilityRenderObject.cpp:
2259         (WebCore::AccessibilityRenderObject::visiblePositionForIndex):
2260         (WebCore::AccessibilityRenderObject::indexForVisiblePosition):
2261         * editing/Editor.cpp:
2262         (WebCore::findFirstMarkable):
2263         * editing/htmlediting.cpp:
2264         (WebCore::indexForVisiblePosition):
2265         (WebCore::visiblePositionForIndexUsingCharacterIterator):
2266         * editing/htmlediting.h:
2267         * html/HTMLTextFormControlElement.cpp:
2268         (WebCore::hasVisibleTextArea):
2269         (WebCore::HTMLTextFormControlElement::setSelectionRange):
2270         (WebCore::HTMLTextFormControlElement::indexForVisiblePosition):
2271         (WebCore::HTMLTextFormControlElement::visiblePositionForIndex):
2272         * html/HTMLTextFormControlElement.h:
2273         * rendering/RenderTextControl.cpp:
2274         * rendering/RenderTextControl.h:
2275
2276 2013-08-29  Ryosuke Niwa  <rniwa@webkit.org>
2277
2278         Avoid Node references from AXObjectCache from leaking
2279         https://bugs.webkit.org/show_bug.cgi?id=120501
2280
2281         Reviewed by Darin Adler.
2282
2283         Merge https://chromium.googlesource.com/chromium/blink/+/454f31497613b6d0fbcfb0df757254b64a177c06
2284         without any tests since we don't have the same infrastructure to detect leaks in WebKit.
2285
2286         A real world example of this would be selecting an <option> item inside frame by keyboard. The node will not be deref()-ed until the topDocument() is detached. 
2287
2288         The issue was that AccessibilityMenuListOption is created in childrenChanged()
2289         hook called when its RenderObject is being destroyed. This patch modifies AccessibilityMenuListPopup so it won't create AccessibilityMenuListOption if its
2290         element is already detached.
2291
2292         * accessibility/AccessibilityMenuListPopup.cpp:
2293         (WebCore::AccessibilityMenuListPopup::menuListOptionAccessibilityObject):
2294         * rendering/RenderMenuList.cpp:
2295         (WebCore::RenderMenuList::didUpdateActiveOption):
2296
2297 2013-08-26  Simon Fraser  <simon.fraser@apple.com>
2298
2299         Implement object-fit CSS property
2300         https://bugs.webkit.org/show_bug.cgi?id=52040
2301
2302         Reviewed by Antti Koivisto, Sam Weinig.
2303         
2304         Merge object-fit patch from Blink r156535, which started as a patch
2305         by me.
2306
2307         Since then, the spec has gone to CR. This patch is an
2308         implementation of object-fit as described in
2309         http://www.w3.org/TR/2012/CR-css3-images-20120417/#object-fit
2310
2311         Object-fit is used to maintain the aspect ratio of replaced content
2312         within its content box. All object-fit values but the initial one
2313         ('fill') will always ensure that the aspect ratio is retained, in
2314         different ways (fit inside the content box, cover the content box, or
2315         use intrinsic size). Painting is always clipped against the content
2316         box, regardless of the 'overflow' property.
2317
2318         Tests: fast/css/object-fit/object-fit-canvas.html
2319                fast/css/object-fit/object-fit-embed.html
2320                fast/css/object-fit/object-fit-grow-landscape.html
2321                fast/css/object-fit/object-fit-grow-portrait.html
2322                fast/css/object-fit/object-fit-img-svg.html
2323                fast/css/object-fit/object-fit-img-svg2.html
2324                fast/css/object-fit/object-fit-img.html
2325                fast/css/object-fit/object-fit-input-image.html
2326                fast/css/object-fit/object-fit-object.html
2327                fast/css/object-fit/object-fit-shrink.html
2328                fast/css/object-fit/object-fit-video-poster.html
2329                fast/css/parsing-object-fit.html
2330                http/tests/css/object-fit-delayed-img-svg.html
2331                media/video-object-fit-change.html
2332                media/video-object-fit.html
2333
2334         * css/CSSComputedStyleDeclaration.cpp:
2335         (WebCore::ComputedStyleExtractor::propertyValue):
2336         * css/CSSParser.cpp:
2337         (WebCore::isValidKeywordPropertyAndValue):
2338         (WebCore::isKeywordPropertyID):
2339         (WebCore::CSSParser::parseValue):
2340         * css/CSSPrimitiveValueMappings.h:
2341         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2342         (WebCore::CSSPrimitiveValue::operator EObjectFit):
2343         * css/CSSProperty.cpp:
2344         (WebCore::CSSProperty::isInheritedProperty):
2345         * css/CSSPropertyNames.in:
2346         * css/CSSValueKeywords.in:
2347         * css/DeprecatedStyleBuilder.cpp:
2348         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
2349         * css/StyleResolver.cpp:
2350         (WebCore::StyleResolver::applyProperty):
2351         * css/html.css:
2352         (video): Set object-fit to 'contain'. This is how VIDEO elements
2353         work, apparently.
2354         * loader/cache/CachedImage.cpp:
2355         (WebCore::CachedImage::imageSizeForRenderer):
2356         * loader/cache/CachedImage.h:
2357         * platform/graphics/LayoutSize.h:
2358         (WebCore::fitLayoutSizeToAspectRatio): New function to grow or shrink
2359         in one dimension to fit to the aspect ratio.
2360         * rendering/RenderHTMLCanvas.cpp:
2361         (WebCore::RenderHTMLCanvas::paintReplaced): Apply object-fit and
2362         clip if necessary.
2363         * rendering/RenderImage.cpp:
2364         (WebCore::RenderImage::updateInnerContentRect):
2365         (WebCore::RenderImage::imageDimensionsChanged): Update intrinsic
2366         size properly, and recalculate the inner content rectangle (the
2367         exact area occupied by the replaced content) again if appropriate.
2368         (WebCore::RenderImage::paintReplaced): Apply object-fit and clip
2369         if necessary.
2370         (WebCore::RenderImage::foregroundIsKnownToBeOpaqueInRect):
2371         object-fit may leave parts of the content box empty, in which case
2372         it won't be fully obscured.
2373         (WebCore::RenderImage::layout):
2374         * rendering/RenderImage.h:
2375         * rendering/RenderImageResource.cpp:
2376         (WebCore::RenderImageResource::intrinsicSize): Need this to
2377         differentiate between intrinsic and extrinsic size for SVG images.
2378         * rendering/RenderImageResource.h:
2379         * rendering/RenderImageResourceStyleImage.h:
2380         * rendering/RenderReplaced.cpp:
2381         (WebCore::RenderReplaced::replacedContentRect): Return the
2382         rectangle occupied by the replaced content. This will be identical
2383         to the content box if object-fit is 'fill', but will typically be
2384         something else for other values.
2385         * rendering/RenderReplaced.h:
2386         * rendering/RenderVideo.cpp:
2387         (WebCore::RenderVideo::videoBox): Not much left to do here, with
2388         the new RenderReplaced::replacedContentRect() method in place.
2389         (WebCore::RenderVideo::paintReplaced): Apply object-fit and clip
2390         if necessary.
2391         * rendering/style/RenderStyle.cpp:
2392         (WebCore::RenderStyle::changeRequiresRepaint):
2393         * rendering/style/RenderStyle.h:
2394         * rendering/style/RenderStyleConstants.h:
2395         * rendering/style/StyleRareNonInheritedData.cpp:
2396         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2397         (WebCore::StyleRareNonInheritedData::operator==):
2398         * rendering/style/StyleRareNonInheritedData.h:
2399
2400 2013-08-29  Tim Horton  <timothy_horton@apple.com>
2401
2402         SVG clipping, masking, and gradients-on-text do not respect the device scale factor
2403         https://bugs.webkit.org/show_bug.cgi?id=120377
2404         <rdar://problem/14777944>
2405
2406         Reviewed by Simon Fraser.
2407
2408         Tests: svg/custom/masking-clipping-hidpi.svg
2409
2410         calculateTransformationToOutermostCoordinateSystem should include the page's
2411         device scale factor in its transform.
2412
2413         * rendering/svg/SVGRenderingContext.cpp:
2414         (WebCore::SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem):
2415
2416 2013-08-29  Chris Fleizach  <cfleizach@apple.com>
2417
2418         AX: Crash when VoiceOver reference a TextMarker from an iframe that has been removed
2419         https://bugs.webkit.org/show_bug.cgi?id=120318
2420
2421         Reviewed by Darin Adler.
2422
2423         These crashes occur because an AXTextMarker is retrieved that reference a Node in an iframe.
2424         The iframe goes away, but when it tries to clean up and remove that Node from the InUse cache,
2425         the document() tree has already been detached, so it never clears the actual InUse cache.
2426
2427         The fix here is to pre-emptively clean up any nodes in the document going away when the frame is about to disconnect.
2428
2429         I'm removing the clearAXObjectCache() at the disconnectOwnerElement because it 
2430            1) Cleared the AXObjectCache for the iframe document (which is always empty -- only the top level doc maintains the cache), because
2431                 the document() tree had already been detached... so it essentially did nothing.
2432            2) And if it did work, we wouldn't want this behavior -- that is to say, when an iframe goes away, we don't want to clear the entire cache for all
2433                the other documents (there's even an existing layout test to verify this behavior).
2434
2435         Test: platform/mac/accessibility/stale-textmarker-crash.html
2436
2437         * accessibility/AXObjectCache.cpp:
2438         (WebCore::AXObjectCache::clearTextMarkerNodesInUse):
2439         * accessibility/AXObjectCache.h:
2440         * page/Frame.cpp:
2441         (WebCore::Frame::disconnectOwnerElement):
2442
2443 2013-08-29  Brent Fulgham  <bfulgham@apple.com>
2444
2445         [Windows] More unreviewed gardening of project file.
2446         Move css files inline with related source code.
2447
2448         * WebCore.vcxproj/WebCore.vcxproj:
2449         * WebCore.vcxproj/WebCore.vcxproj.filters:
2450
2451 2013-08-29  Sam Weinig  <sam@webkit.org>
2452
2453         Add ENABLE guards for Promises
2454         https://bugs.webkit.org/show_bug.cgi?id=120488
2455
2456         Reviewed by Andreas Kling.
2457
2458         * Configurations/FeatureDefines.xcconfig:
2459
2460 2013-08-29  Andreas Kling  <akling@apple.com>
2461
2462         Inspector: Use a bit of RefPtr::release() in generated code.
2463         <https://webkit.org/b/120485>
2464
2465         Reviewed by Darin Adler.
2466
2467         Just something I spotted while reading InspectorBackendDispatcher.cpp.
2468         Avoid 3 cases of reference count churnery.
2469
2470         * inspector/CodeGeneratorInspectorStrings.py:
2471
2472 2013-08-29  Christophe Dumez  <ch.dumez@sisa.samsung.com>
2473
2474         According to DOM4, all DocType nodes should have a document
2475         https://bugs.webkit.org/show_bug.cgi?id=99244
2476
2477         Reviewed by Darin Adler.
2478
2479         Doctypes now always have a node document and can be moved across document boundaries as per
2480         the latest DOM4 specification:
2481         http://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype
2482         http://dom.spec.whatwg.org/#dom-node-ownerdocument
2483
2484         This means that DOMImplementation.createDocumentType() now sets the ownerDocument of the
2485         new DocumentType Node to the associated document of the current "context" object. In
2486         DOM4, all nodes have a document at all times. DocumentType nodes can now be moved across
2487         document boundaries so that the node can be added to a Document after being created.
2488
2489         This means we will no longer need to special case DocumentType nodes in the code and
2490         Node::document() can no longer return NULL, which means that we'll be able to remove
2491         NULL checks in call sites.
2492
2493         Firefox stable and since recently Blink already follow DOM4 here while IE10 does not (yet).
2494
2495         Test: fast/dom/createDocumentType-ownerDocument.html
2496
2497         * dom/ContainerNode.cpp:
2498         (WebCore::checkAcceptChild):
2499         * dom/DOMImplementation.cpp:
2500         (WebCore::DOMImplementation::createDocumentType):
2501         (WebCore::DOMImplementation::createDocument):
2502         * dom/Node.h:
2503         (WebCore::Node::document):
2504
2505 2013-08-29  Darin Adler  <darin@apple.com>
2506
2507         Pasteboard::writeSelection violates layering (first step, fixes it for Mac platform only)
2508         https://bugs.webkit.org/show_bug.cgi?id=120483
2509
2510         Reviewed by Anders Carlsson.
2511
2512         * editing/Editor.cpp:
2513         (WebCore::Editor::cut): Added some comments. Use the new writeSelectionToPasteboard
2514         function on Mac instead of Pasteboard::writeSelection.
2515         (WebCore::Editor::copy): Ditto.
2516
2517         * editing/Editor.h: Removed an old unused Mac-only writeSelectionToPasteboard function
2518         that was a cover that called through to Pasteboard::writeSelectionForTypes. Added a new
2519         Mac-only writeSelectionToPasteboard function that is destined to become cross-platform soon.
2520
2521         * editing/mac/EditorMac.mm:
2522         (WebCore::Editor::writeSelectionToPasteboard): Added. Uses a new pattern where the Editor
2523         puts all the data into a structure called PasteboardWebContent then calls the Pasteboard to
2524         do the work. The platform-specific aspect of PasteboardWebContent is what formats are needed
2525         for each platform.
2526
2527         * page/DragController.cpp:
2528         (WebCore::DragController::startDrag): Added some comments. Use the new writeSelectionToPasteboard
2529         function on Mac instead of Pasteboard::writeSelection.
2530
2531         * platform/Pasteboard.h: Remove some unneeded forward declarations. Added comments for all functions
2532         that don't belong in this class because they are layering violations; this becomes the to do list for
2533         the project we are beginning here. Added the new PasteboardWebContent structure, empty on all platforms
2534         except for Mac for now. Removed writeSelectionForTypes, a Mac-only function that is no longer used.
2535         Added setTypes and writeAfterSettingTypes, the two halves of the future function named writeWebContent.
2536         Put the writeSelection function inside a "not Mac" if statement. Later to be deleted entirely.
2537
2538         * platform/mac/PasteboardMac.mm: Removed now-unneeded selectionPasteboardTypes,
2539         Pasteboard::writeSelectionForTypes, and writeSelection functions.
2540         (WebCore::Pasteboard::setTypes): Added. First half of writing web content to the pasteboard.
2541         (WebCore::Pasteboard::writeAfterSettingTypes): Added. Second half of writing web content to the pasteboard.
2542
2543 2013-08-29  Antti Koivisto  <antti@apple.com>
2544
2545         Remove code behind ENABLE(DIALOG_ELEMENT)
2546         https://bugs.webkit.org/show_bug.cgi?id=120467
2547
2548         Reviewed by Darin Adler.
2549
2550         It is incomplete and no one is building it.
2551
2552         * CMakeLists.txt:
2553         * Configurations/FeatureDefines.xcconfig:
2554         * DerivedSources.make:
2555         * DerivedSources.pri:
2556         * GNUmakefile.list.am:
2557         * Target.pri:
2558         * WebCore.exp.in:
2559         * WebCore.xcodeproj/project.pbxproj:
2560         * bindings/generic/RuntimeEnabledFeatures.cpp:
2561         * bindings/generic/RuntimeEnabledFeatures.h:
2562         * css/StyleResolver.cpp:
2563         (WebCore::StyleResolver::adjustRenderStyle):
2564         * css/html.css:
2565         * dom/ContextFeatures.cpp:
2566         * dom/ContextFeatures.h:
2567         * dom/Document.cpp:
2568         * dom/Document.h:
2569         * dom/Element.cpp:
2570         (WebCore::Element::removedFrom):
2571         (WebCore::Element::setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries):
2572         * dom/Element.h:
2573         (WebCore::Element::isDisabledFormControl):
2574         * dom/ElementRareData.h:
2575         (WebCore::ElementRareData::ElementRareData):
2576         * html/HTMLDialogElement.cpp: Removed.
2577         * html/HTMLDialogElement.h: Removed.
2578         * html/HTMLDialogElement.idl: Removed.
2579         * html/HTMLElementsAllInOne.cpp:
2580         * html/HTMLTagNames.in:
2581         * rendering/RenderDialog.cpp: Removed.
2582         * rendering/RenderDialog.h: Removed.
2583         * rendering/RenderLayer.cpp:
2584         (WebCore::RenderLayer::rebuildZOrderLists):
2585         (WebCore::RenderLayer::collectLayers):
2586         * rendering/RenderLayer.h:
2587         * rendering/RenderObject.h:
2588         (WebCore::RenderObject::isCounter):
2589         * rendering/RenderingAllInOne.cpp:
2590         * testing/InternalSettings.cpp:
2591         (WebCore::InternalSettings::Backup::Backup):
2592         (WebCore::InternalSettings::Backup::restoreTo):
2593         * testing/InternalSettings.h:
2594
2595 2013-08-29  Simon Fraser  <simon.fraser@apple.com>
2596
2597         Fix slider thumb event handling to use local, not absolute coordinates
2598         https://bugs.webkit.org/show_bug.cgi?id=120480
2599
2600         Reviewed by Darin Adler.
2601         
2602         SliderThumbElement::setPositionFromPoint() did all of its coordinate
2603         math by mapping renderer rects into absolute coordinates, which was
2604         unnecessary and expensive.
2605         
2606         Fix by doing all the math in the coordinate space of the input's
2607         renderer. This simplified the code. Also, currentPosition
2608         was computed but unused, so was removed.
2609
2610         No behavior change. Tested by fast/forms/range/slider-transformed.html
2611
2612         * html/shadow/SliderThumbElement.cpp:
2613         (WebCore::SliderThumbElement::setPositionFromPoint):
2614
2615 2013-08-29  Zan Dobersek  <zdobersek@igalia.com>
2616
2617         [Automake] libWebCoreDOM.la could use a better name
2618         https://bugs.webkit.org/show_bug.cgi?id=120232
2619
2620         Reviewed by Martin Robinson.
2621
2622         * bindings/gobject/GNUmakefile.am: Rename the libWebCoreDOM library to libGObjectDOMBindings.
2623
2624 2013-08-29  Joseph Pecoraro  <pecoraro@apple.com>
2625
2626         Web Inspector: Download Web Archive of Inspected Page
2627         https://bugs.webkit.org/show_bug.cgi?id=119774
2628
2629         Reviewed by Timothy Hatcher.
2630
2631         Add PageAgent.archive which will return a Base-64 encoded web archive
2632         when successful. In order to then allow saving non-string files, extend
2633         InspectorFrontendHost.save to allow for Base-64 encoded data.
2634
2635         * inspector/Inspector.json:
2636         * inspector/InspectorPageAgent.cpp:
2637         (WebCore::InspectorPageAgent::archive):
2638         * inspector/InspectorPageAgent.h:
2639         Introduce and implement PageAgent.archive. Create a Web Archive of the
2640         page's main frame.
2641
2642         * inspector/InspectorFrontendClient.h:
2643         * inspector/InspectorFrontendClientLocal.h:
2644         (WebCore::InspectorFrontendClientLocal::save):
2645         * inspector/InspectorFrontendHost.cpp:
2646         (WebCore::InspectorFrontendHost::save):
2647         * inspector/InspectorFrontendHost.h:
2648         * inspector/InspectorFrontendHost.idl:
2649         Extend InspectorFrontendHost.save to include a base64Encoded param.
2650
2651         * inspector/front-end/FileManager.js:
2652         * inspector/front-end/InspectorFrontendHostStub.js:
2653         (.WebInspector.InspectorFrontendHostStub.prototype.save):
2654         Misc. updates to the old inspector for function changes.
2655
2656 2013-08-29  Robert Hogan  <robert@webkit.org>
2657
2658         Positioned Replaced Elements That Aren't RenderReplaced get Incorrect Width
2659         https://bugs.webkit.org/show_bug.cgi?id=93735
2660
2661         Reviewed by David Hyatt.
2662
2663         Replaced elements that aren't RenderReplaced aren't |isReplaced| and don't have an 
2664         intrinsic height or width. This causes them to go down the wrong height and width computation
2665         path in RenderBox when they are absolute positioned. 
2666         
2667         The notion of |isReplaced| is entwined with the notion of being |isInline| so it isn't really 
2668         possible to make them isReplaced without re-wiring a lot of code. So instead use an ad-hoc definition
2669         of isReplacedElement in RenderBox to bring all replaced elements into the height and width calculation.
2670         To make sure we get the right height and width in there, give non-RenderReplaced replaced renderers
2671         the helpers for returning their approximation of intrinsic height and width.
2672
2673         The initial attempt at landing this patch had to be rolled out because it used LayoutUnit() for default
2674         intrinsic height of some replaced elements and this made the layout of the elements unstable in some sites.
2675         The fix for this issue is captured in intrinsic-button-and-input-height.html.
2676
2677         Tests: fast/replaced/intrinsic-button-and-input-height.html
2678                fast/replaced/width-and-height-of-positioned-replaced-elements.html
2679
2680         * rendering/RenderBox.cpp:
2681         (WebCore::isReplacedElement):
2682         (WebCore::RenderBox::computePositionedLogicalWidth):
2683         (WebCore::RenderBox::computePositionedLogicalHeight):
2684         * rendering/RenderBox.h:
2685         (WebCore::RenderBox::intrinsicSize):
2686         * rendering/RenderButton.h:
2687         * rendering/RenderFileUploadControl.cpp:
2688         (WebCore::RenderFileUploadControl::computePreferredLogicalWidths):
2689         * rendering/RenderListBox.cpp:
2690         (WebCore::RenderListBox::RenderListBox):
2691         (WebCore::RenderListBox::computePreferredLogicalWidths):
2692         (WebCore::RenderListBox::computeLogicalHeight):
2693         * rendering/RenderListBox.h:
2694         * rendering/RenderMenuList.h:
2695         * rendering/RenderReplaced.h:
2696         * rendering/RenderSlider.cpp:
2697         (WebCore::RenderSlider::computePreferredLogicalWidths):
2698         * rendering/RenderTextControl.cpp:
2699         (WebCore::RenderTextControl::RenderTextControl):
2700         (WebCore::RenderTextControl::computeLogicalHeight):
2701         * rendering/RenderTextControl.h:
2702
2703 2013-08-29  Brent Fulgham  <bfulgham@apple.com>
2704
2705         [Windows] Unreviewed gardening. Add missing *.css files from project.
2706
2707         * WebCore.vcxproj/WebCore.vcxproj:
2708         * WebCore.vcxproj/WebCore.vcxproj.filters:
2709
2710 2013-08-29  Pratik Solanki  <pratik.solanki@gmail.com>
2711
2712         SharedBuffer m_segments and m_dataArray must be exclusive
2713         https://bugs.webkit.org/show_bug.cgi?id=77715
2714
2715         Reviewed by Benjamin Poulain.
2716
2717         When USE(NETWORK_CFDATA_ARRAY_CALLBACK) is enabled, we use m_dataArray to hold the incoming
2718         data. We do not use m_segments. Since they are exclusive in practice, do not define or use
2719         m_segments when NETWORK_CFDATA_ARRAY_CALLBACK is enabled.
2720
2721         No new tests because no functional changes.
2722
2723         * platform/SharedBuffer.cpp:
2724         (WebCore::SharedBuffer::append):
2725         (WebCore::SharedBuffer::clear):
2726         (WebCore::SharedBuffer::copy):
2727         (WebCore::SharedBuffer::buffer):
2728         (WebCore::SharedBuffer::getSomeData):
2729         * platform/SharedBuffer.h:
2730
2731 2013-08-29  Daniel Bates  <dabates@apple.com>
2732
2733         [iOS] Upstream changes to WebCore/style
2734         https://bugs.webkit.org/show_bug.cgi?id=120173
2735
2736         Reviewed by Darin Adler.
2737
2738         * style/StyleResolveTree.cpp:
2739         (WebCore::Style::elementImplicitVisibility): Added; specific to iOS.
2740         (WebCore::Style::CheckForVisibilityChangeOnRecalcStyle::CheckForVisibilityChangeOnRecalcStyle): Added; specific to iOS.
2741         (WebCore::Style::CheckForVisibilityChangeOnRecalcStyle::~CheckForVisibilityChangeOnRecalcStyle): Added; specific to iOS.
2742         (WebCore::Style::resolveTree): Modified to instantiate CheckForVisibilityChangeOnRecalcStyle when building on iOS.
2743
2744 2013-08-29  Arnaud Renevier  <a.renevier@samsung.com>
2745
2746         [cairo] canvas drawing on itself doesn't work with accelerated canvas
2747         https://bugs.webkit.org/show_bug.cgi?id=118808
2748
2749         Reviewed by Martin Robinson.
2750
2751         When copying an accelerated image, we try to get its dimensions with
2752         cairo_image_surface_get_width/cairo_image_surface_get_height. As
2753         surface is not an image, this returns width and height of 0.
2754
2755         Many other places use cairo_image_surface_get although the surface may
2756         be a gl surface. 
2757         
2758         This patch fixes those issues by implementing a cairoSurfaceSize
2759         helper that returns the surface size whatever type it is.
2760
2761         It use cairo_surface_create_similar instead of
2762         cairo_image_surface_create in copyCairoImageSurface. It also calls
2763         cairo_paint in encodeImage when a drawing over a black background is
2764         needed.
2765
2766         It copies the surface to an image surface if needed in extractImage.
2767
2768         No new tests. Covered by existing tests.
2769
2770         * platform/graphics/cairo/BitmapImageCairo.cpp:
2771         (WebCore::BitmapImage::BitmapImage):
2772         (WebCore::BitmapImage::draw):
2773         (WebCore::BitmapImage::checkForSolidColor):
2774         * platform/graphics/cairo/CairoUtilities.cpp:
2775         (WebCore::copyCairoImageSurface):
2776         (WebCore::cairoSurfaceSize):
2777         * platform/graphics/cairo/CairoUtilities.h:
2778         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
2779         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
2780         * platform/graphics/gtk/GdkCairoUtilities.cpp:
2781         (cairoSurfaceToGdkPixbuf):
2782         * platform/graphics/gtk/GdkCairoUtilities.h:
2783         * platform/graphics/gtk/ImageBufferGtk.cpp:
2784         (WebCore::encodeImage):
2785         * platform/graphics/gtk/ImageGtk.cpp:
2786         (WebCore::BitmapImage::getGdkPixbuf):
2787         * platform/gtk/DragIcon.cpp:
2788         (WebCore::DragIcon::setImage):
2789
2790 2013-08-29  Tamas Czene  <tczene@inf.u-szeged.hu>
2791
2792         Buildfix after r154806 for !ENABLE(CSS_REGIONS) platforms.
2793         https://bugs.webkit.org/show_bug.cgi?id=120461
2794
2795         Reviewed by Csaba Osztrogonác.
2796
2797         moveToFlowThreadIfNeeded() is used only inside of ENABLE(CSS_REGIONS)
2798         block (and only once), so it should be guarded too.
2799
2800         * style/StyleResolveTree.cpp:
2801
2802 2013-08-29  David Kilzer  <ddkilzer@apple.com>
2803
2804         BUILD FIX (r154778): AXSearchFieldCancelButtonText() is not defined on iOS
2805
2806         See: AX: Cancel button in search field not accessible.
2807         <https://webkit.org/b/120322>
2808
2809         Fixes the following build error:
2810
2811             In file included from Source/WebCore/accessibility/AccessibilityAllInOne.cpp:44:
2812             Source/WebCore/accessibility/AccessibilitySearchFieldButtons.cpp:46:12: error: use of undeclared identifier 'AXSearchFieldCancelButtonText'
2813                 return AXSearchFieldCancelButtonText();
2814                        ^
2815             1 error generated.
2816
2817         * accessibility/AccessibilitySearchFieldButtons.cpp:
2818         (WebCore::AccessibilitySearchFieldCancelButton::accessibilityDescription):
2819         Return String() instead of calling AXSearchFieldCancelButtonText() on iOS.
2820
2821 2013-08-29  Antti Koivisto  <antti@apple.com>
2822
2823         Remove NodeRenderingContext
2824         https://bugs.webkit.org/show_bug.cgi?id=120466
2825
2826         Reviewed by Andreas Kling.
2827
2828         Switch the few remaining clients of this class to call the underlying code directly.
2829
2830         * CMakeLists.txt:
2831         * GNUmakefile.list.am:
2832         * Target.pri:
2833         * WebCore.exp.in:
2834         * WebCore.vcxproj/WebCore.vcxproj:
2835         * WebCore.xcodeproj/project.pbxproj:
2836         * css/StyleResolver.cpp:
2837         (WebCore::StyleResolver::State::initForStyleResolve):
2838         * dom/DOMAllInOne.cpp:
2839         * dom/Node.cpp:
2840         * dom/Node.h:
2841         
2842             Remove Node::parentNodeForRenderingAndStyle(). Make clients invoke NodeRenderingTraversal::parent() directly.
2843
2844         * dom/NodeRenderingContext.cpp: Removed.
2845         * dom/NodeRenderingContext.h: Removed.
2846         * dom/ShadowRoot.h:
2847         * dom/Text.cpp:
2848         * dom/Text.h:
2849         * dom/TreeScope.cpp:
2850         * dom/TreeScope.h:
2851             
2852             Remove virtual TreeScope::resetStyleInheritance. Make clients cast to ShadowRoot when needed.
2853
2854         * html/HTMLSummaryElement.cpp:
2855         (WebCore::HTMLSummaryElement::detailsElement):
2856         * style/StyleResolveTree.cpp:
2857         (WebCore::Style::createTextRendererIfNeeded):
2858         
2859             For consistency switch resetStyleInheritance check to use parentNode() instead of renderingParentNode. This matches the NodeRenderingTraversal implementation.
2860             This difference is probably not testable in current trunk.
2861
2862         (WebCore::Style::resolveTree):
2863
2864 2013-08-29  Antti Koivisto  <antti@apple.com>
2865
2866         Move element renderer creation out of NodeRenderingContext
2867         https://bugs.webkit.org/show_bug.cgi?id=120461
2868
2869         Reviewed by Andreas Kling.
2870
2871         Move NodeRenderingContext::createRendererIfNeeded() and the related utility functions to StyleResolveTree.
2872         
2873         Tighten typing and constness. Refactor sligthly to be more understandable.
2874
2875         * dom/Element.cpp:
2876         (WebCore::Element::shouldMoveToFlowThread):
2877         * dom/Element.h:
2878         * dom/NodeRenderingContext.cpp:
2879         (WebCore::NodeRenderingContext::NodeRenderingContext):
2880         (WebCore::NodeRenderingContext::nextRenderer):
2881         (WebCore::NodeRenderingContext::previousRenderer):
2882         (WebCore::NodeRenderingContext::parentRenderer):
2883         * dom/NodeRenderingContext.h:
2884         * dom/PseudoElement.h:
2885         * style/StyleResolveTree.cpp:
2886         (WebCore::Style::nextSiblingRenderer):
2887         (WebCore::Style::shouldCreateRenderer):
2888         (WebCore::Style::elementInsideRegionNeedsRenderer):
2889         (WebCore::Style::moveToFlowThreadIfNeeded):
2890         (WebCore::Style::createRendererIfNeeded):
2891         (WebCore::Style::attachRenderTree):
2892         * svg/SVGElement.cpp:
2893         (WebCore::SVGElement::shouldMoveToFlowThread):
2894         * svg/SVGElement.h:
2895
2896 2013-08-28  Chris Fleizach  <cfleizach@apple.com>
2897
2898         AX: WebProcess at com.apple.WebCore: WebCore::AXObjectCache::rootObject + 27
2899         https://bugs.webkit.org/show_bug.cgi?id=120434
2900
2901         Reviewed by Darin Adler.
2902
2903         Crash logs indicate that there's a null pointer access in rootObject. That seems like it could only
2904         happen in Document was null. 
2905
2906         Unfortunately, there are no reproducible steps and no other information to construct a test case.
2907
2908         * accessibility/AXObjectCache.cpp:
2909         (WebCore::AXObjectCache::rootObject):
2910
2911 2013-08-28  Ryosuke Niwa  <rniwa@webkit.org>
2912
2913         The code to look for an ancestor form element is duplicated in three different places
2914         https://bugs.webkit.org/show_bug.cgi?id=120391
2915
2916         Reviewed by Darin Adler.
2917
2918         Unduplicated the code by putting a single implementation in HTMLFormElement.cpp.
2919
2920         * WebCore.order:
2921         * html/FormAssociatedElement.cpp:
2922         (WebCore::FormAssociatedElement::findAssociatedForm):
2923         (WebCore::FormAssociatedElement::formAttributeChanged):
2924         * html/HTMLElement.cpp:
2925         (WebCore::HTMLElement::virtualForm):
2926         * html/HTMLElement.h:
2927         * html/HTMLFormControlElement.cpp:
2928         (WebCore::HTMLFormControlElement::HTMLFormControlElement):
2929         * html/HTMLFormElement.cpp:
2930         (WebCore::HTMLFormElement::findClosestFormAncestor):
2931         * html/HTMLFormElement.h:
2932         * html/HTMLImageElement.cpp:
2933         (WebCore::HTMLImageElement::insertedInto):
2934         * html/HTMLObjectElement.cpp:
2935         (WebCore::HTMLObjectElement::HTMLObjectElement):
2936         * html/parser/HTMLTreeBuilder.cpp:
2937         (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
2938
2939 2013-08-28  Ryosuke Niwa  <rniwa@webkit.org>
2940
2941         Stop throwing DOM exceptions in internal 'XMLHttpRequest' response getters
2942         https://bugs.webkit.org/show_bug.cgi?id=120446
2943
2944         Reviewed by Alexey Proskuryakov.
2945
2946         Merge https://chromium.googlesource.com/chromium/blink/+/c8188c21452501b68950a9fcc1f5cbc7b4de4df5
2947
2948         Unlike 'responseText' and 'responseXML', 'responseBlob' and
2949         'responseArrayBuffer' are not exposed to JavaScript (they don't
2950         appear in the IDL or in the specification). As they are only called from
2951         custom bindings in response to a JavaScript call to the 'response' getter,
2952         we can safely replace the exception-throwing code in the implementation
2953         with an ASSERT that the request type is correct.
2954
2955         * bindings/js/JSXMLHttpRequestCustom.cpp:
2956         (WebCore::JSXMLHttpRequest::response):
2957         * xml/XMLHttpRequest.cpp:
2958         (WebCore::XMLHttpRequest::responseBlob):
2959         (WebCore::XMLHttpRequest::responseArrayBuffer):
2960         * xml/XMLHttpRequest.h:
2961
2962 2013-08-28  Chris Curtis  <chris_curtis@apple.com>
2963
2964         https://bugs.webkit.org/show_bug.cgi?id=119548
2965         Refactoring Exception throws.
2966         
2967         Reviewed by Geoffrey Garen.
2968         
2969         Gets column information from the error object for reporting exceptions.
2970         * bindings/js/JSDOMBinding.cpp:
2971         (WebCore::reportException): 
2972         * bindings/js/ScriptCallStackFactory.cpp: 
2973         (WebCore::createScriptCallStackFromException):
2974  
2975         Moved setting an exception into the vm, These functions changed to use the new functionality.
2976  
2977         * bindings/js/JSAudioBufferSourceNodeCustom.cpp:
2978         (WebCore::JSAudioBufferSourceNode::setBuffer):
2979         * bindings/js/JSBiquadFilterNodeCustom.cpp:
2980         (WebCore::JSBiquadFilterNode::setType):
2981         * bindings/js/JSCryptoCustom.cpp:
2982         (WebCore::JSCrypto::getRandomValues):
2983         * bindings/js/JSDOMBinding.cpp:
2984         (WebCore::setDOMException):
2985         * bindings/js/JSInjectedScriptHostCustom.cpp:
2986         (WebCore::JSInjectedScriptHost::setFunctionVariableValue):
2987         * bindings/js/JSJavaScriptCallFrameCustom.cpp:
2988         (WebCore::JSJavaScriptCallFrame::evaluate):
2989         (WebCore::JSJavaScriptCallFrame::setVariableValue):
2990         * bindings/js/JSNodeFilterCondition.cpp:
2991         (WebCore::JSNodeFilterCondition::acceptNode):
2992         * bindings/js/JSOscillatorNodeCustom.cpp:
2993         (WebCore::JSOscillatorNode::setType):
2994         * bindings/js/JSPannerNodeCustom.cpp:
2995         (WebCore::JSPannerNode::setPanningModel):
2996         (WebCore::JSPannerNode::setDistanceModel):
2997         * bindings/js/JSSVGLengthCustom.cpp:
2998         (WebCore::JSSVGLength::convertToSpecifiedUnits):
2999         * bindings/js/JSWebGLRenderingContextCustom.cpp:
3000         (WebCore::getObjectParameter):
3001         (WebCore::JSWebGLRenderingContext::getAttachedShaders):
3002         (WebCore::JSWebGLRenderingContext::getExtension):
3003         (WebCore::JSWebGLRenderingContext::getFramebufferAttachmentParameter):
3004         (WebCore::JSWebGLRenderingContext::getParameter):
3005         (WebCore::JSWebGLRenderingContext::getProgramParameter):
3006         (WebCore::JSWebGLRenderingContext::getShaderParameter):
3007         (WebCore::JSWebGLRenderingContext::getUniform):
3008         (WebCore::dataFunctionf):
3009         (WebCore::dataFunctioni):
3010         (WebCore::dataFunctionMatrix):
3011         * bindings/js/JSXMLHttpRequestCustom.cpp:
3012         (WebCore::JSXMLHttpRequest::open):
3013         * bindings/js/SerializedScriptValue.cpp:
3014         (WebCore::CloneBase::throwStackOverflow):
3015         (WebCore::CloneDeserializer::throwValidationError):
3016         (WebCore::SerializedScriptValue::maybeThrowExceptionIfSerializationFailed):
3017         * bindings/js/WorkerScriptController.cpp:
3018         (WebCore::WorkerScriptController::evaluate):
3019         (WebCore::WorkerScriptController::setException):
3020         * bridge/c/c_instance.cpp:
3021         (JSC::Bindings::CInstance::moveGlobalExceptionToExecState):
3022         (JSC::Bindings::CInstance::invokeMethod):
3023         (JSC::Bindings::CInstance::invokeDefaultMethod):
3024         (JSC::Bindings::CInstance::invokeConstruct):
3025         (JSC::Bindings::CInstance::toJSPrimitive):
3026         * bridge/objc/objc_instance.mm:
3027         (ObjcInstance::invokeMethod):
3028         * bridge/objc/objc_runtime.mm:
3029         (JSC::Bindings::ObjcArray::setValueAt):
3030         (JSC::Bindings::ObjcArray::valueAt):
3031         * bridge/objc/objc_utility.mm:
3032         (JSC::Bindings::throwError):
3033         * bridge/qt/qt_instance.cpp:
3034         (JSC::Bindings::QtField::valueFromInstance):
3035         (JSC::Bindings::QtField::setValueToInstance):
3036         * bridge/runtime_array.cpp:
3037         (JSC::RuntimeArray::put):
3038         (JSC::RuntimeArray::putByIndex):
3039         * bridge/runtime_object.cpp:
3040         (JSC::Bindings::RuntimeObject::throwInvalidAccessError):
3041
3042 2013-08-28  Alexey Proskuryakov  <ap@apple.com>
3043
3044         Remove an unused data member from Page.
3045
3046         Rubber-stamped by Brady Eidson.
3047
3048         * page/Page.cpp:
3049         * page/Page.h:
3050         Removed m_cookieEnabled. This was completely dead code, long obsoleted by PageSettings.
3051
3052 2013-08-28  Gustavo Noronha Silva  <gns@gnome.org>
3053
3054         Unreviewed build fix - copy/paste failure, copied too much.
3055
3056         * bindings/gobject/WebKitDOMCustom.h:
3057
3058 2013-08-28  Dean Jackson  <dino@apple.com>
3059
3060         [WebGL] CoreGraphics can provide greyscale image data
3061         https://webkit.org/b/120443
3062
3063         Reviewed by Simon Fraser.
3064
3065         CoreGraphics can decode greyscale or greyscale+alpha images
3066         while preserving the format. Our WebGL texture unpacker
3067         was seeing this and assuming it meant the data did not come
3068         from an <img> element. Since that method already special cased
3069         CoreGraphics, the fix was to simply return true for these
3070         extra types.
3071
3072         I also renamed srcFormatComeFromDOMElementOrImageData
3073         to srcFormatComesFromDOMElementOrImageData.
3074
3075         Test: fast/canvas/webgl/tex-image-with-greyscale-image.html
3076
3077         * platform/graphics/GraphicsContext3D.cpp: Call new name.
3078         * platform/graphics/GraphicsContext3D.h:
3079         (WebCore::GraphicsContext3D::srcFormatComesFromDOMElementOrImageData):
3080         Add support for R8, AR8, A8, and RA8 data formats.
3081
3082 2013-08-28  Gustavo Noronha Silva  <gns@gnome.org>
3083
3084         [GTK] HTMLElement lost setID and getID - need to add compatibility symbols
3085         https://bugs.webkit.org/show_bug.cgi?id=120440
3086
3087         Reviewed by Martin Robinson.
3088
3089         No tests, just adding compatibility symbols.
3090
3091         setID and getID were removed, and the parent class (Element) ones should be used instead.
3092         We need to keep our ABI compatible, though, so add compatibility symbols.
3093
3094         * bindings/gobject/WebKitDOMCustom.cpp:
3095         (webkit_dom_html_element_get_id):
3096         (webkit_dom_html_element_set_id):
3097         * bindings/gobject/WebKitDOMCustom.h:
3098
3099 2013-08-28  Simon Fraser  <simon.fraser@apple.com>
3100
3101         Fix compositing layers in columns
3102         https://bugs.webkit.org/show_bug.cgi?id=120436
3103
3104         Reviewed by Dave Hyatt.
3105         
3106         Remove the old hack in RenderLayer::updateLayerPosition() for placing
3107         layers in columns, which changed the layer position for composited
3108         layers; this broke hit-testing.
3109         
3110         Fix a better way by moving compositing layers to the correct
3111         positions that take column offsets into account, by fixing
3112         RenderLayer::convertToLayerCoords() to optionally apply column
3113         adjustment, and using this in the code which positions compositing layers.
3114
3115         Tests: compositing/columns/ancestor-clipped-in-paginated.html
3116                compositing/columns/clipped-in-paginated.html
3117                compositing/columns/composited-columns-vertical-rl.html
3118                compositing/columns/composited-columns.html
3119                compositing/columns/composited-in-paginated-rl.html
3120                compositing/columns/composited-in-paginated-writing-mode-rl.html
3121                compositing/columns/composited-lr-paginated-repaint.html
3122                compositing/columns/composited-rl-paginated-repaint.html
3123                compositing/columns/hittest-composited-in-paginated.html
3124                compositing/columns/rotated-in-paginated.html
3125                compositing/columns/untransformed-composited-in-paginated.html
3126
3127         * rendering/RenderLayer.cpp:
3128         (WebCore::RenderLayer::updateLayerPosition):
3129         (WebCore::RenderLayer::convertToPixelSnappedLayerCoords):
3130         (WebCore::accumulateOffsetTowardsAncestor):
3131         (WebCore::RenderLayer::convertToLayerCoords):
3132         * rendering/RenderLayer.h:
3133         * rendering/RenderLayerBacking.cpp:
3134         (WebCore::RenderLayerBacking::updateCompositedBounds):
3135         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
3136
3137 2013-08-28  Brent Fulgham  <bfulgham@webkit.org>
3138
3139         [WinCairo] Unreviewed build fix.
3140
3141         * WebCore.vcxproj/WebCore.vcxproj: Don't exclude the full screen
3142         window from the build.
3143         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
3144
3145 2013-08-28  Benjamin Poulain  <benjamin@webkit.org>
3146
3147         Fix the build after r154780
3148
3149         * dom/SpaceSplitString.cpp:
3150         (WebCore::SpaceSplitStringData::create):
3151
3152 2013-08-27  Benjamin Poulain  <bpoulain@apple.com>
3153
3154         Simplify and clean SpaceSplitString
3155         https://bugs.webkit.org/show_bug.cgi?id=120385
3156
3157         Reviewed by Ryosuke Niwa.
3158
3159         Clean up of SpaceSplitString following the cleaning of the DOMTokenList hierarchy.
3160         This brings the following:
3161         - Fix the coding style of the header.
3162         - Remove the concepts of empty and null. The list can now be empty or have something.
3163           There is no null state.
3164         - Put the tokens directly following SpaceSplitStringData instead of using a Vector in between.
3165
3166         * WebCore.exp.in:
3167         * dom/ElementData.h:
3168         (WebCore::ElementData::hasClass):
3169         * dom/SpaceSplitString.cpp:
3170         (WebCore::tokenizeSpaceSplitString):
3171         (WebCore::SpaceSplitStringData::containsAll):
3172         (WebCore::SpaceSplitString::set):
3173         (WebCore::SpaceSplitString::spaceSplitStringContainsValue):
3174         (WebCore::TokenCounterProcessor::TokenCounterProcessor):
3175         (WebCore::TokenCounterProcessor::processToken):
3176         (WebCore::TokenCounterProcessor::tokenCount):
3177         (WebCore::TokenInitializerProcessor::TokenInitializerProcessor):
3178         (WebCore::TokenInitializerProcessor::processToken):
3179         (WebCore::TokenInitializerProcessor::nextMemoryBucket):
3180         (WebCore::SpaceSplitStringData::create):
3181         (WebCore::SpaceSplitStringData::destroy):
3182         * dom/SpaceSplitString.h:
3183         (WebCore::SpaceSplitStringData::contains):
3184         (WebCore::SpaceSplitStringData::size):
3185         (WebCore::SpaceSplitStringData::operator[]):
3186         (WebCore::SpaceSplitStringData::ref):
3187         (WebCore::SpaceSplitStringData::deref):
3188         (WebCore::SpaceSplitStringData::SpaceSplitStringData):
3189         (WebCore::SpaceSplitStringData::~SpaceSplitStringData):
3190         (WebCore::SpaceSplitStringData::tokenArrayStart):
3191         (WebCore::SpaceSplitString::SpaceSplitString):
3192         (WebCore::SpaceSplitString::operator!=):
3193         (WebCore::SpaceSplitString::clear):
3194         (WebCore::SpaceSplitString::contains):
3195         (WebCore::SpaceSplitString::containsAll):
3196         (WebCore::SpaceSplitString::size):
3197         (WebCore::SpaceSplitString::isEmpty):
3198         (WebCore::SpaceSplitString::operator[]):
3199         (WebCore::SpaceSplitString::spaceSplitStringContainsValue):
3200         * html/ClassList.cpp:
3201         (WebCore::ClassList::classNames):
3202         * page/EventHandler.cpp:
3203         (WebCore::findDropZone):
3204
3205 <<<<<<< .mine
3206 2013-08-28  Benjamin Poulain  <benjamin@webkit.org>
3207
3208         Simplify and clean SpaceSplitString
3209         https://bugs.webkit.org/show_bug.cgi?id=120385
3210
3211         Reviewed by Ryosuke Niwa.
3212
3213         Clean up of SpaceSplitString following the cleaning of the DOMTokenList hierarchy.
3214         - Remove the concepts of empty and null. The list can now be empty or have something.
3215           There is no null state.
3216         - Put the tokens directly following SpaceSplitStringData instead of using a Vector in between.
3217
3218         * WebCore.exp.in:
3219         * dom/ElementData.h:
3220         (WebCore::ElementData::hasClass):
3221         * dom/SpaceSplitString.cpp:
3222         (WebCore::tokenizeSpaceSplitString):
3223         (WebCore::SpaceSplitStringData::containsAll):
3224         (WebCore::SpaceSplitString::set):
3225         (WebCore::SpaceSplitString::spaceSplitStringContainsValue):
3226         (WebCore::TokenCounter::TokenCounter):
3227         (WebCore::TokenCounter::processToken):
3228         (WebCore::TokenCounter::tokenCount):
3229         (WebCore::TokenAtomicStringInitializer::TokenAtomicStringInitializer):
3230         (WebCore::TokenAtomicStringInitializer::processToken):
3231         (WebCore::TokenAtomicStringInitializer::nextMemoryBucket):
3232         (WebCore::SpaceSplitStringData::create):
3233         (WebCore::SpaceSplitStringData::destroy):
3234         * dom/SpaceSplitString.h:
3235         (WebCore::SpaceSplitStringData::contains):
3236         (WebCore::SpaceSplitStringData::size):
3237         (WebCore::SpaceSplitStringData::operator[]):
3238         (WebCore::SpaceSplitStringData::ref):
3239         (WebCore::SpaceSplitStringData::deref):
3240         (WebCore::SpaceSplitStringData::SpaceSplitStringData):
3241         (WebCore::SpaceSplitStringData::~SpaceSplitStringData):
3242         (WebCore::SpaceSplitStringData::tokenArrayStart):
3243         (WebCore::SpaceSplitString::containsAll):
3244         (WebCore::SpaceSplitString::isEmpty):
3245         (WebCore::SpaceSplitString::operator[]):
3246         * html/ClassList.cpp:
3247         (WebCore::ClassList::classNames):
3248         * page/EventHandler.cpp:
3249         (WebCore::findDropZone):
3250
3251 =======
3252 2013-08-28  Rob Buis  <rwlbuis@webkit.org>
3253
3254         Namespace prefix is blindly followed when serializing
3255         https://bugs.webkit.org/show_bug.cgi?id=19121
3256         Serializer doesn't handling inconsistent prefixes properly
3257         https://bugs.webkit.org/show_bug.cgi?id=117764
3258         Attribute namespaces are serialized as if they were element ones
3259         https://bugs.webkit.org/show_bug.cgi?id=22958
3260
3261         Reviewed by Ryosuke Niwa.
3262
3263         Add code to make sure unique prefixes and namespace declarations are generated.
3264         Unique prefix generation happens when:
3265         - the same prefix is used to map to different namespaces or
3266         - no prefix is given but the attribute is in a namespace.
3267
3268         This is done in order to not violate constraints listed in http://www.w3.org/TR/xml-names11/. In general
3269         the pseudo code listed in http://www.w3.org/TR/DOM-Level-3-Core/namespaces-algorithms.html#normalizeDocumentAlgo
3270         is used, doing the following for attributes:
3271         if the attribute has a namespace then
3272           if the attribute has no prefix OR prefix is not declared OR conflicts with existing prefix mapping to different NS then
3273             try to find the matching in-scope declaration by looking up the prefix in the namespace -> prefix mapping, if found use that prefix
3274             else if the attribute prefix is not null AND not mapped in-scope, declare the prefix
3275             else generate a unique prefix for the namespace
3276
3277         To keep track of in-scope namespaces a prefix to namespace mapping is used. 
3278
3279         Tests: fast/dom/XMLSerializer-attribute-namespace-prefix-conflicts.html
3280                fast/dom/XMLSerializer-same-prefix-different-namespaces-conflict.html
3281                fast/dom/XMLSerializer-setAttributeNS-namespace-no-prefix.html
3282                svg/custom/xlink-prefix-generation-in-attributes.html
3283
3284         * editing/MarkupAccumulator.cpp:
3285         (WebCore::MarkupAccumulator::MarkupAccumulator):
3286         (WebCore::MarkupAccumulator::shouldAddNamespaceAttribute):
3287         (WebCore::MarkupAccumulator::appendNamespace):
3288         (WebCore::MarkupAccumulator::generateUniquePrefix):
3289         (WebCore::MarkupAccumulator::appendAttribute):
3290         * editing/MarkupAccumulator.h:
3291
3292 2013-08-28  Sam White  <samuel_white@apple.com>
3293
3294         AX: Cancel button in search field not accessible.
3295         <https://webkit.org/b/120322>
3296
3297         Expose the cancel button that shows in an input element of
3298         type search to accessibility.
3299
3300         Reviewed by Chris Fleizach.
3301
3302         Test: platform/mac/accessibility/search-field-cancel-button.html
3303
3304         * CMakeLists.txt:
3305         * English.lproj/Localizable.strings:
3306         * GNUmakefile.list.am:
3307         * Target.pri:
3308         * WebCore.vcxproj/WebCore.vcxproj:
3309         * WebCore.xcodeproj/project.pbxproj:
3310         * accessibility/AXObjectCache.cpp:
3311         (WebCore::createFromRenderer):
3312         * accessibility/AccessibilityAllInOne.cpp:
3313         * accessibility/AccessibilitySearchFieldButtons.cpp: Added.
3314         (WebCore::AccessibilitySearchFieldCancelButton::create):
3315         (WebCore::AccessibilitySearchFieldCancelButton::AccessibilitySearchFieldCancelButton):
3316         (WebCore::AccessibilitySearchFieldCancelButton::accessibilityDescription):
3317         (WebCore::AccessibilitySearchFieldCancelButton::accessibilityText):
3318         (WebCore::AccessibilitySearchFieldCancelButton::press):
3319         (WebCore::AccessibilitySearchFieldCancelButton::computeAccessibilityIsIgnored):
3320         * accessibility/AccessibilitySearchFieldButtons.h: Added.
3321         * dom/Element.h:
3322         (WebCore::Element::isSearchFieldCancelButtonElement):
3323         * html/shadow/TextControlInnerElements.h:
3324         * platform/LocalizedStrings.cpp:
3325         (WebCore::AXSearchFieldCancelButtonText):
3326         * platform/LocalizedStrings.h:
3327         * platform/efl/LocalizedStringsEfl.cpp:
3328         (WebCore::AXSearchFieldCancelButtonText):
3329         * platform/gtk/LocalizedStringsGtk.cpp:
3330         (WebCore::AXSearchFieldCancelButtonText):
3331         * platform/qt/LocalizedStringsQt.cpp:
3332         (WebCore::AXSearchFieldCancelButtonText):
3333
3334 >>>>>>> .r154779
3335 2013-08-28  Eric Carlson  <eric.carlson@apple.com>
3336
3337         MediaPlayerPrivateAVFoundationObjC is painting video frames under the video layer
3338         https://bugs.webkit.org/show_bug.cgi?id=120170
3339
3340         Reviewed by Simon Fraser.
3341
3342         No new tests, it is only possible to test in the debugger.
3343
3344         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3345         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasAvailableVideoFrame): Drive by optimization.
3346         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext): Move logic from paint here.
3347         (WebCore::MediaPlayerPrivateAVFoundationObjC::paint): Do nothing if we already have a video layer,
3348             otherwise call paint().
3349
3350 2013-08-28  Antti Koivisto  <antti@apple.com>
3351
3352         Add child and descendant const iterators
3353         https://bugs.webkit.org/show_bug.cgi?id=120430
3354
3355         Reviewed by Andreas Kling
3356
3357         This patch adds const-correct DOM tree traversal iterators. It also uses them in a few places.
3358         
3359         Some const_casts have been applied where constness breaks.
3360
3361         * dom/ChildIterator.h:
3362         (WebCore::::ChildConstIterator):
3363         (WebCore::::operator):
3364         (WebCore::=):
3365         (WebCore::::ChildConstIteratorAdapter):
3366         (WebCore::::begin):
3367         (WebCore::::end):
3368         (WebCore::elementChildren):
3369         (WebCore::childrenOfType):
3370         * dom/DescendantIterator.h:
3371         (WebCore::::DescendantConstIterator):
3372         (WebCore::::operator):
3373         (WebCore::=):
3374         (WebCore::::DescendantConstIteratorAdapter):
3375         (WebCore::::begin):
3376         (WebCore::::end):
3377         (WebCore::elementDescendants):
3378         (WebCore::descendantsOfType):
3379         * dom/Node.cpp:
3380         (WebCore::Node::numberOfScopedHTMLStyleChildren):
3381         * html/HTMLFieldSetElement.cpp:
3382         (WebCore::HTMLFieldSetElement::legend):
3383         * html/HTMLFieldSetElement.h:
3384         * html/HTMLMediaElement.cpp:
3385         (WebCore::HTMLMediaElement::finishParsingChildren):
3386         * html/HTMLObjectElement.cpp:
3387         (WebCore::HTMLObjectElement::containsJavaApplet):
3388         * svg/SVGElement.cpp:
3389         (WebCore::SVGElement::title):
3390         * svg/SVGSVGElement.cpp:
3391         (WebCore::SVGSVGElement::collectIntersectionOrEnclosureList):
3392         (WebCore::SVGSVGElement::checkIntersection):
3393         (WebCore::SVGSVGElement::checkEnclosure):
3394         (WebCore::SVGSVGElement::getElementById):
3395         * svg/SVGSVGElement.h:
3396
3397 2013-08-28  Lukasz Gajowy  <l.gajowy@samsung.com>
3398
3399         AX:Null pointer may be dereferenced.
3400         https://bugs.webkit.org/show_bug.cgi?id=120300
3401
3402         Reviewed by Chris Fleizach.
3403
3404         Added a check if newObj is not null and an assert in order to avoid dereferecing null pointer.
3405
3406         * accessibility/AXObjectCache.cpp:
3407         (WebCore::AXObjectCache::getOrCreate):
3408
3409 2013-08-28  Pratik Solanki  <psolanki@apple.com>
3410
3411         Document::elementSheet() should return a reference
3412         https://bugs.webkit.org/show_bug.cgi?id=120433
3413
3414         Reviewed by Andreas Kling.
3415
3416         Since elementSheet() always retruns a valid pointer, we can simply return a reference
3417         instead. Also rename m_elemSheet to m_elementSheet.
3418
3419         * css/CSSParser.cpp:
3420         (WebCore::CSSParser::parseInlineStyleDeclaration):
3421         * css/PropertySetCSSStyleDeclaration.cpp:
3422         (WebCore::InlineCSSStyleDeclaration::parentStyleSheet):
3423         * dom/Document.cpp:
3424         (WebCore::Document::~Document):
3425         (WebCore::Document::recalcStyle):