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