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