RenderSVGResource helpers should take RenderStyle by const reference.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2013-11-07  Andreas Kling  <akling@apple.com>
2
3         RenderSVGResource helpers should take RenderStyle by const reference.
4         <https://webkit.org/b/124029>
5
6         Take const RenderStyle& instead of RenderStyle* in a few more places
7         so we can get rid of some ampersands and assertions.
8
9         Reviewed by Anders Carlsson.
10
11 2013-11-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
12
13         [AX] Generate toAccessibilityTableRow|Column|Cell to detect bad type casts
14         https://bugs.webkit.org/show_bug.cgi?id=123984
15
16         Reviewed by Mario Sanchez Prada.
17
18         As a step to let static_cast<> use TYPE_CASTS_BASE, AccessibilityTableRow|Column|Cell use
19         ACCESSIBILITY_OBJECT_TYPE_CASTS which can support more helper functions rather than manual
20         static_cast<>. This change will help to detect bad type casts further.
21
22         No new tests, no behavior changes.
23
24         * accessibility/AccessibilityARIAGrid.cpp:
25         (WebCore::AccessibilityARIAGrid::addTableCellChild):
26         (WebCore::AccessibilityARIAGrid::addChildren):
27         * accessibility/AccessibilityARIAGridCell.cpp:
28         (WebCore::AccessibilityARIAGridCell::rowIndexRange):
29         * accessibility/AccessibilityTable.cpp:
30         (WebCore::AccessibilityTable::addChildren):
31         (WebCore::AccessibilityTable::rowHeaders):
32         (WebCore::AccessibilityTable::columnHeaders):
33         (WebCore::AccessibilityTable::cellForColumnAndRow):
34         * accessibility/AccessibilityTableCell.h:
35         * accessibility/AccessibilityTableColumn.h:
36         * accessibility/AccessibilityTableRow.cpp:
37         (WebCore::AccessibilityTableRow::headerObject):
38         * accessibility/AccessibilityTableRow.h:
39         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
40         (cellAtIndex):
41         (webkitAccessibleTableGetColumnHeader):
42         (webkitAccessibleTableGetRowHeader):
43         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
44         (-[WebAccessibilityObjectWrapper tableCellParent]):
45         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
46         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
47
48 2013-11-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
49
50         REGRESSION (r154375): Image is oriented incorrectly
51         https://bugs.webkit.org/show_bug.cgi?id=123831
52
53         Reviewed by Antonio Gomes.
54
55         r154375 made that shouldRespectImageOrientation() isn't used by drawImage().
56         It causes an image isn't oriented correctly. This patch sets shouldRespectImageOrientation()
57         value by default.
58
59         * rendering/RenderImage.cpp:
60         (WebCore::RenderImage::paintReplaced):
61         (WebCore::RenderImage::paintIntoRect):
62
63 2013-11-07  Hans Muller  <hmuller@adobe.com>
64
65         [CSS Shapes] Image shape-outside with vertical gaps is handled incorrectly
66         https://bugs.webkit.org/show_bug.cgi?id=123934
67
68         Reviewed by Andreas Kling.
69
70         RasterShapeIntervals::getExcludedIntervals() was returning an empty
71         list when the line overlapped any vertical gap in the image. This short-circuit
72         had been mistakenly copied from getIncludedIntervals(), where it makes sense.
73
74         Test: fast/shapes/shape-outside-floats/shape-outside-floats-image-vgap.html
75
76         * rendering/shapes/RasterShape.cpp:
77         (WebCore::RasterShapeIntervals::getExcludedIntervals):
78
79 2013-11-07  Simon Fraser  <simon.fraser@apple.com>
80
81         Make contents layer borders more visible
82         https://bugs.webkit.org/show_bug.cgi?id=124025
83
84         Reviewed by Tim Horton.
85
86         Layer borders for contents layers are impossible to see when the
87         contentsLayer has the same bounds as its parent; make the contents
88         layer border 4px thick to make it more visible.
89
90         * platform/graphics/ca/GraphicsLayerCA.cpp:
91         (WebCore::GraphicsLayerCA::setupContentsLayer):
92
93 2013-11-07  Andreas Kling  <akling@apple.com>
94
95         InlineFlowBox always has a RenderBoxModelObject, take advantage.
96         <https://webkit.org/b/124024>
97
98         Since InlineFlowBox already has the branch-less renderer() returning
99         a RenderBoxModelObject&, avoid using InlineBox::boxModelObject()
100         wherever we have a tightly-typed box. One branch disappears from
101         every call site.
102
103         Deleted boxModelObject() on InlineFlowBox to prevent new code from
104         calling the less efficient function.
105
106         Reviewed by Anders Carlsson.
107
108 2013-11-07  Andreas Kling  <akling@apple.com>
109
110         CTTE: Scrolling tree nodes should always have a ScrollingTree&.
111         <https://webkit.org/b/124022>
112
113         Let ScrollingTreeNode and subclasses store the backpointer to the
114         tree as a ScrollingTree& reference.
115
116         Reviewed by Anders Carlsson.
117
118 2013-11-07  Simon Fraser  <simon.fraser@apple.com>
119
120         Lots of layers get solid color but transparent contents layers now
121         https://bugs.webkit.org/show_bug.cgi?id=123537
122
123         Reviewed by Tim Horton.
124         
125         We call rendererBackgroundColor() to determine the layer's background color,
126         but on most elements this returns the transparent color (a valid color).
127         This caused us to allocate a contentsLayer, and use the transparent color as its
128         backgroundColor, which was wasteful.
129         
130         Fix by only making a background-color layer if the color is not transparent (zero alpha).
131         
132         Also avoid making a new contents layer on every color change, and make sure that
133         we don't do implicit animations for backgroundColor, and some other properties
134         that were omitted by mistake.
135
136         Layer tree dumps don't dump content layers, so no way to test easily.
137
138         * platform/graphics/ca/GraphicsLayerCA.cpp:
139         (WebCore::GraphicsLayerCA::setContentsToSolidColor):
140         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
141         (nullActionsDictionary):
142
143 2013-11-07  Ryosuke Niwa  <rniwa@webkit.org>
144
145         DOMTokenList::add can add duplicated values if arguments had duplicated values
146         https://bugs.webkit.org/show_bug.cgi?id=123962
147
148         Reviewed by Benjamin Poulain.
149
150         Merge https://chromium.googlesource.com/chromium/blink/+/bd3822ad4ae3fc5d8f89f433a7bf04f697334305
151
152         In case we do element.classList.add('a', 'a') we need to ensure that we do not add the same token twice.
153         See http://dom.spec.whatwg.org/#dom-domtokenlist-add
154
155         * html/DOMTokenList.cpp:
156         (WebCore::DOMTokenList::add): Make sure filtered tokens are unique among themselves.
157
158 2013-11-07  Eric Carlson  <eric.carlson@apple.com>
159
160         Remove npr.org specific hack in HTMLMediaElement
161         https://bugs.webkit.org/show_bug.cgi?id=123859
162
163         Reviewed by Jer Noble.
164
165         Remove the site specific hack added in r57820, it is no longer necessary.
166
167         * html/HTMLMediaElement.cpp:
168         (WebCore::HTMLMediaElement::HTMLMediaElement): Remove m_dispatchingCanPlayEvent.
169         (HTMLMediaElement::play): Don't special case npr.org.
170         * html/HTMLMediaElement.h:
171
172 2013-11-07  Simon Fraser  <simon.fraser@apple.com>
173
174         Attempt to fix the 32-bit build. Virtual thunks seem to have different
175         symbol names between 32- and 64-bit.
176         
177         * WebCore.exp.in:
178
179 2013-11-07  Ryosuke Niwa  <rniwa@webkit.org>
180
181         Crash in HTMLMediaElement::contextDestroyed
182         https://bugs.webkit.org/show_bug.cgi?id=123963
183
184         Reviewed by Eric Carlson.
185
186         Merge https://chromium.googlesource.com/chromium/blink/+/177999cdb34b707465670f0feff723922939f278
187
188         * html/HTMLMediaElement.cpp:
189         (WebCore::HTMLMediaElement::~HTMLMediaElement):
190
191 2013-11-07  Jer Noble  <jer.noble@apple.com>
192
193         [Mac] Crash at com.apple.WebCore: -[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:] + 2084 
194         https://bugs.webkit.org/show_bug.cgi?id=124012
195
196         Reviewed by Eric Carlson.
197
198         The value of the 'duration' key is a NSConcreteValue wrapping a CMTime, not a NSNumber.
199
200         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
201         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
202
203 2013-11-07  Ryosuke Niwa  <rniwa@webkit.org>
204
205         Crash when submitting form in a document with null encoding
206         https://bugs.webkit.org/show_bug.cgi?id=123975
207
208         Reviewed by Alexey Proskuryakov.
209
210         Merge https://chromium.googlesource.com/chromium/blink/+/bba01a7fff09e3053ada96ababac2a6e4261fe5f
211         
212         The CString object which is passed to normalizeLineEndingsToCRLF() can be
213         a null string. It is created in FormDataList::appendString(), and it
214         produces a null CString if FormDataList::m_encoding is a null encoding.
215
216         Test: fast/forms/form-submit-in-image-document.html
217
218         * platform/text/LineEnding.cpp:
219         (internalNormalizeLineEndingsToCRLF):
220
221 2013-11-07  Anders Carlsson  <andersca@apple.com>
222
223         Use std::function for all policy continuation functions
224         https://bugs.webkit.org/show_bug.cgi?id=124011
225
226         Reviewed by Sam Weinig.
227
228         * loader/DocumentLoader.cpp:
229         (WebCore::DocumentLoader::willSendRequest):
230         (WebCore::DocumentLoader::responseReceived):
231         * loader/DocumentLoader.h:
232         * loader/FrameLoader.cpp:
233         (WebCore::FrameLoader::loadURL):
234         (WebCore::FrameLoader::load):
235         (WebCore::FrameLoader::loadWithDocumentLoader):
236         (WebCore::FrameLoader::loadPostRequest):
237         * loader/PolicyCallback.cpp:
238         (WebCore::PolicyCallback::clear):
239         (WebCore::PolicyCallback::set):
240         (WebCore::PolicyCallback::call):
241         (WebCore::PolicyCallback::clearRequest):
242         (WebCore::PolicyCallback::cancel):
243         * loader/PolicyCallback.h:
244         * loader/PolicyChecker.cpp:
245         (WebCore::PolicyChecker::checkNavigationPolicy):
246         (WebCore::PolicyChecker::checkNewWindowPolicy):
247         (WebCore::PolicyChecker::checkContentPolicy):
248         * loader/PolicyChecker.h:
249
250 2013-11-07  Brady Eidson  <beidson@apple.com>
251
252         Use SQLite journal mode WAL (WriteAheadLogging)
253         https://bugs.webkit.org/show_bug.cgi?id=124009
254
255         Reviewed by Anders Carlsson.
256
257         WriteAheadLogging journalling is better than the traditional rollback model.
258
259         * platform/sql/SQLiteDatabase.cpp:
260         (WebCore::SQLiteDatabase::open): Use a PRAGMA to set journal_mode to WAL.
261
262 2013-11-07  Mark Lam  <mark.lam@apple.com>
263
264         Cosmetic: rename xxxId to xxxID for ScriptId, SourceId, and BreakpointId.
265         https://bugs.webkit.org/show_bug.cgi?id=123945.
266
267         Reviewed by Geoffrey Garen.
268
269         No new tests.
270
271         * bindings/js/JSInjectedScriptHostCustom.cpp:
272         (WebCore::JSInjectedScriptHost::functionDetails):
273         * bindings/js/JavaScriptCallFrame.h:
274         (WebCore::JavaScriptCallFrame::sourceID):
275         * bindings/js/ScriptDebugServer.cpp:
276         (WebCore::ScriptDebugServer::ScriptDebugServer):
277         (WebCore::ScriptDebugServer::setBreakpoint):
278         (WebCore::ScriptDebugServer::removeBreakpoint):
279         (WebCore::ScriptDebugServer::hasBreakpoint):
280         (WebCore::ScriptDebugServer::clearBreakpoints):
281         (WebCore::ScriptDebugServer::updateCallFrame):
282         (WebCore::ScriptDebugServer::pauseIfNeeded):
283         * bindings/js/ScriptDebugServer.h:
284         * inspector/InspectorConsoleAgent.cpp:
285         (WebCore::InspectorConsoleAgent::addMessageToConsole):
286         * inspector/InspectorConsoleAgent.h:
287         * inspector/InspectorConsoleInstrumentation.h:
288         (WebCore::InspectorInstrumentation::addMessageToConsole):
289         * inspector/InspectorDOMAgent.cpp:
290         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
291         * inspector/InspectorDebuggerAgent.cpp:
292         (WebCore::InspectorDebuggerAgent::setBreakpointByUrl):
293         (WebCore::parseLocation):
294         (WebCore::InspectorDebuggerAgent::setBreakpoint):
295         (WebCore::InspectorDebuggerAgent::removeBreakpoint):
296         (WebCore::InspectorDebuggerAgent::continueToLocation):
297         (WebCore::InspectorDebuggerAgent::resolveBreakpoint):
298         (WebCore::InspectorDebuggerAgent::searchInContent):
299         (WebCore::InspectorDebuggerAgent::setScriptSource):
300         (WebCore::InspectorDebuggerAgent::getScriptSource):
301         (WebCore::InspectorDebuggerAgent::compileScript):
302         (WebCore::InspectorDebuggerAgent::runScript):
303         (WebCore::InspectorDebuggerAgent::didParseSource):
304         (WebCore::InspectorDebuggerAgent::didPause):
305         (WebCore::InspectorDebuggerAgent::clear):
306         (WebCore::InspectorDebuggerAgent::reset):
307         * inspector/InspectorDebuggerAgent.h:
308         * inspector/InspectorInstrumentation.cpp:
309         (WebCore::InspectorInstrumentation::addMessageToConsoleImpl):
310         * inspector/InspectorInstrumentation.h:
311         * inspector/ScriptDebugListener.h:
312
313 2013-11-07  Cidorvan Leite  <cidorvan.leite@openbossa.org>
314
315         Avoid invalid cairo matrix when drawing surfaces too small
316         https://bugs.webkit.org/show_bug.cgi?id=123810
317
318         Drawing surfaces too small makes inverse matrix with values too big,
319         when this happen, cairo context is not valid anymore and it stops to draw anything.
320
321         Reviewed by Martin Robinson.
322
323         Test: fast/canvas/drawImage-with-small-values.html
324
325         * platform/graphics/cairo/PlatformContextCairo.cpp:
326         (WebCore::PlatformContextCairo::drawSurfaceToContext):
327
328 2013-11-07  Antti Koivisto  <antti@apple.com>
329
330         Simple line layout crashes with SVG fonts
331         https://bugs.webkit.org/show_bug.cgi?id=124002
332
333         Reviewed by Simon Fraser.
334         
335         Don't use simple line layout for flows using SVG fonts. They crash if kerning is enabled.
336
337         Test: fast/text/svg-font-simple-line-crash.html
338
339         * platform/graphics/Font.h:
340         (WebCore::Font::isSVGFont):
341         
342             Add isSVGFont() so callers don't need to go via primaryFont().
343
344         * rendering/InlineTextBox.cpp:
345         (WebCore::InlineTextBox::constructTextRun):
346         * rendering/RenderBlock.cpp:
347         (WebCore::constructTextRunInternal):
348         * rendering/SimpleLineLayout.cpp:
349         (WebCore::SimpleLineLayout::canUseFor):
350         
351             Disallow SVG fonts.
352
353         * rendering/svg/SVGInlineTextBox.cpp:
354         (WebCore::SVGInlineTextBox::constructTextRun):
355         * rendering/svg/SVGTextMetrics.cpp:
356         (WebCore::SVGTextMetrics::constructTextRun):
357         (WebCore::SVGTextMetrics::SVGTextMetrics):
358         * rendering/svg/SVGTextRunRenderingContext.h:
359         
360             Get rid of the abstract textRunNeedsRenderingContext in favor of just testing isSVGFont().
361
362 2013-11-07  Simon Fraser  <simon.fraser@apple.com>
363
364         Allow customization of the contentsScale of TileController tiles
365         https://bugs.webkit.org/show_bug.cgi?id=124004
366
367         Reviewed by Tim Horton.
368
369         On some platorms, zooming out on pages with TiledBacking compositing
370         layers can cause very high memory use, because the TiledBacking retains
371         the original page scale while the zoom is in flight, but can be asked
372         to cover a large area.
373         
374         Make it possible to reduce memory use in this case by allowing RenderLayerCompositor
375         to provide an additional scale factor for newly created tiles. Platforms can
376         then customize this to create low-res tiles when necessary.
377
378         * WebCore.exp.in:
379         * platform/graphics/GraphicsLayerClient.h:
380         (WebCore::GraphicsLayerClient::contentsScaleMultiplierForNewTiles):
381         * platform/graphics/ca/GraphicsLayerCA.cpp:
382         (WebCore::GraphicsLayerCA::platformCALayerContentsScaleMultiplierForNewTiles):
383         * platform/graphics/ca/GraphicsLayerCA.h:
384         * platform/graphics/ca/PlatformCALayerClient.h:
385         (WebCore::PlatformCALayerClient::platformCALayerContentsScaleMultiplierForNewTiles):
386         * platform/graphics/ca/mac/TileController.h:
387         * platform/graphics/ca/mac/TileController.mm:
388         (WebCore::TileController::TileController):
389         (WebCore::TileController::setScale):
390         (WebCore::TileController::createTileLayer):
391         * rendering/RenderLayerBacking.cpp:
392         (WebCore::RenderLayerBacking::contentsScaleMultiplierForNewTiles):
393         * rendering/RenderLayerBacking.h:
394         * rendering/RenderLayerCompositor.cpp:
395         (WebCore::RenderLayerCompositor::contentsScaleMultiplierForNewTiles):
396         * rendering/RenderLayerCompositor.h:
397
398 2013-11-07  Jer Noble  <jer.noble@apple.com>
399
400         Unreviewed Win build fix after r158855; wrap shapeInfoForFloat() in an ENABLE(CSS_SHAPES) guard.
401
402         * rendering/FloatingObjects.cpp:
403
404 2013-11-07  Bem Jones-Bey  <bjonesbe@adobe.com>
405
406         Refactor logical left/right offset for line methods
407         https://bugs.webkit.org/show_bug.cgi?id=123898
408
409         Reviewed by David Hyatt.
410
411         Simplify the logical left/right offset for line methods and their
412         implementation, including the ComputeFloatOffsetAdapter. This also
413         reduces the number of line offset methods in RenderBlock.
414
415         No new tests, no behavior change.
416
417         * rendering/FloatingObjects.cpp:
418         (WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter):
419         (WebCore::ComputeFloatOffsetAdapter::offset): Add a method to return
420             the offset instead of using a confusing out parameter.
421         (WebCore::::shapeOffset): Method to return the offset modified by the
422             shape delta. Moving the computation to this method allowed for
423             simplification of the users of ComputeFloatOffsetAdapter.
424         (WebCore::FloatingObjects::logicalLeftOffsetForPositioningFloat): Added this
425             method so that ShapeOutsideFloatOffsetMode isn't needed. Returns the
426             offset based on the float margin box.
427         (WebCore::FloatingObjects::logicalRightOffsetForPositioningFloat): Ditto.
428         (WebCore::FloatingObjects::logicalLeftOffset): This now only returns
429             the offset based on the shape's contour.
430         (WebCore::FloatingObjects::logicalRightOffset): Ditto.
431         (WebCore::::heightRemaining): Rename to properly follow the getter
432             naming convention.
433         * rendering/FloatingObjects.h:
434         * rendering/RenderBlock.h:
435         (WebCore::RenderBlock::logicalRightOffsetForLine): Update to remove
436             use of ShapeOutsideFloatOffsetMode and heightRemaining.
437         (WebCore::RenderBlock::logicalLeftOffsetForLine): Ditto.
438         (WebCore::RenderBlock::logicalRightFloatOffsetForLine): Ditto.
439         (WebCore::RenderBlock::logicalLeftFloatOffsetForLine): Ditto.
440         * rendering/RenderBlockFlow.cpp:
441         (WebCore::RenderBlockFlow::logicalLeftOffsetForPositioningFloat):
442             Positioning a float is the only case where the float margin box
443             should be used, and also the only case where heightRemaining is
444             needed. This handles that case.
445         (WebCore::RenderBlockFlow::logicalRightOffsetForPositioningFloat):
446             Ditto.
447         (WebCore::RenderBlockFlow::computeLogicalLocationForFloat): Update to
448             use logical(Left|Right)OffsetForPositioningFloatOnLine.
449         (WebCore::RenderBlockFlow::logicalLeftFloatOffsetForLine): Update to
450             remove use for ShapeOutsideFloatOffsetMode and heightRemaining.
451         (WebCore::RenderBlockFlow::logicalRightFloatOffsetForLine): Ditto.
452         * rendering/RenderBlockFlow.h:
453
454 2013-11-07  Alexandru Chiculita  <achicu@adobe.com>
455
456         Web Inspector: CSS Regions: Removing a content node of a ContentFlow from the DOM will send a 0 nodeId
457         https://bugs.webkit.org/show_bug.cgi?id=123577
458
459         Reviewed by Timothy Hatcher.
460
461         Test: inspector-protocol/model/content-flow-content-removal.html
462
463         Do not send unregister events for the content nodes of a flow when the element is not part of the DOM
464         anymore. We already send an unbind event, so the inspector is already notified that the node was removed.
465
466         * inspector/InspectorCSSAgent.cpp:
467         (WebCore::InspectorCSSAgent::didUnregisterNamedFlowContentElement):
468
469 2013-10-30  Jer Noble  <jer.noble@apple.com>
470
471         [MSE] Add mock MediaSource classes for testing.
472         https://bugs.webkit.org/show_bug.cgi?id=123322
473
474         Reviewed by Eric Carlson.
475
476         Tests: media/media-source/media-source-addsourcebuffer.html
477                media/media-source/media-source-append-buffer.html
478                media/media-source/media-source-canplaythrough.html
479                media/media-source/media-source-closed.html
480                media/media-source/media-source-play.html
481                media/media-source/media-source-track-enabled.html
482                media/media-source/media-source-tracks.html
483
484
485         Add mock implementation of platform MediaSource classes, allowing ports to test the
486         MediaSource API without having a platform implementation.
487
488         The MockMediaSource will support a byteformat defined in MockBox.h: a simple box-style media
489         format with an initialization segment containing a number of tracks, followed by a list of
490         samples.
491
492         Add a means to insert a new media engine factory at runtime, so the internals object can add
493         a MockMediaSourceMediaPlayer:
494         * platform/graphics/MediaPlayer.cpp:
495         (WebCore::MediaPlayerFactorySupport::callRegisterMediaEngine):
496         * platform/graphics/MediaPlayer.h:
497         * testing/Internals.cpp:
498         (WebCore::Internals::initializeMockMediaSource):
499         * testing/Internals.h:
500         * testing/Internals.idl:
501
502         For non-media-source supporting media engines, fail immediately when asked to load a media
503         source, so that the MockMediaSourceMediaPlayer will be instantiated as a fall-back:
504         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
505         (WebCore::MediaPlayerPrivateAVFoundation::load):
506         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
507         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
508         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
509         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
510         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
511         (WebCore::MediaPlayerPrivateQTKit::load):
512         (WebCore::MediaPlayerPrivateQTKit::supportsType):
513
514         Add new files to the project:
515         * WebCore.xcodeproj/project.pbxproj:
516         * Source/WebCore/WebCore.exp.in:
517
518         Update the MediaSource implementation:
519         * Modules/mediasource/MediaSource.cpp:
520         (WebCore::MediaSource::monitorSourceBuffers): Add a link to the spec.
521         * Modules/mediasource/SourceBuffer.cpp:
522         (WebCore::SourceBuffer::buffered): Ditto.
523         (WebCore::SourceBuffer::setTimestampOffset): Ditto.
524         (WebCore::SourceBuffer::validateInitializationSegment): Ditto.
525         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): Ditto. Also,
526             bring the implementation up to date with part of the spec.
527         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Remove "Predicate" from
528             SampleIsRandomAccessPredicate.
529
530         Add utility classes to parse and represent the bytestream supported by the MockMediaSource:
531         * platform/mock/mediasource/MockBox.cpp: Added.
532         (WebCore::MockBox::MockBox):
533         (WebCore::MockBox::peekType):
534         (WebCore::MockBox::peekLength):
535         (WebCore::MockTrackBox::MockTrackBox):
536         (WebCore::MockTrackBox::type):
537         (WebCore::MockInitializationBox::MockInitializationBox):
538         (WebCore::MockInitializationBox::type):
539         (WebCore::MockSampleBox::MockSampleBox):
540         (WebCore::MockSampleBox::type):
541         * platform/mock/mediasource/MockBox.h: Added.
542         (WebCore::MockBox::length):
543         (WebCore::MockBox::type):
544         (WebCore::MockTrackBox::trackID):
545         (WebCore::MockTrackBox::codec):
546         (WebCore::MockTrackBox::kind):
547         (WebCore::MockInitializationBox::duration):
548         (WebCore::MockInitializationBox::tracks):
549         (WebCore::MockSampleBox::presentationTimestamp):
550         (WebCore::MockSampleBox::decodeTimestamp):
551         (WebCore::MockSampleBox::duration):
552         (WebCore::MockSampleBox::trackID):
553         (WebCore::MockSampleBox::flags):
554         (WebCore::MockSampleBox::isSync):
555
556         Add a MediaPlayerPrivate implementation which uses MockMediaSource:
557         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp: Added.
558         (WebCore::MockMediaPlayerMediaSource::registerMediaEngine):
559         (WebCore::MockMediaPlayerMediaSource::create):
560         (WebCore::mimeTypeCache):
561         (WebCore::MockMediaPlayerMediaSource::getSupportedTypes):
562         (WebCore::MockMediaPlayerMediaSource::supportsType):
563         (WebCore::MockMediaPlayerMediaSource::MockMediaPlayerMediaSource):
564         (WebCore::MockMediaPlayerMediaSource::~MockMediaPlayerMediaSource):
565         (WebCore::MockMediaPlayerMediaSource::load):
566         (WebCore::MockMediaPlayerMediaSource::cancelLoad):
567         (WebCore::MockMediaPlayerMediaSource::play):
568         (WebCore::MockMediaPlayerMediaSource::pause):
569         (WebCore::MockMediaPlayerMediaSource::naturalSize):
570         (WebCore::MockMediaPlayerMediaSource::hasVideo):
571         (WebCore::MockMediaPlayerMediaSource::hasAudio):
572         (WebCore::MockMediaPlayerMediaSource::setVisible):
573         (WebCore::MockMediaPlayerMediaSource::seeking):
574         (WebCore::MockMediaPlayerMediaSource::paused):
575         (WebCore::MockMediaPlayerMediaSource::networkState):
576         (WebCore::MockMediaPlayerMediaSource::readyState):
577         (WebCore::MockMediaPlayerMediaSource::buffered):
578         (WebCore::MockMediaPlayerMediaSource::didLoadingProgress):
579         (WebCore::MockMediaPlayerMediaSource::setSize):
580         (WebCore::MockMediaPlayerMediaSource::paint):
581         (WebCore::MockMediaPlayerMediaSource::currentTimeDouble):
582         (WebCore::MockMediaPlayerMediaSource::durationDouble):
583         (WebCore::MockMediaPlayerMediaSource::seekDouble):
584         (WebCore::MockMediaPlayerMediaSource::advanceCurrentTime):
585         (WebCore::MockMediaPlayerMediaSource::updateDuration):
586         (WebCore::MockMediaPlayerMediaSource::setReadyState):
587         * platform/mock/mediasource/MockMediaPlayerMediaSource.h: Added.
588
589         Add a mock implementation of MediaSourcePrivate, which uses MockSourceBuffer:
590         * platform/mock/mediasource/MockMediaSourcePrivate.cpp: Added.
591         (WebCore::MockMediaSourcePrivate::create):
592         (WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate):
593         (WebCore::MockMediaSourcePrivate::~MockMediaSourcePrivate):
594         (WebCore::MockMediaSourcePrivate::addSourceBuffer):
595         (WebCore::MockMediaSourcePrivate::removeSourceBuffer):
596         (WebCore::MockMediaSourcePrivate::duration):
597         (WebCore::MockMediaSourcePrivate::setDuration):
598         (WebCore::MockMediaSourcePrivate::markEndOfStream):
599         (WebCore::MockMediaSourcePrivate::unmarkEndOfStream):
600         (WebCore::MockMediaSourcePrivate::readyState):
601         (WebCore::MockMediaSourcePrivate::setReadyState):
602         (WebCore::MockMediaSourcePrivate::sourceBufferPrivateDidChangeActiveState):
603         (WebCore::MockSourceBufferPrivateHasAudio):
604         (WebCore::MockMediaSourcePrivate::hasAudio):
605         (WebCore::MockSourceBufferPrivateHasVideo):
606         (WebCore::MockMediaSourcePrivate::hasVideo):
607         * platform/mock/mediasource/MockMediaSourcePrivate.h: Added.
608         (WebCore::MockMediaSourcePrivate::activeSourceBuffers):
609         (WebCore::MockMediaSourcePrivate::player):
610
611         Add a mock implementation of SourceBufferPrivate, which uses MockBoxes to parse the
612         bytestream provided by SourceBuffer:
613         * platform/mock/mediasource/MockSourceBufferPrivate.cpp: Added.
614         (WebCore::MockMediaSample::create):
615         (WebCore::MockMediaSample::~MockMediaSample):
616         (WebCore::MockMediaSample::MockMediaSample):
617         (WebCore::MockMediaSample::platformSample):
618         (WebCore::MockMediaDescription::create):
619         (WebCore::MockMediaDescription::~MockMediaDescription):
620         (WebCore::MockMediaDescription::MockMediaDescription):
621         (WebCore::MockSourceBufferPrivate::create):
622         (WebCore::MockSourceBufferPrivate::MockSourceBufferPrivate):
623         (WebCore::MockSourceBufferPrivate::~MockSourceBufferPrivate):
624         (WebCore::MockSourceBufferPrivate::setClient):
625         (WebCore::MockSourceBufferPrivate::append):
626         (WebCore::MockSourceBufferPrivate::didReceiveInitializationSegment):
627         (WebCore::MockSourceBufferPrivate::didReceiveSample):
628         (WebCore::MockSourceBufferPrivate::abort):
629         (WebCore::MockSourceBufferPrivate::removedFromMediaSource):
630         (WebCore::MockSourceBufferPrivate::readyState):
631         (WebCore::MockSourceBufferPrivate::setReadyState):
632         (WebCore::MockSourceBufferPrivate::hasVideo):
633         (WebCore::MockSourceBufferPrivate::hasAudio):
634         * platform/mock/mediasource/MockSourceBufferPrivate.h: Added.
635
636         Create mock implementations of AudioTrackPrivate, VideoTrackPrivate, and TextTrackPrivate
637         which wrap the MockTrackBox class:
638         * platform/mock/mediasource/MockTracks.cpp: Added.
639         * platform/mock/mediasource/MockTracks.h: Added.
640         (WebCore::MockAudioTrackPrivate::create):
641         (WebCore::MockAudioTrackPrivate::~MockAudioTrackPrivate):
642         (WebCore::MockAudioTrackPrivate::id):
643         (WebCore::MockAudioTrackPrivate::MockAudioTrackPrivate):
644         (WebCore::MockTextTrackPrivate::create):
645         (WebCore::MockTextTrackPrivate::~MockTextTrackPrivate):
646         (WebCore::MockTextTrackPrivate::id):
647         (WebCore::MockTextTrackPrivate::MockTextTrackPrivate):
648         (WebCore::MockVideoTrackPrivate::create):
649         (WebCore::MockVideoTrackPrivate::~MockVideoTrackPrivate):
650         (WebCore::MockVideoTrackPrivate::id):
651         (WebCore::MockVideoTrackPrivate::MockVideoTrackPrivate):
652
653 2013-11-07  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
654
655         Changing MediaStreamDescriptor to MediaStreamPrivate
656         https://bugs.webkit.org/show_bug.cgi?id=123935
657
658         Reviewed by Eric Carlson.
659
660         No new tests needed.
661
662         * CMakeLists.txt:
663         * GNUmakefile.list.am:
664         * Modules/mediastream/MediaStream.cpp:
665         (WebCore::MediaStream::create):
666         (WebCore::MediaStream::MediaStream):
667         (WebCore::MediaStream::~MediaStream):
668         (WebCore::MediaStream::ended):
669         (WebCore::MediaStream::setEnded):
670         (WebCore::MediaStream::addTrack):
671         (WebCore::MediaStream::removeTrack):
672         (WebCore::MediaStream::removeRemoteSource):
673         * Modules/mediastream/MediaStream.h:
674         * Modules/mediastream/MediaStreamRegistry.cpp:
675         (WebCore::MediaStreamRegistry::registerURL):
676         (WebCore::MediaStreamRegistry::unregisterURL):
677         (WebCore::MediaStreamRegistry::lookupMediaStreamPrivate):
678         * Modules/mediastream/MediaStreamRegistry.h:
679         * Modules/mediastream/MediaStreamTrack.cpp:
680         * Modules/mediastream/MediaStreamTrack.h:
681         * Modules/mediastream/RTCPeerConnection.cpp:
682         (WebCore::RTCPeerConnection::addStream):
683         (WebCore::RTCPeerConnection::removeStream):
684         (WebCore::RTCPeerConnection::didAddRemoteStream):
685         (WebCore::RTCPeerConnection::didRemoveRemoteStream):
686         * Modules/mediastream/RTCPeerConnection.h:
687         * Modules/mediastream/UserMediaRequest.cpp:
688         (WebCore::UserMediaRequest::didCreateStream):
689         (WebCore::UserMediaRequest::callSuccessHandler):
690         * Modules/mediastream/UserMediaRequest.h:
691         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
692         (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
693         * WebCore.xcodeproj/project.pbxproj:
694         * html/HTMLMediaElement.cpp:
695         (HTMLMediaElement::loadResource):
696         * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp:
697         (WebCore::toWebMediaStreamPrivate):
698         (WebCore::MediaPlayerPrivate::lookupMediaStream):
699         * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h:
700         * platform/mediastream/MediaStreamCenter.cpp:
701         * platform/mediastream/MediaStreamCreationClient.h:
702         * platform/mediastream/MediaStreamPrivate.cpp: Renamed from Source/WebCore/platform/mediastream/MediaStreamDescriptor.cpp.
703         (WebCore::MediaStreamPrivate::create):
704         (WebCore::MediaStreamPrivate::addSource):
705         (WebCore::MediaStreamPrivate::removeSource):
706         (WebCore::MediaStreamPrivate::addRemoteSource):
707         (WebCore::MediaStreamPrivate::removeRemoteSource):
708         (WebCore::MediaStreamPrivate::addRemoteTrack):
709         (WebCore::MediaStreamPrivate::removeRemoteTrack):
710         (WebCore::MediaStreamPrivate::MediaStreamPrivate):
711         (WebCore::MediaStreamPrivate::setEnded):
712         (WebCore::MediaStreamPrivate::addTrack):
713         (WebCore::MediaStreamPrivate::removeTrack):
714         * platform/mediastream/MediaStreamPrivate.h: Renamed from Source/WebCore/platform/mediastream/MediaStreamDescriptor.h.
715         (WebCore::MediaStreamPrivateClient::~MediaStreamPrivateClient):
716         (WebCore::MediaStreamPrivate::~MediaStreamPrivate):
717         (WebCore::MediaStreamPrivate::client):
718         (WebCore::MediaStreamPrivate::setClient):
719         (WebCore::MediaStreamPrivate::id):
720         (WebCore::MediaStreamPrivate::numberOfAudioSources):
721         (WebCore::MediaStreamPrivate::audioSources):
722         (WebCore::MediaStreamPrivate::numberOfVideoSources):
723         (WebCore::MediaStreamPrivate::videoSources):
724         (WebCore::MediaStreamPrivate::numberOfAudioTracks):
725         (WebCore::MediaStreamPrivate::audioTracks):
726         (WebCore::MediaStreamPrivate::numberOfVideoTracks):
727         (WebCore::MediaStreamPrivate::videoTracks):
728         (WebCore::MediaStreamPrivate::ended):
729         * platform/mediastream/MediaStreamSource.cpp:
730         * platform/mediastream/MediaStreamSource.h:
731         * platform/mediastream/RTCPeerConnectionHandler.h:
732         * platform/mediastream/RTCPeerConnectionHandlerClient.h:
733         * platform/mediastream/blackberry/MediaStreamCenterBlackBerry.cpp:
734         * platform/mediastream/blackberry/MediaStreamCenterBlackBerry.h:
735         * platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp:
736         * platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h:
737         * platform/mediastream/mac/MediaStreamCenterMac.cpp:
738         (WebCore::MediaStreamCenterMac::createMediaStream):
739         * platform/mock/MockMediaStreamCenter.cpp:
740         (WebCore::MockMediaStreamCenter::createMediaStream):
741         * platform/mock/RTCPeerConnectionHandlerMock.cpp:
742         (WebCore::RTCPeerConnectionHandlerMock::addStream):
743         (WebCore::RTCPeerConnectionHandlerMock::removeStream):
744         * platform/mock/RTCPeerConnectionHandlerMock.h:
745
746 2013-11-07  Denis Nomiyama  <d.nomiyama@samsung.com>
747
748         [GTK] Glyphs in vertical text tests are rotated 90 degrees clockwise
749         https://bugs.webkit.org/show_bug.cgi?id=50619
750
751         Reviewed by Martin Robinson.
752
753         Implemented the OPENTYPE_VERTICAL feature for the GTK+ port. It resolves
754         the 90 degrees rotation problem of CJK characters when displaying
755         vertical text.
756
757         New tests are not required as the existing tests for vertical text will
758         work properly now.
759
760         * GNUmakefile.list.am: Added OpenTypeVerticalData.cpp and
761         OpenTypeVerticalData.h to platformgtk_sources.
762         * PlatformEfl.cmake: Added OpenTypeVerticalData.cpp.
763         * PlatformGTK.cmake: Added OpenTypeVerticalData.cpp.
764         * platform/graphics/FontCache.cpp: Originally the HashMap for
765         OpenTypeVerticalData was designed with FontFileKey as integer in the
766         Chromium port, which was an unique number provided by Skia. Since other
767         ports use FontFileKey as string, new generic hash functions had to be
768         implemented instead of using the specific ones for integers.
769         (WebCore::FontVerticalDataCacheKeyHash::hash): New hash function for
770         HashMap of OpenTypeVerticalData.
771         (WebCore::FontVerticalDataCacheKeyHash::equal): New function for
772         comparing hash indexes in the HashMap of OpenTypeVerticalData.
773         (WebCore::FontVerticalDataCacheKeyTraits::emptyValue): New function for
774         giving an empty FontFileKey.
775         (WebCore::FontVerticalDataCacheKeyTraits::constructDeletedValue): New
776         function to create a FontFileKey for deleted values.
777         (WebCore::FontVerticalDataCacheKeyTraits::isDeletedValue): New function
778         to check if a HashMap entry is available.
779         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
780         (WebCore::FontCustomPlatformData::fontPlatformData): Added font
781         orientation as a parameter to the FontPlatformData constructor.
782         * platform/graphics/freetype/FontPlatformData.h: Added m_orientation to
783         store the font orientation and m_horizontalOrientationMatrix to store
784         the Cairo matrix for horizontal orientation, which can be restored in
785         setOrientation().
786         (WebCore::FontPlatformData::FontPlatformData): Added font orientation as
787         a parameter.
788         (WebCore::FontPlatformData::orientation): Implemented this function
789         based on m_orientation.
790         * platform/graphics/freetype/FontPlatformDataFreeType.cpp: Added new
791         helper function rotateCairoMatrixForVerticalOrientation() to rotate the
792         Cairo matrix in case of vertical orientation.
793         (WebCore::FontPlatformData::FontPlatformData): Initialized
794         m_orientation.
795         (WebCore::FontPlatformData::operator=): Added m_orientation and
796         m_horizontalOrientationMatrix to the assignment operator.
797         (WebCore::FontPlatformData::operator==): Added m_orientation to the
798         equal operator.
799         (WebCore::FontPlatformData::initializeWithFontFace): Rotated and
800         translated fonts if orientation is vertical. Also stored the horizontal
801         Cairo matrix.
802         (WebCore::FontPlatformData::verticalData): Returned the vertical data
803         from the font cache.
804         (WebCore::FontPlatformData::openTypeTable): Loaded the font table into
805         a shared buffer.
806         (WebCore::FontPlatformData::setOrientation): Replaced the scaled font
807         data by rotating fonts according to the new orientation.
808         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
809         (WebCore::SimpleFontData::platformInit): Set the glyph's height and
810         width according to the font orientation. It also sets EM.
811         (WebCore::SimpleFontData::platformCreateScaledFontData): Added
812         orientation to the FontPlatformData constructor.
813         (WebCore::SimpleFontData::platformWidthForGlyph): Returned the glyph's
814         width according the orientation.
815         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
816         (WebCore::CairoGetGlyphWidthAndExtents): Obtained the character advance
817         and extents according to the font orientation.
818
819 2013-11-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
820
821         [AX] Use toAccessibilityRenderObject() instead of using static_cast<>
822         https://bugs.webkit.org/show_bug.cgi?id=123986
823
824         Reviewed by Mario Sanchez Prada.
825
826         Though there is toAccessibilityRenderObject(), static_cast<> are being used by many places.
827         To use toAccessibilityRenderObject() is more helpful to find bad type cast.
828
829         No new tests, no behavior changes.
830
831         * accessibility/AXObjectCache.cpp:
832         (WebCore::AXObjectCache::notificationPostTimerFired):
833         * accessibility/AccessibilityImageMapLink.cpp:
834         (WebCore::AccessibilityImageMapLink::imageMapLinkRenderer):
835         * accessibility/AccessibilityRenderObject.cpp:
836         (WebCore::AccessibilityRenderObject::handleActiveDescendantChanged):
837         (WebCore::AccessibilityRenderObject::inheritsPresentationalRole):
838         * accessibility/ios/AccessibilityObjectIOS.mm:
839         (WebCore::AccessibilityObject::accessibilityPasswordFieldLength):
840         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
841         (AXAttributeStringSetElement):
842         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
843
844 2013-11-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
845
846         [AX] Use toAccessibilityTable() instead of using manual static_cast<>
847         https://bugs.webkit.org/show_bug.cgi?id=123982
848
849         Reviewed by Mario Sanchez Prada.
850
851         Though there is toAccessibilityTable(), static_cast<> are being used by many places.
852         We need to use toAccessibilityTable().
853
854         No new tests, no behavior changes.
855
856         * accessibility/AccessibilityARIAGridRow.cpp:
857         (WebCore::AccessibilityARIAGridRow::disclosedRows):
858         (WebCore::AccessibilityARIAGridRow::disclosedByRow):
859         * accessibility/AccessibilityTableHeaderContainer.cpp:
860         (WebCore::AccessibilityTableHeaderContainer::addChildren):
861         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
862         (cell):
863         (cellAtIndex):
864         (webkitAccessibleTableGetIndexAt):
865         (webkitAccessibleTableGetNColumns):
866         (webkitAccessibleTableGetNRows):
867         (webkitAccessibleTableGetColumnHeader):
868         (webkitAccessibleTableGetRowHeader):
869         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
870         (-[WebAccessibilityObjectWrapper tableParent]):
871         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
872         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
873         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
874         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
875
876 2013-11-07  Andreas Kling  <akling@apple.com>
877
878         Use tighter InlineBox subtypes in some places.
879         <https://webkit.org/b/123980>
880
881         RenderLineBreak and RenderBox line box wrappers are always going to
882         be InlineElementBox, so codify this with tighter types. Also made
883         the various positionLine() functions take tighter reference types.
884
885         All the casting to renderer-appropriate box types happens inside of
886         RenderBlockFlow::computeBlockDirectionPositionsForLine() and
887         propagates from there.
888
889         Reviewed by Antti Koivisto.
890
891 2013-11-07  Mario Sanchez Prada  <mario.prada@samsung.com>
892
893         AX: [ATK] Video and audio elements are not properly exposed
894         https://bugs.webkit.org/show_bug.cgi?id=123894
895
896         Reviewed by Chris Fleizach.
897
898         Expose <audio> and <video> elements with ATK_ROLE_EMBEDDED, so we
899         can identify them properly from ATK/AT-SPI based ATs.
900
901         Tests: platform/gtk/accessibility/media-controls-panel-title.html
902                platform/efl/accessibility/media-emits-object-replacement.html
903                platform/gtk/accessibility/media-emits-object-replacement.html
904
905         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
906         (atkRole): Add the new mapping.
907
908 2013-11-07  Laszlo Vidacs  <lac@inf.u-szeged.hu>
909         
910         Fix crash in BitmapImage::destroyDecodedData()
911         https://bugs.webkit.org/show_bug.cgi?id=116494
912
913         Reviewed by Csaba Osztrogonác.
914
915         Merge from https://chromium.googlesource.com/chromium/blink/+/6b6887bf53068f8537908e501fdc7317ad2c6d86
916
917         * platform/graphics/BitmapImage.cpp:
918         (WebCore::BitmapImage::destroyDecodedData):
919
920 2013-11-06  Sergio Villar Senin  <svillar@igalia.com>
921
922         [CSS Grid Layout] CSSParser should reject <track-list> without a <track-size>
923         https://bugs.webkit.org/show_bug.cgi?id=118025
924
925         Reviewed by Andreas Kling.
926
927         From Blink r152914 by <jchaffraix@chromium.org>
928
929         Make sure that we parse at least 1 <track-size> inside each
930         <track-list>. The old parser code allowed track-lists exclusively
931         made of <track-name>. The way it was implemented eases the future
932         addition of parsing for the repeat() function.
933
934         * css/CSSParser.cpp:
935         (WebCore::CSSParser::parseGridTrackList):
936         * css/StyleResolver.cpp:
937         (WebCore::createGridTrackList): ASSERT if we don't find any
938         <track-size> now that we detect their absence in the parser.
939
940 2013-11-06  Sergio Villar Senin  <svillar@igalia.com>
941
942         [CSS Grid Layout] Fix handling of 'inherit' and 'initial' for grid lines
943         https://bugs.webkit.org/show_bug.cgi?id=115401
944
945         Reviewed by Andreas Kling.
946
947         From Blink r150585 by <jchaffraix@chromium.org>
948
949         Added support for 'inherit' and 'initial' special values to
950         grid-auto-{columns|rows} and grid-definition-{columns|rows}.
951
952         * css/StyleResolver.cpp:
953         (WebCore::StyleResolver::applyProperty): Resolve 'initial' and 'inherit'.
954         * rendering/style/RenderStyle.h: Added initialNamedGrid{Column|Row}Lines().
955         * rendering/style/StyleGridData.cpp:
956         (WebCore::StyleGridData::StyleGridData): Initialize m_namedGrid{Column|Row}Lines.
957
958 2013-11-07  Andreas Kling  <akling@apple.com>
959
960         Clean up BidiRun a little bit.
961         <https://webkit.org/b/123964>
962
963         Make BidiRun's member variables private and add accessors for them.
964         In doing so, codify the following:
965
966             - BidiRun always has a corresponding RenderObject.
967             - The inline box is never cleared after being set.
968
969         Reviewed by Antti Koivisto.
970
971 2013-11-07  Andreas Kling  <akling@apple.com>
972
973         More CSSPrimitiveValue constructors should return PassRef.
974         <https://webkit.org/b/123953>
975
976         Make some more CSSPrimitiveValue constructor helpers (that are
977         known to never return null) return PassRef instead of PassRefPtr.
978
979         Reviewed by Antti Koivisto.
980
981 2013-11-07  Andreas Kling  <akling@apple.com>
982
983         Generate type casting helpers for line boxes and use them.
984         <https://webkit.org/b/123976>
985
986         Semi-automatically generate the full set of toFooInlineBox()
987         helpers with macros instead of having them (partially) hand-coded.
988         Replaced static_casts with the new helpers across the codebase.
989
990         Also made the isFooInlineBox() overrides private since they should
991         never be called when the type is already known.
992
993         Reviewed by Antti Koivisto.
994
995 2013-11-07  Ryosuke Niwa  <rniwa@webkit.org>
996
997         Simplify Attr by removing m_specified member variable and setter
998         https://bugs.webkit.org/show_bug.cgi?id=123965
999
1000         Reviewed by Andreas Kling.
1001
1002         Merge https://chromium.googlesource.com/chromium/blink/+/597f44ec928e08820574728889adabc6d8ecd746
1003
1004         m_specified is always true in WebKit so simply return true in Attr::specified().
1005
1006         * dom/Attr.cpp:
1007         (WebCore::Attr::Attr):
1008         * dom/Attr.h:
1009         * dom/Document.cpp:
1010         (WebCore::Document::adoptNode):
1011
1012 2013-10-25  Jer Noble  <jer.noble@apple.com>
1013
1014         [MSE] Add MediaSource extensions to AudioTrack, VideoTrack, and TextTrack.
1015         https://bugs.webkit.org/show_bug.cgi?id=123374
1016
1017         Reviewed by Eric Carlson.
1018
1019         No tests added; tests will be added when Mock implementations are added in a future patch.
1020
1021         Add new partial interfaces for added methods on AudioTrack, TextTrack, and VideoTrack:
1022         * Modules/mediasource/AudioTrackMediaSource.idl: Add read-only sourceBuffer attribute.
1023         * Modules/mediasource/TextTrackMediaSource.idl: Ditto.
1024         * Modules/mediasource/VideoTrackMediaSource.idl: Ditto.
1025         * Modules/mediasource/AudioTrackMediaSource.h:
1026         (WebCore::AudioTrackMediaSource::sourceBuffer): Added static wrapper around non-static sourceBuffer().
1027         * Modules/mediasource/TextTrackMediaSource.h:
1028         (WebCore::TextTrackMediaSource::sourceBuffer): Ditto.
1029         * Modules/mediasource/VideoTrackMediaSource.h:
1030         (WebCore::VideoTrackMediaSource::sourceBuffer): Ditto.
1031
1032         Add support for writable kind & language attributes through a custom setter:
1033         * bindings/js/JSAudioTrackCustom.cpp:
1034         (WebCore::JSAudioTrack::setKind):
1035         (WebCore::JSAudioTrack::setLanguage):
1036         * bindings/js/JSTextTrackCustom.cpp:
1037         (WebCore::JSTextTrack::setKind):
1038         (WebCore::JSTextTrack::setLanguage):
1039         * bindings/js/JSVideoTrackCustom.cpp:
1040         (WebCore::JSVideoTrack::setKind):
1041         (WebCore::JSVideoTrack::setLanguage):
1042         * html/track/AudioTrack.idl:
1043         * html/track/TextTrack.idl:
1044         * html/track/VideoTrack.idl:
1045
1046         Add setter methods to the implementation classes:
1047         * html/track/TextTrack.cpp:
1048         (WebCore::TextTrack::TextTrack):
1049         (WebCore::TextTrack::setKind):
1050         (WebCore::TextTrack::setLanguage):
1051         * html/track/TextTrack.h:
1052         * html/track/TrackBase.cpp:
1053         (WebCore::TrackBase::TrackBase):
1054         (WebCore::TrackBase::setKind):
1055         (WebCore::TrackBase::setKindInternal):
1056         * html/track/TrackBase.h:
1057         (WebCore::TrackBase::setLanguage):
1058         (WebCore::TrackBase::sourceBuffer):
1059         (WebCore::TrackBase::setSourceBuffer):
1060         * html/track/VideoTrack.cpp:
1061         (WebCore::VideoTrack::VideoTrack):
1062         (WebCore::VideoTrack::setKind):
1063         (WebCore::VideoTrack::setLanguage):
1064         * html/track/VideoTrack.h:
1065
1066         Implement the unimplemented portions of MediaSource and SourceBuffer:
1067         * Modules/mediasource/MediaSource.cpp:
1068         (WebCore::MediaSource::removeSourceBuffer):
1069         * Modules/mediasource/MediaSourceBase.cpp:
1070         (WebCore::MediaSourceBase::MediaSourceBase):
1071         (WebCore::MediaSourceBase::setPrivateAndOpen):
1072         (WebCore::MediaSourceBase::setReadyState):
1073         (WebCore::MediaSourceBase::attachToElement):
1074         * Modules/mediasource/MediaSourceBase.h:
1075         (WebCore::MediaSourceBase::mediaElement):
1076         * Modules/mediasource/SourceBuffer.cpp:
1077         (WebCore::SourceBuffer::videoTracks):
1078         (WebCore::SourceBuffer::audioTracks):
1079         (WebCore::SourceBuffer::textTracks):
1080         (WebCore::SourceBuffer::sourceBufferPrivateDidAddAudioTrack):
1081         (WebCore::SourceBuffer::sourceBufferPrivateDidAddVideoTrack):
1082         (WebCore::SourceBuffer::sourceBufferPrivateDidAddTextTrack):
1083         (WebCore::SourceBuffer::sourceBufferPrivateDidChangeActiveState):
1084         * Modules/mediasource/SourceBuffer.h:
1085         * Modules/mediasource/SourceBuffer.idl:
1086
1087         Add new files to the project:
1088         * DerivedSources.make:
1089         * WebCore.xcodeproj/project.pbxproj:
1090
1091         And a smorgasbord of other utility changes:
1092         * html/HTMLMediaElement.cpp:
1093         (WebCore::HTMLMediaElement::loadResource): Pass this when attaching.
1094         (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack): Ditto.
1095         * html/HTMLMediaSource.h:
1096         * html/track/TextTrackList.cpp:
1097         (TextTrackList::item): Make const.
1098         * html/track/TextTrackList.h:
1099         (WebCore::TextTrackList::lastItem): Added.
1100         * platform/graphics/InbandTextTrackPrivate.h:
1101         (WebCore::InbandTextTrackPrivate::create): Added.
1102         (WebCore::MockSourceBufferPrivate::trackDidChangeEnabled):
1103
1104 2013-11-06  Vani Hegde  <vani.hegde@samsung.com>
1105
1106         Applied background color is not retained after typing a characters
1107         https://bugs.webkit.org/show_bug.cgi?id=117337
1108
1109         Reviewed by Ryosuke Niwa.
1110
1111         While deleting a selection, only the inheritable style properties
1112         applied on the selection were saved.
1113         Since background color is considered as noninheritable style property,
1114         on deleting the selection, background color set on it was being lost.
1115         Hence on typing in new text, it would not have the applied
1116         background color set.
1117         Fixed by saving editing preoperties that are already in effect
1118         on a selection before deleting it.
1119
1120         Test: editing/style/background-color-retained.html
1121
1122         * editing/DeleteSelectionCommand.cpp:
1123         (WebCore::DeleteSelectionCommand::saveTypingStyleState):
1124         Modified as to save EditingPropertiesInEffect on a selection before
1125         deleting it.
1126
1127 2013-11-06  Andreas Kling  <akling@apple.com>
1128
1129         InlineBox: Make paint() and nodeAtPoint() pure virtuals.
1130         <https://webkit.org/b/123937>
1131
1132         ...and move the current implementations to InlineElementBox.
1133         All subclasses were already overriding these functions so the move
1134         is completely natural.
1135
1136         Reviewed by Anders Carlsson.
1137
1138 2013-11-06  Andreas Kling  <akling@apple.com>
1139
1140         Nothing should return std::unique_ptr<InlineBox>.
1141         <https://webkit.org/b/123936>
1142
1143         Made RenderBox, RenderLineBreak and RenderListMarker return tightly
1144         typed InlineElementBoxes instead.
1145
1146         Reviewed by Anders Carlsson.
1147
1148 2013-11-06  Daniel Bates  <dabates@apple.com>
1149
1150         [iOS] Upstream Letterpress effect
1151         https://bugs.webkit.org/show_bug.cgi?id=123932
1152
1153         Reviewed by Sam Weinig.
1154
1155         Test: platform/iphone-simulator/iphone/getComputedStyle-text-decoration-letterpress.html
1156
1157         * Configurations/FeatureDefines.xcconfig: Add feature define ENABLE_LETTERPRESS disabled
1158         by default. We only enable letterpress on iOS.
1159         * css/CSSComputedStyleDeclaration.cpp:
1160         (WebCore::renderTextDecorationFlagsToCSSValue): Add support for CSS value -webkit-letterpress.
1161         * css/CSSParser.cpp:
1162         (WebCore::CSSParser::parseTextDecoration): Ditto.
1163         * css/CSSPrimitiveValueMappings.h:
1164         (WebCore::CSSPrimitiveValue::operator TextDecoration): Ditto.
1165         * css/CSSValueKeywords.in: Added CSS value -webkit-letterpress.
1166         * platform/graphics/GraphicsContext.h:
1167         * platform/graphics/mac/FontMac.mm:
1168         (WebCore::fillVectorWithHorizontalGlyphPositions): Added.
1169         (WebCore::shouldUseLetterpressEffect): Added.
1170         (WebCore::showLetterpressedGlyphsWithAdvances): Added.
1171         (WebCore::showGlyphsWithAdvances): Modified to call showLetterpressedGlyphsWithAdvances()
1172         to show a letterpressed glyph. I also included additional iOS-specific changes.
1173         (WebCore::Font::drawGlyphs):
1174         * rendering/TextPaintStyle.cpp:
1175         (WebCore::TextPaintStyle::TextPaintStyle): 
1176         (WebCore::computeTextPaintStyle): Modified to compute letterpress effect style.
1177         (WebCore::updateGraphicsContext): Modified to apply/unapply letterpress effect drawing mode.
1178         * rendering/TextPaintStyle.h:
1179         * rendering/style/RenderStyleConstants.h:
1180
1181 2013-11-06  Ryosuke Niwa  <rniwa@webkit.org>
1182
1183         Crash in SliderThumbElement::dragFrom
1184         https://bugs.webkit.org/show_bug.cgi?id=123873
1185
1186         Reviewed by Sam Weinig.
1187
1188         Moved Ref.
1189
1190         * html/RangeInputType.cpp:
1191         (WebCore::RangeInputType::handleMouseDownEvent):
1192         * html/shadow/SliderThumbElement.cpp:
1193         (WebCore::SliderThumbElement::dragFrom):
1194
1195 2013-11-06  Daniel Bates  <dabates@apple.com>
1196
1197         Cleanup FontMac.mm
1198         https://bugs.webkit.org/show_bug.cgi?id=123928
1199
1200         Reviewed by Andy Estes.
1201
1202         * platform/graphics/mac/FontMac.mm:
1203         (WebCore::showGlyphsWithAdvances): Inline the value of variable isVertical as we
1204         reference it exactly once and its value is sufficiently clear.
1205         (WebCore::Font::drawGlyphs): Remove default case in switch block so that the compiler
1206         checks that all cases are covered. Move definition of platformData to the top of the
1207         function and use it whenever we want to access the platform font data
1208
1209 2013-11-06  Brent Fulgham  <bfulgham@apple.com>
1210
1211         [WebGL] We should not allow generateMipMap on compressed textures
1212         https://bugs.webkit.org/show_bug.cgi?id=123915
1213         <rdar://problem/15201274>
1214
1215         Reviewed by Dean Jackson.
1216
1217         Found by existing conformance/extensions/webgl-compressed-texture-s3tc.html
1218
1219         * html/canvas/WebGLRenderingContext.cpp:
1220         (WebCore::WebGLRenderingContext::compressedTexImage2D): Set compressed flag.
1221         (WebCore::WebGLRenderingContext::compressedTexSubImage2D): Ditto.
1222         (WebCore::WebGLRenderingContext::generateMipmap): For Apple builds, check state
1223         of compressed flag and generate appropriate WebGL error if necessary.
1224         * html/canvas/WebGLTexture.cpp:
1225         (WebCore::WebGLTexture::WebGLTexture): Set compressed flag to false by default
1226         (WebCore::WebGLTexture::isCompressed): Added
1227         (WebCore::WebGLTexture::setCompressed): Added
1228         * html/canvas/WebGLTexture.h:
1229         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1230         (WebCore::GraphicsContext3D::generateMipmap): Switch implementation to use proper
1231         glGenerateMipmaps, rather than the glGenerateMipmapsEXT method.
1232
1233 2013-11-06  Joseph Pecoraro  <pecoraro@apple.com>
1234
1235         Web Inspector: Changes to CodeGeneratorInspectorStrings.py should rebuild inspector generated files
1236         https://bugs.webkit.org/show_bug.cgi?id=123925
1237
1238         Reviewed by Timothy Hatcher.
1239
1240         * CMakeLists.txt:
1241         * DerivedSources.make:
1242         * GNUmakefile.am:
1243
1244 2013-11-06  Bem Jones-Bey  <bjonesbe@adobe.com>
1245
1246         Rename region line offset methods
1247         https://bugs.webkit.org/show_bug.cgi?id=123897
1248
1249         Reviewed by Sam Weinig.
1250
1251         Because of the large number of overloads on the line offset methods,
1252         it is very hard to read code using them, which also makes it harder to
1253         move them out of RenderBlock. This patch renames the methods that take
1254         a region as an argument to make it clearer when looking at the code
1255         how the differ from the ones that don't.
1256
1257         No new tests, no behavior change.
1258
1259         * rendering/RenderBlock.cpp:
1260         (WebCore::RenderBlock::computeStartPositionDeltaForChildAvoidingFloats):
1261         * rendering/RenderBlock.h:
1262         (WebCore::RenderBlock::availableLogicalWidthForLineInRegion):
1263         (WebCore::RenderBlock::logicalRightOffsetForLineInRegion):
1264         (WebCore::RenderBlock::logicalLeftOffsetForLineInRegion):
1265         (WebCore::RenderBlock::startOffsetForLineInRegion):
1266         (WebCore::RenderBlock::endOffsetForLineInRegion):
1267         (WebCore::RenderBlock::availableLogicalWidthForLine):
1268         * rendering/RenderBox.cpp:
1269         (WebCore::RenderBox::shrinkLogicalWidthToAvoidFloats):
1270         (WebCore::RenderBox::containingBlockAvailableLineWidthInRegion):
1271
1272 2013-11-06  Antti Koivisto  <antti@apple.com>
1273
1274         HTMLCollection should use CollectionIndexCache
1275         https://bugs.webkit.org/show_bug.cgi?id=123906
1276
1277         Reviewed by Ryosuke Niwa.
1278         
1279         More code sharing.
1280
1281         * bindings/js/JSDOMWindowCustom.cpp:
1282         (WebCore::namedItemGetter):
1283         * bindings/js/JSHTMLDocumentCustom.cpp:
1284         (WebCore::JSHTMLDocument::nameGetter):
1285         * dom/ChildNodeList.h:
1286         * dom/CollectionIndexCache.h:
1287         (WebCore::::nodeBeforeCached):
1288         (WebCore::::nodeAfterCached):
1289         (WebCore::::nodeAt):
1290             
1291             Add a mechanism for disabling use of backward traversal.
1292
1293         * dom/LiveNodeList.h:
1294         (WebCore::LiveNodeList::collectionCanTraverseBackward):
1295         * html/HTMLCollection.cpp:
1296         (WebCore::HTMLCollection::HTMLCollection):
1297         (WebCore::isMatchingElement):
1298         (WebCore::HTMLCollection::iterateForPreviousElement):
1299         (WebCore::firstMatchingElement):
1300         (WebCore::nextMatchingElement):
1301         (WebCore::HTMLCollection::length):
1302         (WebCore::HTMLCollection::item):
1303         (WebCore::nameShouldBeVisibleInDocumentAll):
1304         (WebCore::firstMatchingChildElement):
1305         (WebCore::nextMatchingSiblingElement):
1306         (WebCore::HTMLCollection::firstElement):
1307         (WebCore::HTMLCollection::traverseForward):
1308         (WebCore::HTMLCollection::collectionFirst):
1309         (WebCore::HTMLCollection::collectionLast):
1310         (WebCore::HTMLCollection::collectionTraverseForward):
1311         (WebCore::HTMLCollection::collectionTraverseBackward):
1312         (WebCore::HTMLCollection::invalidateCache):
1313         (WebCore::HTMLCollection::namedItem):
1314         (WebCore::HTMLCollection::updateNameCache):
1315         * html/HTMLCollection.h:
1316         (WebCore::HTMLCollection::collectionCanTraverseBackward):
1317         
1318             Disable use of backward traversal for collections that use custom traversal.
1319
1320 2013-11-06  Brendan Long  <b.long@cablelabs.com>
1321
1322         Add "id" attribute to TextTrack
1323         https://bugs.webkit.org/show_bug.cgi?id=123825
1324
1325         Reviewed by Eric Carlson.
1326
1327         Test: media/track/track-id.html
1328
1329         * html/HTMLMediaElement.cpp:
1330         (HTMLMediaElement::addTextTrack): Add emptyString() for track id.
1331         * html/track/AudioTrack.cpp:
1332         (WebCore::AudioTrack::AudioTrack): Pass trackPrivate->id() to TrackBase.
1333         (WebCore::AudioTrack::idChanged): Added, set id.
1334         * html/track/AudioTrack.h: Move m_id to TrackBase.
1335         * html/track/InbandTextTrack.cpp:
1336         (WebCore::InbandTextTrack::InbandTextTrack): Pass trackPrivate->id() to TrackBase.
1337         (WebCore::InbandTextTrack::idChanged): Added, set id.
1338         * html/track/InbandTextTrack.h: Add idChanged().
1339         * html/track/LoadableTextTrack.cpp:
1340         (WebCore::LoadableTextTrack::LoadableTextTrack): Add emptyString() for track id.
1341         (WebCore::LoadableTextTrack::id): Override to return the track element's id.
1342         * html/track/TextTrack.cpp:
1343         (WebCore::TextTrack::captionMenuOffItem): Add empty string for track id.
1344         (WebCore::TextTrack::captionMenuAutomaticItem): Add empty string for track id.
1345         (WebCore::TextTrack::TextTrack): Pass id to TrackBase.
1346         * html/track/TextTrack.h:
1347         (WebCore::TextTrack::create): Add id parameter.
1348         * html/track/TextTrack.idl: Add id attribute.
1349         * html/track/TrackBase.cpp:
1350         (WebCore::TrackBase::TrackBase): Add m_id.
1351         * html/track/TrackBase.h: Add id attribute / m_id.
1352         * html/track/VideoTrack.cpp:
1353         (WebCore::VideoTrack::VideoTrack): Pass trackPrivate->id() to TrackBase.
1354         (WebCore::VideoTrack::idChanged): Added, set id.
1355         * html/track/VideoTrack.h: Move m_id to TrackBase.
1356         * platform/graphics/TrackPrivateBase.h: Add idChanged() callback.
1357
1358 2013-11-06  Antti Koivisto  <antti@apple.com>
1359
1360         Move array position caching out from HTMLCollection
1361         https://bugs.webkit.org/show_bug.cgi?id=123895
1362
1363         Reviewed by Darin Adler.
1364
1365         This caching complicates the logic but is used by a single subclass
1366         (HTMLFormControlsCollection) only. The subclass can do the caching itself.
1367
1368         * html/HTMLAllCollection.cpp:
1369         (WebCore::HTMLAllCollection::HTMLAllCollection):
1370         * html/HTMLCollection.cpp:
1371         (WebCore::HTMLCollection::HTMLCollection):
1372         (WebCore::HTMLCollection::create):
1373         (WebCore::HTMLCollection::item):
1374         (WebCore::HTMLCollection::elementBeforeOrAfterCachedElement):
1375         (WebCore::HTMLCollection::firstElement):
1376         
1377             Renamed from traverseFirstElement.
1378
1379         (WebCore::HTMLCollection::traverseForwardToOffset):
1380         (WebCore::HTMLCollection::invalidateCache):
1381         
1382             Make cache invalidation virtual so we can clear HTMLTableRowsCollection index cache.
1383
1384         (WebCore::HTMLCollection::namedItem):
1385         (WebCore::HTMLCollection::updateNameCache):
1386         
1387             Use traverseForwardToOffset instead traverseNextElement. This allows removal of traverseNextElement.
1388
1389         * html/HTMLCollection.h:
1390         (WebCore::HTMLCollection::usesCustomForwardOnlyTraversal):
1391         
1392             Renamed the enum and the accessor to be more informative.
1393
1394         (WebCore::HTMLCollection::setCachedElement):
1395         (WebCore::HTMLCollection::customElementAfter):
1396         
1397             Renamed from virtualItemAfter.
1398
1399         * html/HTMLFormControlsCollection.cpp:
1400         (WebCore::HTMLFormControlsCollection::HTMLFormControlsCollection):
1401         (WebCore::findFormAssociatedElement):
1402         (WebCore::HTMLFormControlsCollection::customElementAfter):
1403         
1404             Move the array position caching logic here.
1405
1406         (WebCore::HTMLFormControlsCollection::invalidateCache):
1407         * html/HTMLFormControlsCollection.h:
1408         * html/HTMLNameCollection.cpp:
1409         (WebCore::HTMLNameCollection::HTMLNameCollection):
1410         * html/HTMLOptionsCollection.cpp:
1411         (WebCore::HTMLOptionsCollection::HTMLOptionsCollection):
1412         * html/HTMLTableRowsCollection.cpp:
1413         (WebCore::HTMLTableRowsCollection::HTMLTableRowsCollection):
1414         (WebCore::HTMLTableRowsCollection::customElementAfter):
1415         * html/HTMLTableRowsCollection.h:
1416
1417 2013-11-06  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
1418
1419         [ATK] accessibility/title-ui-element-correctness.html fails
1420         https://bugs.webkit.org/show_bug.cgi?id=99825
1421
1422         Reviewed by Mario Sanchez Prada.
1423
1424         When calling setAtkRelationSetFromCoreObject a new ATK_LABELLED_BY_RELATION
1425         is added, adding proper label element as a relation. When the document structure
1426         has been changed and a different label should be linked as a relation, current ATK
1427         implementation adds it as a next target on relation's target list, while
1428         WTR/DumpRenderTree implementation takes only first one into account.
1429         This patch adds a new function removing current relations before adding new ones.
1430
1431         Covered by existing tests.
1432
1433         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1434         (removeAtkRelationFromRelationSetByType):
1435         (setAtkRelationSetFromCoreObject):
1436
1437 2013-11-06  Daniel Bates  <dabates@apple.com>
1438
1439         Add ENABLE(TEXT_SELECTION)
1440         https://bugs.webkit.org/show_bug.cgi?id=123827
1441
1442         Reviewed by Ryosuke Niwa.
1443
1444         Add compile-time guard, ENABLE(TEXT_SELECTION), to enable or
1445         disable selection painting in WebCore (enabled by default).
1446
1447         On iOS we disable WebCore selection painting and have UIKit
1448         paint the selection.
1449
1450         * rendering/InlineTextBox.cpp:
1451         (WebCore::InlineTextBox::paintSelection): Only paint selection when
1452         TEXT_SELECTION is enabled.
1453         * rendering/LogicalSelectionOffsetCaches.h:
1454         (WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches):
1455         For now, add a ENABLE(TEXT_SELECTION)-guard around an assertion. Added
1456         a FIXME comment to investigate the callers and either move the assertion
1457         to the appropriate callers or structure the code such that we can remove
1458         the assertion.
1459         * rendering/RenderBlock.cpp:
1460         (WebCore::RenderBlock::paintSelection): Only paint selection when
1461         TEXT_SELECTION is enabled.
1462         * rendering/TextPaintStyle.cpp:
1463         (WebCore::computeTextSelectionPaintStyle): Only compute the selection
1464         paint style when TEXT_SELECTION is enabled. Otherwise, return a paint
1465         style identical to the text paint style. Also, substitute nullptr for 0.
1466
1467 2013-11-06  Jer Noble  <jer.noble@apple.com>
1468
1469         Unrevewied Windows build fix after r158736; add InlineElementBox.cpp to the RenderingAllInOne.cpp file.
1470
1471         * rendering/RenderingAllInOne.cpp:
1472
1473 2013-11-06  Sergio Villar Senin  <svillar@igalia.com>
1474
1475         Unreviewed build fix, style() return type is now a reference.
1476
1477         * rendering/RenderGrid.cpp:
1478         (WebCore::RenderGrid::resolveGridPositionFromStyle):
1479
1480 2013-11-06  Jer Noble  <jer.noble@apple.com>
1481
1482         Unreviewed 32-bit Mac build fix; use an explicit FloatSize -> IntSize conversion function.
1483
1484         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1485         (WebCore::MediaPlayerPrivateAVFoundationObjC::sizeChanged):
1486
1487 2013-11-04  Jer Noble  <jer.noble@apple.com>
1488
1489         Playing many sounds with HTML5 Audio makes WebKit unresponsive
1490         https://bugs.webkit.org/show_bug.cgi?id=116145
1491
1492         Reviewed by Eric Carlson.
1493
1494         Cache as much information as possible from AVPlayerItem to eliminate unneccesary
1495         calls into AVFoundation.
1496
1497         Add WillChange/DidChange functions to handle the results of KVO notifications
1498         from AVPlayerItem and AVPlayer:
1499         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1500         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPlay):
1501         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPause):
1502         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateRate):
1503         (WebCore::MediaPlayerPrivateAVFoundationObjC::playerItemStatusDidChange):
1504         (WebCore::MediaPlayerPrivateAVFoundationObjC::playbackLikelyToKeepUpWillChange):
1505         (WebCore::MediaPlayerPrivateAVFoundationObjC::playbackLikelyToKeepUpDidChange):
1506         (WebCore::MediaPlayerPrivateAVFoundationObjC::playbackBufferEmptyWillChange):
1507         (WebCore::MediaPlayerPrivateAVFoundationObjC::playbackBufferEmptyDidChange):
1508         (WebCore::MediaPlayerPrivateAVFoundationObjC::playbackBufferFullWillChange):
1509         (WebCore::MediaPlayerPrivateAVFoundationObjC::playbackBufferFullDidChange):
1510         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesDidChange):
1511         (WebCore::MediaPlayerPrivateAVFoundationObjC::loadedTimeRangesDidChange):
1512         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange):
1513         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasEnabledAudioDidChange):
1514         (WebCore::MediaPlayerPrivateAVFoundationObjC::presentationSizeDidChange):
1515         (WebCore::MediaPlayerPrivateAVFoundationObjC::durationDidChange):
1516         (WebCore::MediaPlayerPrivateAVFoundationObjC::rateDidChange):
1517         (WebCore::itemKVOProperties):
1518         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
1519
1520         Instruct the HTMLMediaElement to cache the currentTime value for 5 seconds:
1521         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1522         (WebCore::MediaPlayerPrivateAVFoundationObjC::maximumDurationToCacheMediaTime):
1523
1524         Add and initialize member variables to hold these cached values:
1525         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1526         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1527         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
1528         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
1529
1530         Add a new Notification type which can take (and call) a Function object:
1531         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1532         (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
1533         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1534         (WebCore::MediaPlayerPrivateAVFoundation::Notification::Notification):
1535         (WebCore::MediaPlayerPrivateAVFoundation::Notification::function):
1536
1537         Implement queries in terms of the cached values of AVPlayerItem and AVPlayer
1538         properties:
1539         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1540         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1541         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
1542         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
1543         (WebCore::MediaPlayerPrivateAVFoundationObjC::playerItemStatus):
1544         (WebCore::MediaPlayerPrivateAVFoundationObjC::rate):
1545         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformBufferedTimeRanges):
1546         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMinTimeSeekable):
1547         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeSeekable):
1548         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeLoaded):
1549         (WebCore::MediaPlayerPrivateAVFoundationObjC::totalBytes):
1550         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
1551         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
1552         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
1553         (WebCore::MediaPlayerPrivateAVFoundationObjC::sizeChanged):
1554         (WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks):
1555
1556         Invalidate the cached currentTime before calling scheduleTimeUpdate so that the
1557         correct movieTime is saved in m_clockTimeAtLastUpdateEvent:
1558         * html/HTMLMediaElement.cpp:
1559         (HTMLMediaElement::setReadyState):
1560
1561 2013-10-24  Sergio Villar Senin  <svillar@igalia.com>
1562
1563         [CSS Grid Layout] Add support for named grid areas
1564         https://bugs.webkit.org/show_bug.cgi?id=120045
1565
1566         Reviewed by Andreas Kling.
1567
1568         From Blink r155555, r155850 and r155889 by <jchaffraix@chromium.org>
1569
1570         Added support for named grid areas. Basically a named grid area is
1571         now a valid grid position. The shorthand parsing of grid-area was
1572         split from the grid-{row|column} as the rules for expanding are
1573         slightly different.
1574
1575         Unknown grid area names are treated as 'auto' as per the
1576         specification. This means that for those cases we need to trigger
1577         the auto-placement algorithm.
1578
1579         Tests: fast/css-grid-layout/grid-item-bad-named-area-auto-placement.html
1580                fast/css-grid-layout/grid-item-named-grid-area-resolution.html
1581
1582         * css/CSSComputedStyleDeclaration.cpp:
1583         (WebCore::valueForGridPosition):
1584         * css/CSSParser.cpp:
1585         (WebCore::CSSParser::parseValue):
1586         (WebCore::CSSParser::parseGridPosition):
1587         (WebCore::gridMissingGridPositionValue):
1588         (WebCore::CSSParser::parseGridItemPositionShorthand):
1589         (WebCore::CSSParser::parseGridAreaShorthand):
1590         (WebCore::CSSParser::parseSingleGridAreaLonghand):
1591         * css/CSSParser.h:
1592         * css/StyleResolver.cpp:
1593         (WebCore::StyleResolver::adjustRenderStyle):
1594         (WebCore::StyleResolver::adjustGridItemPosition):
1595         (WebCore::createGridPosition):
1596         * css/StyleResolver.h:
1597         * rendering/RenderGrid.cpp:
1598         (WebCore::RenderGrid::resolveGridPositionFromStyle):
1599         * rendering/style/GridPosition.h:
1600         (WebCore::GridPosition::isNamedGridArea):
1601         (WebCore::GridPosition::setNamedGridArea):
1602         (WebCore::GridPosition::namedGridLine):
1603
1604 2013-11-06  Chris Fleizach  <cfleizach@apple.com>
1605
1606         AX: Audio and Video attachments are not output to VoiceOver
1607         https://bugs.webkit.org/show_bug.cgi?id=123479
1608
1609         Reviewed by Mario Sanchez Prada.
1610
1611         Video and audio elements don't appear as distinct objects in the AX hierarchy,
1612         nor are they treated as replaceable objects when emitting the text. We should
1613         treat these characters like attachments, for one. On the Mac platform, we should
1614         also identify them with special subroles.
1615
1616         Tests: platform/mac/accessibility/media-emits-object-replacement.html
1617                platform/mac/accessibility/media-role-descriptions.html
1618
1619         * accessibility/AccessibilityNodeObject.cpp:
1620         (WebCore::AccessibilityNodeObject::isGenericFocusableElement):
1621         * accessibility/AccessibilityObject.h:
1622         * accessibility/AccessibilityRenderObject.cpp:
1623         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
1624         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1625         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1626         (createAccessibilityRoleMap):
1627         (-[WebAccessibilityObjectWrapper subrole]):
1628         (-[WebAccessibilityObjectWrapper roleDescription]):
1629         * editing/TextIterator.cpp:
1630         (WebCore::isRendererReplacedElement):
1631
1632
1633 2013-11-06  Ryosuke Niwa  <rniwa@webkit.org>
1634
1635         Notify nodes removal to Range/Selection after dispatching blur and mutation event
1636         https://bugs.webkit.org/show_bug.cgi?id=123880
1637
1638         Reviewed by Andreas Kling.
1639
1640         Merge https://chromium.googlesource.com/chromium/blink/+/b60576a0560d14f8757e58d55d37b7cefa48a6ac
1641
1642         In willRemoveChildren in ContainerNode.cpp, call Document::nodeChildrenWillBeRemoved after instead of
1643         before dispatching mutation events because we need to update ranges created by those mutation event
1644         listeners. willRemoveChild was fixed in r115686.
1645
1646         Tests: editing/selection/selection-change-in-blur-event-by-remove-children.html
1647                editing/selection/selection-change-in-mutation-event-by-remove-children.html
1648                fast/dom/Range/range-created-during-remove-children.html
1649
1650         * dom/ContainerNode.cpp:
1651         (WebCore::willRemoveChildren):
1652
1653 2013-11-06  Ryosuke Niwa  <rniwa@webkit.org>
1654
1655         Fix out-of-date offset in selection range code in range.surroundContents
1656         https://bugs.webkit.org/show_bug.cgi?id=123871
1657
1658         Reviewed by Andreas Kling.
1659         
1660         Merge https://chromium.googlesource.com/chromium/blink/+/c89b413ff0fc4aafa0c71d180b0b1e131bb37707
1661
1662         The code in Range::insertNode assumeed that the start offset of the selection range within its container
1663         doesn't change across a call to insertBefore on the container but this is wrong. This patch recomputes
1664         the start offset when it is used after the insertBefore call.
1665
1666         Test: editing/selection/range-surroundContents-with-preceding-node.html
1667
1668         * dom/Range.cpp:
1669         (WebCore::Range::insertNode):
1670
1671 2013-11-06  Andreas Kling  <akling@apple.com>
1672
1673         Add InlineElementBox and stop instantiating InlineBox directly.
1674         <https://webkit.org/b/123882>
1675
1676         Make the InlineBox constructors protected and add a new class
1677         called InlineElementBox on top. This is somewhat analogous to the
1678         split between RenderText and RenderElement, and allows us to make
1679         renderer() return a far tighter RenderBoxModelObject& instead
1680         of a RenderObject&.
1681
1682         Moved over attachLine(), deleteLine() and extractLine() to start
1683         things off. More things will follow.
1684
1685         Reviewed by Antti Koivisto.
1686
1687 2013-11-06  Piotr Grad  <p.grad@samsung.com>
1688
1689         Seek for video doesn't work when playback rate is negative
1690         https://bugs.webkit.org/show_bug.cgi?id=123791
1691
1692         In MediaPlayerPrivateGStreamer::seek negative playback rate was not taken to account.
1693
1694         Reviewed by Philippe Normand.
1695
1696         Test: media/video-seek-with-negative-playback.html
1697
1698         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1699         (WebCore::MediaPlayerPrivateGStreamer::seek):
1700
1701 2013-11-06  Andreas Kling  <akling@apple.com>
1702
1703         Reinstate an annoying assertion that I accidentally commented out.
1704
1705         * loader/icon/IconDatabase.cpp:
1706         (WebCore::IconDatabase::synchronousIconForPageURL):
1707
1708 2013-11-06  Brendan Long  <b.long@cablelabs.com>
1709
1710         [GStreamer] Override label() and language() in Audio and VideoTrackPrivateGStreamer
1711         https://bugs.webkit.org/show_bug.cgi?id=123836
1712
1713         The tests are currently flakey because we only get the label and language if we get
1714         tags after the track client is set.
1715
1716         Reviewed by Philippe Normand.
1717
1718         No new tests because the tests already exist (this fixes flakeyness).
1719
1720         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h: Override label() and language() to use m_label and m_language.
1721         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h: Same.
1722         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: Make m_label and m_language protected so they can be used in the functions above.
1723
1724 2013-11-05  Andreas Kling  <akling@apple.com>
1725
1726         RenderBlockFlow should only expose its line boxes as RootInlineBox.
1727         <https://webkit.org/b/123878>
1728
1729         The line boxes attached directly to a RenderBlockFlow are always
1730         RootInlineBox objects, so call sites should always use the tightly
1731         typed firstRootBox() and lastRootBox().
1732
1733         This allows the compiler to devirtualize calls to member functions
1734         of RootInlineBox that are marked FINAL.
1735
1736         Reviewed by Antti Koivisto.
1737
1738 2013-11-06  Ryosuke Niwa  <rniwa@webkit.org>
1739
1740         Assertion failure end < m_runCount in WebCore::BidiRunList<WebCore::BidiRun>::reverseRuns
1741         https://bugs.webkit.org/show_bug.cgi?id=123863
1742
1743         Reviewed by Andreas Kling.
1744
1745         Merge https://chromium.googlesource.com/chromium/blink/+/cbaa92c763a37d89eeabd01658e522219299290c
1746
1747         Test: fast/text/bidi-reverse-runs-crash.html
1748
1749         * platform/text/BidiResolver.h:
1750         (WebCore::BidiResolver<Iterator, Run>::createBidiRunsForLine): Don't reverse the runs if there's
1751         nothing to be reversed.
1752
1753 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
1754
1755         Address the review comment after r158724.
1756
1757         * html/RangeInputType.cpp:
1758         (WebCore::RangeInputType::handleMouseDownEvent):
1759
1760 2013-11-05  Zalan Bujtas  <zalan@apple.com>
1761
1762         Widget's position change should not initiate layout, only when its size changes.
1763         https://bugs.webkit.org/show_bug.cgi?id=123860
1764
1765         Reviewed by Andreas Kling.
1766
1767         RenderWidgets initiate unnecessary layouts while scrolling when they are embedded to
1768         overflow:scroll containers. Scroll position change doesn't dirty the render tree
1769         so it should not trigger layout either.
1770
1771         Manual test added. Unfortunately we can't test against the number of layouts yet.
1772
1773         * rendering/RenderWidget.cpp:
1774         (WebCore::RenderWidget::setWidgetGeometry):
1775         (WebCore::RenderWidget::updateWidgetGeometry):
1776         (WebCore::RenderWidget::updateWidgetPosition):
1777
1778 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
1779
1780         Use-after-free in SliderThumbElement::dragFrom
1781         https://bugs.webkit.org/show_bug.cgi?id=123873
1782
1783         Reviewed by Andreas Kling.
1784
1785         Ref the SliderThumbElement since it could go away inside dragFrom.
1786
1787         Test: fast/forms/range/range-type-change-onchange-2.html
1788
1789         * html/RangeInputType.cpp:
1790         (WebCore::RangeInputType::handleMouseDownEvent):
1791
1792 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
1793
1794         Change the order of conditions to avoid computing rendererIsEditable()
1795         https://bugs.webkit.org/show_bug.cgi?id=123868
1796
1797         Reviewed by Andreas Kling.
1798
1799         Merge https://chromium.googlesource.com/chromium/blink/+/c89b413ff0fc4aafa0c71d180b0b1e131bb37707
1800
1801         When we need both Node::renderer() and Node::rendererIsEditable() conditions to be true to perform
1802         some operation, it is more effective to check for renderer() first, so that if this condition fails
1803         we can avoid unnecessary computation of rendererIsEditable().
1804
1805         * dom/Position.cpp:
1806         (WebCore::nextRenderedEditable):
1807         (WebCore::previousRenderedEditable):
1808         * page/EventHandler.cpp:
1809         (WebCore::EventHandler::handleMouseReleaseEvent):
1810
1811 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
1812
1813         simpleUserAgentStyleSheet doesn't have focus ring on anchor element
1814         https://bugs.webkit.org/show_bug.cgi?id=123867
1815
1816         Reviewed by Andreas Kling.
1817
1818         Merge https://chromium.googlesource.com/chromium/blink/+/08ecc23c4d80be9969918c4baf0ac83dc6cb6cbd
1819
1820         * css/CSSDefaultStyleSheets.cpp:
1821
1822 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
1823
1824         valueForBorderRadiusShorthand returns wrong values in some case
1825         https://bugs.webkit.org/show_bug.cgi?id=123866
1826
1827         Reviewed by Andreas Kling.
1828
1829         Merge https://chromium.googlesource.com/chromium/blink/+/0933728126f2db06ab8e945efc98bffa2d42af1c
1830
1831         Because valueForBorderRadiusShorthand misses the followings:
1832         - showHorizontalBottomRight depends on showHorizontalBottomLeft.
1833         - showHorizontalTopRight depends on showHorizontalBottomRight (including showHorizontalBottomLeft).
1834
1835         See also http://dev.w3.org/csswg/css-backgrounds/#the-border-radius
1836
1837         Test: fast/css/getComputedStyle/getComputedStyle-borderRadius-2.html
1838
1839         * css/CSSComputedStyleDeclaration.cpp:
1840         (WebCore::getBorderRadiusShorthandValue):
1841
1842 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
1843
1844         Protect DOM nodes in IndentOutdentCommand::tryIndentingAsListItem()
1845         https://bugs.webkit.org/show_bug.cgi?id=123861
1846
1847         Reviewed by Benjamin Poulain.
1848
1849         Merge https://chromium.googlesource.com/chromium/blink/+/297442eb539a2b764fdad323de79099a70179186 partially.
1850
1851         * editing/IndentOutdentCommand.cpp:
1852         (WebCore::IndentOutdentCommand::tryIndentingAsListItem): Make selectedListItem, previousList, and nextList
1853         RefPtr since they're are used after calling insertNodeBefore.
1854
1855 2013-11-05  Andreas Kling  <akling@apple.com>
1856
1857         Apply more unique_ptr to line box management.
1858         <https://webkit.org/b/123857>
1859
1860         Make all of the functions that return newly-created line boxes
1861         return them packed up in std::unique_ptrs.
1862
1863         There is one exception in RenderBlockLineLayout where the function
1864         createInlineBoxForRenderer() is inconsistent about the ownership of
1865         the returned object. This will be addressed by a subsequent patch.
1866
1867         We now "release" the line boxes into their various home structures,
1868         so the pointer smartness doesn't go end-to-end just yet.
1869
1870         Reviewed by Anders Carlsson.
1871
1872 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
1873
1874         getComputedStyle(x).lineHeight is affected by zooming
1875         https://bugs.webkit.org/show_bug.cgi?id=123847
1876
1877         Reviewed by Benjamin Poulain.
1878
1879         Merge https://chromium.googlesource.com/chromium/blink/+/7957097afbab2899ababd0d9c8acbf6e3eddb870
1880
1881         Test: fast/css/line-height-zoom-get-computed-style.html
1882
1883         * css/CSSComputedStyleDeclaration.cpp:
1884         (WebCore::lineHeightFromStyle): Don't round line-height values.
1885         * css/DeprecatedStyleBuilder.cpp:
1886         (WebCore::ApplyPropertyLineHeight::applyValue): Use the computed value instead of the used value.
1887
1888 2013-11-05  James Craig  <jcraig@apple.com>
1889
1890         AX: media controls accessibility needs more work
1891         https://bugs.webkit.org/show_bug.cgi?id=123749
1892
1893         Reviewed by Jer Noble.
1894
1895         Updated some of the control labels/roles to improve accessibility.
1896           - Volume slider is now keyboard/screenreader accessible.
1897           - muteButton was a checkbox toggling checked state, now a button that toggles label "mute/unmute"
1898           - fullscreenButton was a checkbox toggling checked state, now a button that toggles label "display/exit full screen"
1899           - captionButton was a checkbox, now a popup button that launches the newly accessible menu.
1900         Subtitles menu is now keyboard/screenreader accessible (uses roaming tabindex).
1901         Render dump expectations changed because volume slider is now hidden via... 
1902         ...opacity/size (to make accessible without hover) instead of display:none.
1903
1904         Updated existing test coverage.
1905
1906         * Modules/mediacontrols/mediaControlsApple.css:
1907         (audio::-webkit-media-controls-panel .volume-box):
1908         (audio::-webkit-media-controls-panel .volume-box:active):
1909         (audio::-webkit-media-controls-toggle-closed-captions-button):
1910         (audio::-webkit-media-controls-closed-captions-container .list):
1911         (audio::-webkit-media-controls-closed-captions-container li:focus):
1912         * Modules/mediacontrols/mediaControlsApple.js:
1913         (Controller.prototype.createControls):
1914         (Controller.prototype.handleFullscreenChange):
1915         (Controller.prototype.handleMuteButtonClicked):
1916         (Controller.prototype.handleMinButtonClicked):
1917         (Controller.prototype.handleMaxButtonClicked):
1918         (Controller.prototype.handleVolumeSliderChange):
1919         (Controller.prototype.buildCaptionMenu):
1920         (Controller.prototype.focusSiblingCaptionItem):
1921         (Controller.prototype.handleCaptionItemKeyUp):
1922
1923 2013-11-05  Andreas Kling  <akling@apple.com>
1924
1925         Move some plugin-specific code from RenderWidget to RenderEmbeddedObject.
1926         <https://webkit.org/b/123845>
1927
1928         All RenderWidgets representing plugins will be RenderEmbeddedObjects.
1929         Move some of the plugin-specific logic to RenderEmbeddedObject since it
1930         doesn't make sense for all RenderWidgets (frames, embedded documents)
1931         to care about this.
1932
1933         Reviewed by Anders Carlsson.
1934
1935 2013-11-05  Tim Horton  <timothy_horton@apple.com>
1936
1937         Fix the 32-bit build.
1938
1939         * WebCore.exp.in:
1940
1941 2013-11-05  Alexandru Chiculita  <achicu@adobe.com>
1942
1943         Web Inspector: Moving an element while in the DOMNodeRemoved handler will hide it in the inspector
1944         https://bugs.webkit.org/show_bug.cgi?id=123516
1945
1946         Reviewed by Timothy Hatcher.
1947
1948         InspectorInstrumentation::willRemoveDOMNode was actually calling both willRemoveDOMNodeImpl and
1949         didRemoveDOMNodeImpl, making the DOMAgent unbind the element even if it was still part of the DOM.
1950
1951         Because of that the DOMAgent was sending two events:
1952         1. When the element was about to be removed, just before JS "DOMNodeRemoved" was triggered.
1953         2. When the element was actually removed.
1954
1955         Note that inspector's event #2 will not know about the node, as it just removed it from the
1956         internal hashmap, so it will just use a nodeID == 0 for it.
1957
1958         This patch adds a separate call to InspectorInstrumentation::didRemoveDOMNode, just before the
1959         element is about to be removed. The InspectorInstrumentation::willRemoveDOMNode call is now only used
1960         by the DOMDebugger to trigger the DOM breakpoints in the Web Inspector. That feature is not exposed
1961         in the new Inspector UI, but can be used/tested using the protocol directly.
1962
1963         Tests: inspector-protocol/dom-debugger/node-removed.html
1964                inspector-protocol/dom/dom-remove-events.html
1965                inspector-protocol/dom/remove-multiple-nodes.html
1966
1967         * dom/ContainerNode.cpp:
1968         (WebCore::ContainerNode::removeBetween):
1969         * inspector/InspectorInstrumentation.h:
1970         (WebCore::InspectorInstrumentation::willRemoveDOMNode):
1971         (WebCore::InspectorInstrumentation::didRemoveDOMNode):
1972
1973 2013-11-05  Ryuan Choi  <ryuan.choi@samsung.com>
1974
1975         Unreviewed build fix on CMake based ports with GLES.
1976
1977         * CMakeLists.txt:
1978         Added OPENGLES2_LIBRARIES and OPENGLES2_INCLUDE_DIR into the includes and
1979         libraries list.
1980
1981 2013-11-05  Tim Horton  <timothy_horton@apple.com>
1982
1983         platformCALayerDeviceScaleFactor should be const
1984         https://bugs.webkit.org/show_bug.cgi?id=123842
1985
1986         Reviewed by Simon Fraser.
1987
1988         * WebCore.exp.in:
1989         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1990         (WebCore::LayerClient::platformCALayerDeviceScaleFactor):
1991         * platform/graphics/ca/GraphicsLayerCA.cpp:
1992         (WebCore::GraphicsLayerCA::platformCALayerDeviceScaleFactor):
1993         * platform/graphics/ca/GraphicsLayerCA.h:
1994         * platform/graphics/ca/PlatformCALayerClient.h:
1995         * platform/graphics/ca/mac/TileController.h:
1996         * platform/graphics/ca/mac/TileController.mm:
1997         (WebCore::TileController::platformCALayerDeviceScaleFactor):
1998         * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
1999         (WebCore::MediaPlayerPrivateQuickTimeVisualContext::LayerClient::platformCALayerDeviceScaleFactor):
2000         Constify PlatformCALayerClient::platformCALayerDeviceScaleFactor.
2001
2002 2013-11-05  Gavin Barraclough  <barraclough@apple.com>
2003
2004         Subresource loads should not prevent page throttling
2005         https://bugs.webkit.org/show_bug.cgi?id=123757
2006
2007         Reviewed by Alexey Proskuryakov.
2008
2009         The page-is-loading test for inhibiting process supression is currently
2010         too conservative, preventing supression of pages with infinitely loading
2011         resources (commonly XHRs). Instead, just rely on the FrameLoader being
2012         active (with hysteresis).
2013
2014         * loader/SubresourceLoader.cpp:
2015         (WebCore::SubresourceLoader::init):
2016         (WebCore::SubresourceLoader::checkForHTTPStatusCodeError):
2017         (WebCore::SubresourceLoader::didFinishLoading):
2018         (WebCore::SubresourceLoader::didFail):
2019         (WebCore::SubresourceLoader::willCancel):
2020         * loader/SubresourceLoader.h:
2021             - remove m_activityAssertion from SubresourceLoader.
2022
2023 2013-11-05  Tim Horton  <timothy_horton@apple.com>
2024
2025         [mac] PDFDocumentImage is too big if PDF has a crop box smaller than the media box
2026         https://bugs.webkit.org/show_bug.cgi?id=123840
2027         <rdar://problem/15308765>
2028
2029         Reviewed by Alexey Proskuryakov.
2030
2031         Test: fast/images/pdf-as-image-crop-box.html
2032
2033         * platform/graphics/cg/PDFDocumentImage.cpp:
2034         (WebCore::PDFDocumentImage::size):
2035         Use the crop box when determining the size of the image.
2036
2037         (WebCore::PDFDocumentImage::computeBoundsForCurrentPage):
2038         * platform/graphics/cg/PDFDocumentImage.h:
2039         * platform/graphics/mac/PDFDocumentImageMac.mm:
2040         (WebCore::PDFDocumentImage::computeBoundsForCurrentPage):
2041         Get rid of m_mediaBox, since we don't need it anymore.
2042
2043         (WebCore::PDFDocumentImage::drawPDFPage):
2044         PDFKit does the translation by the crop box origin for us;
2045         if we do it additionally, we'll be painting the wrong part of the image.
2046         So, don't do the translation here.
2047
2048 2013-11-05  Antti Koivisto  <antti@apple.com>
2049
2050         Factor index cache for NodeLists and HTMLCollections to a class
2051         https://bugs.webkit.org/show_bug.cgi?id=123823
2052
2053         Reviewed by Ryosuke Niwa.
2054
2055         Implement index cache class that can used by NodeLists and HTMLCollections that currently
2056         each have implementations of their own.
2057         
2058         This patch also implements ChildNodeList and LiveNodeList using CollectionIndexCache.
2059         HTMLCollection is will be transitioned later.
2060
2061         * GNUmakefile.list.am:
2062         * WebCore.vcxproj/WebCore.vcxproj:
2063         * WebCore.xcodeproj/project.pbxproj:
2064         * dom/ChildNodeList.cpp:
2065         (WebCore::ChildNodeList::ChildNodeList):
2066         (WebCore::ChildNodeList::length):
2067         (WebCore::ChildNodeList::item):
2068         
2069             The client calls to cache to for indexed and size access.
2070
2071         (WebCore::ChildNodeList::collectionFirst):
2072         (WebCore::ChildNodeList::collectionLast):
2073         (WebCore::ChildNodeList::collectionTraverseForward):
2074         (WebCore::ChildNodeList::collectionTraverseBackward):
2075         
2076             Cache calls back to these as needed to do the actual traversal.
2077
2078         (WebCore::ChildNodeList::invalidateCache):
2079         * dom/ChildNodeList.h:
2080         * dom/CollectionIndexCache.h: Added.
2081         
2082             Templated cache class itself.
2083
2084         (WebCore::::CollectionIndexCache):
2085         (WebCore::::nodeCount):
2086         (WebCore::::nodeBeforeCached):
2087         (WebCore::::nodeAfterCached):
2088         (WebCore::::nodeAt):
2089         (WebCore::::invalidate):
2090         * dom/LiveNodeList.cpp:
2091         (WebCore::firstMatchingElement):
2092         (WebCore::nextMatchingElement):
2093         (WebCore::traverseMatchingElementsForward):
2094         (WebCore::LiveNodeList::collectionFirst):
2095         (WebCore::LiveNodeList::collectionLast):
2096         (WebCore::LiveNodeList::collectionTraverseForward):
2097         (WebCore::LiveNodeList::collectionTraverseBackward):
2098         (WebCore::LiveNodeList::length):
2099         (WebCore::LiveNodeList::item):
2100         (WebCore::LiveNodeList::invalidateCache):
2101         * dom/LiveNodeList.h:
2102         (WebCore::LiveNodeList::LiveNodeList):
2103
2104 2013-11-05  Enrica Casucci  <enrica@apple.com>
2105
2106         Full width semicolon is wrong in vertical text.
2107         https://bugs.webkit.org/show_bug.cgi?id=123814
2108         <rdar://problem/15312541>
2109
2110         Reviewed by Benjamin Poulain.
2111
2112         The full width semicolon should always be upright.
2113         Adding it to the list of characters that should
2114         ignore rotation.
2115
2116         * platform/graphics/FontGlyphs.cpp:
2117         (WebCore::shouldIgnoreRotation):
2118
2119 2013-11-05  Andreas Kling  <akling@apple.com>
2120
2121         Remove unused RenderWidget::notifyWidget().
2122
2123         Rubber-stamped by Anders Carlsson.
2124
2125 2013-11-05  Commit Queue  <commit-queue@webkit.org>
2126
2127         Unreviewed, rolling out r158678.
2128         http://trac.webkit.org/changeset/158678
2129         https://bugs.webkit.org/show_bug.cgi?id=123820
2130
2131         Causes a new debug assertion failure on the Mavericks test
2132         system. (Requested by bfulgham on #webkit).
2133
2134         * rendering/mathml/RenderMathMLOperator.cpp:
2135
2136 2013-11-05  Renata Hodovan  <reni@webkit.org>
2137
2138         ASSERTION FAILED: isHTMLTitleElement(m_titleElement.get()) in WebCore::Document::setTitle
2139         https://bugs.webkit.org/show_bug.cgi?id=122092
2140
2141         Reviewed by Darin Adler.
2142
2143         Remove a bogus assert in Document::setTitle().
2144         m_titleElement can be either of HTMLTitleElement or SVGTitleElement. The assertion was wrong.
2145         
2146         Backported from Blink:
2147         https://src.chromium.org/viewvc/blink?revision=158620&view=revision
2148
2149         Test: svg/custom/title-assertion.html
2150
2151         * dom/Document.cpp:
2152         (WebCore::Document::setTitle):
2153         * svg/SVGTitleElement.cpp:
2154         (WebCore::SVGTitleElement::insertedInto):
2155
2156 2013-11-05  Martin Robinson  <mrobinson@igalia.com>
2157
2158         [MathML] Poor spacing around delimiters in MathML Torture Test 14
2159         https://bugs.webkit.org/show_bug.cgi?id=122837
2160
2161         Reviewed by Brent Fulgham.
2162
2163         Instead of stretching the vertical bar with the stretchable version, just repeat
2164         the normal vertical bar. This follows what Gecko does when rendering tall vertical
2165         bars and also works around an issue with STIX fonts leading to poor spacing in
2166         formulas.
2167
2168         * rendering/mathml/RenderMathMLOperator.cpp: Stretch the vertical bar with the
2169         normal variant.
2170
2171 2013-11-05  Daniel Bates  <dabates@apple.com>
2172
2173         XSSAuditor should catch reflected srcdoc properties even without a <frame> tag injection
2174
2175         From Blink r160615 by <tsepez@chromium.org>
2176         https://src.chromium.org/viewvc/blink?view=rev&revision=160615
2177
2178         Test: http/tests/security/xssAuditor/iframe-srcdoc-property-blocked.html
2179
2180         * html/parser/XSSAuditor.cpp:
2181         (WebCore::XSSAuditor::filterIframeToken):
2182
2183 2013-11-05  Éva Balázsfalvi  <balazsfalvi.eva@stud.u-szeged.hu>
2184
2185         Delete maketokenizer.
2186         https://bugs.webkit.org/show_bug.cgi?id=115155
2187
2188         Reviewed by Zoltan Herczeg.
2189
2190         This script was used to generate the old flex based CSS tokenizer. It
2191         was replaced by a custom tokenizer in r106217 but the script wasn't
2192         removed. Since there is no mention of it in the original bug nor any
2193         reference to maketokenizer in our build files, it's probably an
2194         oversight.
2195
2196         Merge from blink:
2197         https://chromium.googlesource.com/chromium/blink/+/2a1c8aaf867f707ccdcd8893446e907e2aa2e1c2
2198
2199         * css/maketokenizer: Removed.
2200
2201 2013-11-05  Zan Dobersek  <zdobersek@igalia.com>
2202
2203         Unreviewed. Unbreaking GCC builds.
2204
2205         * html/HTMLCollection.cpp:
2206         (WebCore::isMatchingElement): This inline function is not a template anymore.
2207
2208 2013-11-05  Antti Koivisto  <antti@apple.com>
2209
2210         Make it compile.
2211
2212         * dom/LiveNodeList.h:
2213         (WebCore::LiveNodeList::LiveNodeList):
2214         (WebCore::LiveNodeList::~LiveNodeList):
2215         * dom/NodeRareData.h:
2216         (WebCore::NodeListsNodeData::adoptDocument):
2217         * html/HTMLCollection.cpp:
2218         (WebCore::HTMLCollection::HTMLCollection):
2219         (WebCore::HTMLCollection::~HTMLCollection):
2220
2221 2013-11-05  Antti Koivisto  <antti@apple.com>
2222
2223         HTMLCollection should not be NodeList
2224         https://bugs.webkit.org/show_bug.cgi?id=123794
2225
2226         Reviewed by Andreas Kling.
2227
2228         HTMLCollection and NodeList are unrelated types in DOM yet our HTMLCollection inherits NodeList
2229         for code sharing reasons. While some code does get shared the types are sufficiently different 
2230         that this results in lots of unnecessary branches, complexity and general awkwardness. Code sharing 
2231         can be better achieved by means other than inheritance.
2232         
2233         This patch splits HTMLCollection from NodeList by copy-pasting and eliminating resulting redundancies. 
2234         Sharing comes later.
2235
2236         * dom/Attr.cpp:
2237         (WebCore::Attr::setValue):
2238         (WebCore::Attr::childrenChanged):
2239         * dom/ClassNodeList.cpp:
2240         (WebCore::ClassNodeList::~ClassNodeList):
2241         * dom/ContainerNode.cpp:
2242         (WebCore::ContainerNode::childrenChanged):
2243         (WebCore::ContainerNode::getElementsByTagName):
2244         (WebCore::ContainerNode::getElementsByName):
2245         (WebCore::ContainerNode::getElementsByClassName):
2246         (WebCore::ContainerNode::radioNodeList):
2247         * dom/Document.cpp:
2248         (WebCore::Document::Document):
2249         (WebCore::Document::~Document):
2250         (WebCore::Document::registerNodeList):
2251         (WebCore::Document::unregisterNodeList):
2252         (WebCore::Document::registerCollection):
2253         (WebCore::Document::unregisterCollection):
2254         (WebCore::Document::ensureCachedCollection):
2255         
2256             Add separate functions and map for registering HTMLCollections.
2257
2258         (WebCore::Document::all):
2259         (WebCore::Document::windowNamedItems):
2260         (WebCore::Document::documentNamedItems):
2261         * dom/Document.h:
2262         * dom/Element.cpp:
2263         (WebCore::Element::attributeChanged):
2264         (WebCore::Element::ensureCachedHTMLCollection):
2265         (WebCore::Element::cachedHTMLCollection):
2266         * dom/LiveNodeList.cpp:
2267         (WebCore::LiveNodeList::rootNode):
2268         (WebCore::isMatchingElement):
2269         (WebCore::LiveNodeList::iterateForPreviousElement):
2270         (WebCore::LiveNodeList::itemBefore):
2271         (WebCore::firstMatchingElement):
2272         (WebCore::nextMatchingElement):
2273         (WebCore::traverseMatchingElementsForwardToOffset):
2274         (WebCore::LiveNodeList::traverseLiveNodeListFirstElement):
2275         (WebCore::LiveNodeList::traverseLiveNodeListForwardToOffset):
2276         (WebCore::LiveNodeList::isLastItemCloserThanLastOrCachedItem):
2277         (WebCore::LiveNodeList::isFirstItemCloserThanCachedItem):
2278         (WebCore::LiveNodeList::length):
2279         (WebCore::LiveNodeList::item):
2280         (WebCore::LiveNodeList::elementBeforeOrAfterCachedElement):
2281         
2282             This code used to live in HTMLCollection.cpp. Copy-paste here and remove all branches not needed for NodeLists.
2283
2284         (WebCore::LiveNodeList::invalidateCache):
2285         
2286             NodeLists have no name caches.
2287
2288         * dom/LiveNodeList.h:
2289         (WebCore::LiveNodeList::LiveNodeList):
2290         (WebCore::LiveNodeList::~LiveNodeList):
2291         (WebCore::LiveNodeList::isRootedAtDocument):
2292         (WebCore::LiveNodeList::type):
2293         (WebCore::LiveNodeList::invalidateCache):
2294         (WebCore::LiveNodeList::setCachedElement):
2295         
2296             Merge LiveNodeListBase and LiveNodeList.
2297             Remove fields and code supporting HTMLCollection.
2298
2299         (WebCore::shouldInvalidateTypeOnAttributeChange):
2300         
2301             Move to global scope. This function is used both HTMLCollections and LiveNodeLists.
2302
2303         * dom/NameNodeList.cpp:
2304         (WebCore::NameNodeList::~NameNodeList):
2305         * dom/NameNodeList.h:
2306         (WebCore::NameNodeList::create):
2307         * dom/Node.cpp:
2308         (WebCore::shouldInvalidateNodeListCachesForAttr):
2309         (WebCore::Document::shouldInvalidateNodeListAndCollectionCaches):
2310         (WebCore::Document::invalidateNodeListAndCollectionCaches):
2311         (WebCore::Node::invalidateNodeListAndCollectionCachesInAncestors):
2312         (WebCore::NodeListsNodeData::invalidateCaches):
2313         * dom/Node.h:
2314         * dom/NodeRareData.h:
2315         (WebCore::NodeListsNodeData::addCacheWithAtomicName):
2316         (WebCore::NodeListsNodeData::addCacheWithName):
2317         (WebCore::NodeListsNodeData::addCacheWithQualifiedName):
2318         (WebCore::NodeListsNodeData::addCachedCollection):
2319         (WebCore::NodeListsNodeData::cachedCollection):
2320         (WebCore::NodeListsNodeData::removeCacheWithAtomicName):
2321         (WebCore::NodeListsNodeData::removeCacheWithName):
2322         (WebCore::NodeListsNodeData::removeCachedCollection):
2323         (WebCore::NodeListsNodeData::isEmpty):
2324         (WebCore::NodeListsNodeData::adoptDocument):
2325         (WebCore::NodeListsNodeData::namedCollectionKey):
2326         (WebCore::NodeListsNodeData::namedNodeListKey):
2327         (WebCore::NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList):
2328         
2329             Add separate cache for HTMLCollections.
2330
2331         * dom/TagNodeList.cpp:
2332         (WebCore::TagNodeList::TagNodeList):
2333         (WebCore::TagNodeList::~TagNodeList):
2334         * dom/TagNodeList.h:
2335         (WebCore::TagNodeList::create):
2336         (WebCore::HTMLTagNodeList::create):
2337         * html/CollectionType.h:
2338         
2339             Remove NodeList types.
2340
2341         * html/HTMLCollection.cpp:
2342         (WebCore::shouldOnlyIncludeDirectChildren):
2343         (WebCore::rootTypeFromCollectionType):
2344         (WebCore::invalidationTypeExcludingIdAndNameAttributes):
2345         (WebCore::HTMLCollection::HTMLCollection):
2346         (WebCore::HTMLCollection::~HTMLCollection):
2347         (WebCore::HTMLCollection::rootNode):
2348         (WebCore::isMatchingElement):
2349         (WebCore::HTMLCollection::iterateForPreviousElement):
2350         (WebCore::HTMLCollection::itemBefore):
2351         (WebCore::firstMatchingElement):
2352         (WebCore::nextMatchingElement):
2353         (WebCore::traverseMatchingElementsForwardToOffset):
2354         (WebCore::HTMLCollection::isLastItemCloserThanLastOrCachedItem):
2355         (WebCore::HTMLCollection::isFirstItemCloserThanCachedItem):
2356         (WebCore::HTMLCollection::setCachedElement):
2357         (WebCore::HTMLCollection::length):
2358         (WebCore::HTMLCollection::item):
2359         (WebCore::HTMLCollection::elementBeforeOrAfterCachedElement):
2360         (WebCore::HTMLCollection::traverseFirstElement):
2361         (WebCore::HTMLCollection::traverseNextElement):
2362         (WebCore::HTMLCollection::traverseForwardToOffset):
2363         (WebCore::HTMLCollection::invalidateCache):
2364         (WebCore::HTMLCollection::invalidateIdNameCacheMaps):
2365         (WebCore::HTMLCollection::namedItem):
2366         
2367             Remove NodeList specific branches and functions.
2368             LiveNodeListBase functions are now HTMLCollection functions.
2369
2370         * html/HTMLCollection.h:
2371         (WebCore::HTMLCollection::isRootedAtDocument):
2372         (WebCore::HTMLCollection::invalidationType):
2373         (WebCore::HTMLCollection::type):
2374         (WebCore::HTMLCollection::ownerNode):
2375         (WebCore::HTMLCollection::invalidateCache):
2376         (WebCore::HTMLCollection::document):
2377         (WebCore::HTMLCollection::overridesItemAfter):
2378         (WebCore::HTMLCollection::isElementCacheValid):
2379         (WebCore::HTMLCollection::cachedElement):
2380         (WebCore::HTMLCollection::cachedElementOffset):
2381         (WebCore::HTMLCollection::isLengthCacheValid):
2382         (WebCore::HTMLCollection::cachedLength):
2383         (WebCore::HTMLCollection::setLengthCache):
2384         (WebCore::HTMLCollection::setCachedElement):
2385         (WebCore::HTMLCollection::isItemRefElementsCacheValid):
2386         (WebCore::HTMLCollection::setItemRefElementsCacheValid):
2387         (WebCore::HTMLCollection::rootType):
2388         (WebCore::HTMLCollection::hasNameCache):
2389         (WebCore::HTMLCollection::setHasNameCache):
2390         
2391             Copy-paste functions and fields from former LiveNodeListBase.
2392
2393         * html/HTMLNameCollection.cpp:
2394         (WebCore::HTMLNameCollection::~HTMLNameCollection):
2395         * html/LabelableElement.cpp:
2396         (WebCore::LabelableElement::labels):
2397         * html/LabelsNodeList.cpp:
2398         (WebCore::LabelsNodeList::~LabelsNodeList):
2399         * html/LabelsNodeList.h:
2400         * html/RadioNodeList.cpp:
2401         (WebCore::RadioNodeList::~RadioNodeList):
2402         * html/RadioNodeList.h:
2403         (WebCore::RadioNodeList::create):
2404
2405 2013-11-05  Emilio Pozuelo Monfort  <pochu27@gmail.com>
2406
2407         [GTK] Add stubs for missing symbols in dom bindings
2408         https://bugs.webkit.org/show_bug.cgi?id=123663
2409
2410         Reviewed by Carlos Garcia Campos.
2411
2412         * bindings/gobject/WebKitDOMCustom.cpp:
2413         (webkit_dom_html_head_element_get_profile):
2414         (webkit_dom_html_head_element_set_profile):
2415         (webkit_dom_processing_instruction_get_data):
2416         (webkit_dom_processing_instruction_set_data):
2417         * bindings/gobject/WebKitDOMCustom.h:
2418         * bindings/gobject/WebKitDOMCustom.symbols:
2419
2420 2013-11-05  Zan Dobersek  <zdobersek@igalia.com>
2421
2422         Main thread tasks in ThreadableBlobRegistry should use std::unique_ptr
2423         https://bugs.webkit.org/show_bug.cgi?id=122946
2424
2425         Reviewed by Darin Adler.
2426
2427         The new BlobRegistryContext objects don't have to be adopted into OwnPtr and then have OwnPtr's leaked pointer
2428         passed into the WTF::callOnMainThread call - the pointer to the new heap-allocated object is passed in directly,
2429         with the object ending up being managed by std::unique_ptr in the designated main thread task.
2430
2431         * fileapi/ThreadableBlobRegistry.cpp:
2432         (WebCore::registerBlobURLTask):
2433         (WebCore::ThreadableBlobRegistry::registerBlobURL):
2434         (WebCore::registerBlobURLFromTask):
2435         (WebCore::unregisterBlobURLTask):
2436         (WebCore::ThreadableBlobRegistry::unregisterBlobURL):
2437
2438 2013-11-05  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2439
2440         [CSS] Enable css-image-orientation on EFL and GTK ports.
2441         https://bugs.webkit.org/show_bug.cgi?id=123698
2442
2443         Reviewed by Beth Dakin.
2444
2445         r157909 added wrong early return for css-image-orientation. It causes about 20 regressions in layout test
2446         when enabling css-image-orientation. This fixes those wrong implementation as well as enables it on EFL
2447         and GTK ports by default.
2448
2449         Test: fast/css/image-orientation/image-orientation.html
2450
2451         * loader/cache/CachedImage.cpp:
2452         (WebCore::CachedImage::imageSizeForRenderer):
2453         * platform/graphics/BitmapImage.cpp:
2454         (WebCore::BitmapImage::updateSize):
2455
2456 2013-11-05  Andreas Kling  <akling@apple.com>
2457
2458         RenderEmbeddedObject shouldn't know about fallback content.
2459         <https://webkit.org/b/123781>
2460
2461         Stop caching the presence of fallback (DOM) content in a flag on
2462         RenderEmbeddedObject and have SubframeLoader fetch it directly from
2463         HTMLObjectElement instead.
2464
2465         Also made SubframeLoader::requestObject() take the owner element
2466         by reference since we don't support owner-less embedded objects.
2467
2468         Reviewed by Antti Koivisto.
2469
2470 2013-11-05  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2471
2472         [GStreamer] Remove NATIVE_FULLSCREEN_VIDEO support
2473         https://bugs.webkit.org/show_bug.cgi?id=123437
2474
2475         Reviewed by Philippe Normand.
2476
2477         Removed some dead code as no GStreamer port is using the native
2478         fullscreen video support.
2479
2480         * GNUmakefile.list.am:
2481         * PlatformEfl.cmake:
2482         * PlatformGTK.cmake: Removed compilation of deleted files.
2483         * platform/graphics/MediaPlayer.h: Removed structures related to
2484         GStreamer and NATIVE_FULLSCREEN_VIDEO.
2485         * platform/graphics/gstreamer/FullscreenVideoControllerGStreamer.cpp: Removed.
2486         * platform/graphics/gstreamer/FullscreenVideoControllerGStreamer.h: Removed.
2487         * platform/graphics/gstreamer/GStreamerGWorld.cpp: Removed.
2488         * platform/graphics/gstreamer/GStreamerGWorld.h: Removed.
2489         * platform/graphics/gstreamer/ImageGStreamerCairo.cpp: Removed
2490         gst/video/video.h include.
2491         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2492         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2493         (WebCore::MediaPlayerPrivateGStreamerBase::platformMedia):
2494         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
2495         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2496         Removed code related to GStreamer and NATIVE_FULLSCREEN_VIDEO.
2497         * platform/graphics/gstreamer/PlatformVideoWindow.h: Removed.
2498         * platform/graphics/gstreamer/PlatformVideoWindowEfl.cpp: Removed.
2499         * platform/graphics/gstreamer/PlatformVideoWindowGtk.cpp: Removed.
2500         * platform/graphics/gstreamer/PlatformVideoWindowMac.mm: Removed.
2501         * platform/graphics/gstreamer/PlatformVideoWindowNix.cpp: Removed.
2502         * platform/graphics/gstreamer/PlatformVideoWindowPrivate.h: Removed.
2503         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
2504         (webkitVideoSinkRender):
2505         (webkitVideoSinkNew):
2506         * platform/graphics/gstreamer/VideoSinkGStreamer.h: Removed code
2507         related to GStreamer and NATIVE_FULLSCREEN_VIDEO.
2508         * platform/graphics/gtk/FullscreenVideoControllerGtk.cpp: Removed.
2509         * platform/graphics/gtk/FullscreenVideoControllerGtk.h: Removed.
2510
2511 2013-11-05  Andreas Kling  <akling@apple.com>
2512
2513         Remove RenderWidget::viewCleared().
2514         <https://webkit.org/b/123777>
2515
2516         This was some ancient hand-waving code from the KHTML era.
2517
2518         It was obviously confused (e.g RenderEmbeddedObject trying to handle
2519         iframe owners, even though that setup is impossible.)
2520
2521         Reviewed by Anders Carlsson.
2522
2523 2013-11-04  Brady Eidson  <beidson@apple.com>
2524
2525         IDB: Split backend Cursors and Transactions into their own files
2526         https://bugs.webkit.org/show_bug.cgi?id=123789
2527
2528         Reviewed by Alexey Proskuryakov.
2529
2530         No new tests (Rename, no change in behavior).
2531
2532         * CMakeLists.txt:
2533         * GNUmakefile.list.am:
2534         * WebCore.xcodeproj/project.pbxproj:
2535
2536         * Modules/indexeddb/IDBBackingStoreCursorInterface.h:
2537         (WebCore::IDBBackingStoreCursorInterface::~IDBBackingStoreCursorInterface):
2538
2539         * Modules/indexeddb/IDBBackingStoreInterface.h:
2540
2541         * Modules/indexeddb/IDBBackingStoreTransactionInterface.h: Added.
2542         (WebCore::IDBBackingStoreTransactionInterface::~IDBBackingStoreTransactionInterface):
2543
2544         * Modules/indexeddb/IDBCursorBackendImpl.cpp:
2545         (WebCore::IDBCursorBackendImpl::IDBCursorBackendImpl):
2546         * Modules/indexeddb/IDBCursorBackendImpl.h:
2547         (WebCore::IDBCursorBackendImpl::create):
2548
2549         * Modules/indexeddb/IDBFactoryBackendInterface.h:
2550
2551         * Modules/indexeddb/IDBIndexWriter.cpp:
2552         (WebCore::IDBIndexWriter::writeIndexKeys):
2553         (WebCore::IDBIndexWriter::verifyIndexKeys):
2554         (WebCore::IDBIndexWriter::addingKeyAllowed):
2555         * Modules/indexeddb/IDBIndexWriter.h:
2556
2557         * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
2558         (WebCore::IDBTransactionBackendImpl::createCursorBackend):
2559         * Modules/indexeddb/IDBTransactionBackendImpl.h:
2560         * Modules/indexeddb/IDBTransactionBackendInterface.h:
2561
2562         * Modules/indexeddb/IDBTransactionBackendOperations.cpp:
2563         (WebCore::GetOperation::perform):
2564         (WebCore::OpenCursorOperation::perform):
2565         (WebCore::CountOperation::perform):
2566         (WebCore::DeleteRangeOperation::perform):
2567
2568         * Modules/indexeddb/leveldb/IDBBackingStoreCursorLevelDB.cpp: Added.
2569         (WebCore::IDBBackingStoreCursorLevelDB::IDBBackingStoreCursorLevelDB):
2570         (WebCore::IDBBackingStoreCursorLevelDB::firstSeek):
2571         (WebCore::IDBBackingStoreCursorLevelDB::advance):
2572         (WebCore::IDBBackingStoreCursorLevelDB::continueFunction):
2573         (WebCore::IDBBackingStoreCursorLevelDB::haveEnteredRange):
2574         (WebCore::IDBBackingStoreCursorLevelDB::isPastBounds):
2575         * Modules/indexeddb/leveldb/IDBBackingStoreCursorLevelDB.h: Added.
2576         (WebCore::IDBBackingStoreCursorLevelDB::~IDBBackingStoreCursorLevelDB):
2577         (WebCore::IDBBackingStoreCursorLevelDB::IDBBackingStoreCursorLevelDB):
2578
2579         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
2580         (WebCore::IDBBackingStoreLevelDB::compareIndexKeys):
2581         (WebCore::IDBBackingStoreLevelDB::updateIDBDatabaseVersion):
2582         (WebCore::IDBBackingStoreLevelDB::createObjectStore):
2583         (WebCore::IDBBackingStoreLevelDB::deleteObjectStore):
2584         (WebCore::IDBBackingStoreLevelDB::getRecord):
2585         (WebCore::IDBBackingStoreLevelDB::putRecord):
2586         (WebCore::IDBBackingStoreLevelDB::clearObjectStore):
2587         (WebCore::IDBBackingStoreLevelDB::deleteRecord):
2588         (WebCore::IDBBackingStoreLevelDB::getKeyGeneratorCurrentNumber):
2589         (WebCore::IDBBackingStoreLevelDB::maybeUpdateKeyGeneratorCurrentNumber):
2590         (WebCore::IDBBackingStoreLevelDB::keyExistsInObjectStore):
2591         (WebCore::IDBBackingStoreLevelDB::createIndex):
2592         (WebCore::IDBBackingStoreLevelDB::deleteIndex):
2593         (WebCore::IDBBackingStoreLevelDB::putIndexDataForRecord):
2594         (WebCore::findGreatestKeyLessThanOrEqual):
2595         (WebCore::IDBBackingStoreLevelDB::findKeyInIndex):
2596         (WebCore::IDBBackingStoreLevelDB::getPrimaryKeyViaIndex):
2597         (WebCore::IDBBackingStoreLevelDB::keyExistsInIndex):
2598         (WebCore::ObjectStoreKeyCursorImpl::create):
2599         (WebCore::ObjectStoreKeyCursorImpl::clone):
2600         (WebCore::ObjectStoreKeyCursorImpl::ObjectStoreKeyCursorImpl):
2601         (WebCore::ObjectStoreCursorImpl::create):
2602         (WebCore::ObjectStoreCursorImpl::clone):
2603         (WebCore::ObjectStoreCursorImpl::ObjectStoreCursorImpl):
2604         (WebCore::objectStoreCursorOptions):
2605         (WebCore::indexCursorOptions):
2606         (WebCore::IDBBackingStoreLevelDB::openObjectStoreCursor):
2607         (WebCore::IDBBackingStoreLevelDB::openObjectStoreKeyCursor):
2608         (WebCore::IDBBackingStoreLevelDB::openIndexKeyCursor):
2609         (WebCore::IDBBackingStoreLevelDB::openIndexCursor):
2610         (WebCore::IDBBackingStoreLevelDB::createBackingStoreTransaction):
2611         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.h:
2612  
2613        * Modules/indexeddb/leveldb/IDBBackingStoreTransactionLevelDB.cpp: Added.
2614         (WebCore::IDBBackingStoreTransactionLevelDB::IDBBackingStoreTransactionLevelDB):
2615         (WebCore::IDBBackingStoreTransactionLevelDB::begin):
2616         (WebCore::IDBBackingStoreTransactionLevelDB::commit):
2617         (WebCore::IDBBackingStoreTransactionLevelDB::rollback):
2618         * Modules/indexeddb/leveldb/IDBBackingStoreTransactionLevelDB.h:
2619
2620         * Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.cpp:
2621         (WebCore::IDBFactoryBackendLevelDB::createCursorBackend):
2622         * Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.h:
2623
2624 2013-11-04  Zalan Bujtas  <zalan@apple.com>
2625
2626         Do not call setFrameRect on Widget unless its boundaries changed.
2627         https://bugs.webkit.org/show_bug.cgi?id=123781
2628
2629         Reviewed by Andreas Kling.
2630
2631         Call Widget:setFrameRect only when the frame's rect actually changes. It also
2632         cleans up the related weak reference code a bit.
2633         
2634         Covered by existing tests.
2635
2636         * rendering/RenderWidget.cpp:
2637         (WebCore::RenderWidget::setWidgetGeometry): 
2638
2639 2013-11-04  Santosh Mahto  <santosh.ma@samsung.com>
2640
2641         [webcore/html] remove extra header includes from cpp files.
2642         https://bugs.webkit.org/show_bug.cgi?id=123740
2643
2644         Reviewed by Darin Adler.
2645
2646         Removing redundant headers.
2647
2648         * html/BaseDateAndTimeInputType.cpp:
2649         * html/ColorInputType.cpp:
2650         * html/DOMFormData.cpp:
2651         * html/DOMURL.cpp:
2652         * html/DateInputType.cpp:
2653         * html/DateTimeInputType.cpp:
2654         * html/DateTimeLocalInputType.cpp:
2655         * html/FTPDirectoryDocument.cpp:
2656         * html/FileInputType.cpp:
2657         * html/FormController.cpp:
2658         * html/HTMLAnchorElement.cpp:
2659         * html/HTMLAreaElement.cpp:
2660         * html/HTMLCanvasElement.cpp:
2661         * html/HTMLCollection.cpp:
2662         * html/HTMLDetailsElement.cpp:
2663         * html/HTMLDocument.cpp:
2664         * html/HTMLElement.cpp:
2665         * html/HTMLFormControlsCollection.cpp:
2666         * html/HTMLFormElement.cpp:
2667         * html/HTMLImageElement.cpp:
2668         * html/HTMLInputElement.cpp:
2669         * html/HTMLLegendElement.cpp:
2670         * html/HTMLMapElement.cpp:
2671         * html/HTMLMediaElement.cpp:
2672         * html/HTMLOptionElement.cpp:
2673         * html/HTMLOptionsCollection.cpp:
2674         * html/HTMLPlugInImageElement.cpp:
2675         * html/HTMLProgressElement.cpp:
2676         * html/HTMLSummaryElement.cpp:
2677         * html/HTMLTemplateElement.cpp:
2678         * html/HTMLVideoElement.cpp:
2679         * html/HTMLViewSourceDocument.cpp:
2680         * html/MediaController.cpp:
2681         * html/MediaKeyEvent.cpp:
2682         * html/MonthInputType.cpp:
2683         * html/RangeInputType.cpp:
2684         * html/StepRange.cpp:
2685         * html/TextFieldInputType.cpp:
2686         * html/TimeInputType.cpp:
2687         * html/WeekInputType.cpp:
2688         * html/canvas/CanvasRenderingContext.cpp:
2689         * html/canvas/CanvasRenderingContext2D.cpp:
2690         * html/canvas/CanvasStyle.cpp:
2691         * html/canvas/OESVertexArrayObject.cpp:
2692         * html/parser/BackgroundHTMLParser.cpp:
2693         * html/parser/CSSPreloadScanner.cpp:
2694         * html/parser/CompactHTMLToken.cpp:
2695         * html/parser/HTMLConstructionSite.cpp:
2696         * html/parser/HTMLDocumentParser.cpp:
2697         * html/parser/HTMLElementStack.cpp:
2698         * html/parser/HTMLFormattingElementList.cpp:
2699         * html/parser/HTMLMetaCharsetParser.cpp:
2700         * html/parser/HTMLParserIdioms.cpp:
2701         * html/parser/HTMLPreloadScanner.cpp:
2702         * html/parser/HTMLTokenizer.cpp:
2703         * html/parser/HTMLTreeBuilder.cpp:
2704         * html/parser/HTMLTreeBuilderSimulator.cpp:
2705         * html/parser/HTMLViewSourceParser.cpp:
2706         * html/parser/TextDocumentParser.cpp:
2707         * html/parser/XSSAuditor.cpp:
2708         * html/shadow/ContentDistributor.cpp:
2709         * html/shadow/InsertionPoint.cpp:
2710         * html/shadow/MediaControlElements.cpp:
2711         * html/shadow/MediaControlsApple.cpp:
2712         * html/shadow/MediaControlsBlackBerry.cpp:
2713         * html/shadow/MediaControlsGtk.cpp:
2714         * html/shadow/SliderThumbElement.cpp:
2715         * html/track/AudioTrack.cpp:
2716         * html/track/InbandGenericTextTrack.cpp:
2717         * html/track/InbandTextTrack.cpp:
2718         * html/track/InbandWebVTTTextTrack.cpp:
2719         * html/track/TextTrack.cpp:
2720         * html/track/TextTrackCueGeneric.cpp:
2721         * html/track/TextTrackList.cpp:
2722         * html/track/TextTrackRegion.cpp:
2723         * html/track/TrackListBase.cpp:
2724         * html/track/VideoTrack.cpp:
2725         * html/track/WebVTTParser.cpp:
2726
2727 2013-11-04  Brady Eidson  <beidson@apple.com>
2728
2729         IDB: deleteDatabase() interface should be asynchronous
2730         https://bugs.webkit.org/show_bug.cgi?id=123787
2731
2732         Reviewed by Tim Horton.
2733
2734         No new tests (No behavior change for a tested port).
2735
2736         deleteDatabase now has no return value, but calls back to a bool function:
2737         * Modules/indexeddb/IDBBackingStoreInterface.h:
2738         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
2739         (WebCore::IDBBackingStoreLevelDB::deleteDatabase):
2740         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.h:
2741
2742         Refactor to account for the new async deleteDatabase:
2743         * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
2744         (WebCore::IDBDatabaseBackendImpl::processPendingCalls):
2745         (WebCore::IDBDatabaseBackendImpl::deleteDatabase):
2746         (WebCore::IDBDatabaseBackendImpl::deleteDatabaseAsync):
2747         * Modules/indexeddb/IDBDatabaseBackendImpl.h:
2748
2749 2013-11-04  Brady Eidson  <beidson@apple.com>
2750
2751         Add Modules/indexeddb/leveldb to the WebCore.xcodeproj
2752
2753         Rubberstamped by Andreas Kling.
2754
2755         This will make hacking on IDB much easier for Mac developers as they won’t have
2756         to constantly add and then subtract the leveldb subdirectory.
2757
2758         The USE(LEVELDB) flag is still disabled so these files won’t actually build by default.
2759
2760         * WebCore.xcodeproj/project.pbxproj:
2761
2762 2013-11-04  Brady Eidson  <beidson@apple.com>
2763
2764         Address review feedback I forgot to commit in r158641
2765
2766         * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
2767         (WebCore::IDBDatabaseBackendImpl::processPendingOpenCalls):
2768
2769 2013-11-04  Brady Eidson  <beidson@apple.com>
2770
2771         IDB: Make opening/establishing a database asynchronous.
2772         https://bugs.webkit.org/show_bug.cgi?id=123775
2773
2774         Reviewed by Andreas Kling.
2775
2776         No new tests (No behavior change for a tested port).
2777
2778         * Modules/indexeddb/IDBBackingStoreInterface.h: Add getOrEstablishIDBDatabaseMetadata with a callback,
2779           removing getIDBDatabaseMetaData, getObjectStores, and createIDBDatabaseMetaData in the process.
2780
2781         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
2782         (WebCore::IDBBackingStoreLevelDB::getOrEstablishIDBDatabaseMetadata): Adapted from getIDBDatabaseMetaData,
2783           implement the asynchronous interface in terms of other LevelDB methods, always calling back synchronously.
2784         (WebCore::IDBBackingStoreLevelDB::createIDBDatabaseMetaData):
2785         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.h:
2786
2787         * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
2788         (WebCore::IDBDatabaseBackendImpl::create):
2789         (WebCore::IDBDatabaseBackendImpl::openInternalAsync): Broken off from openInternal.
2790         (WebCore::IDBDatabaseBackendImpl::didOpenInternalAsync): Broken off from openInternal.
2791         (WebCore::IDBDatabaseBackendImpl::processPendingCalls):
2792         (WebCore::IDBDatabaseBackendImpl::processPendingOpenCalls): Broken off to allow didOpenInternalAsync
2793           to perform open callbacks in the failure case.
2794         (WebCore::IDBDatabaseBackendImpl::openConnection): Always queue open connection calls, then immediately processPendingCalls.
2795         (WebCore::IDBDatabaseBackendImpl::openConnectionInternal): Actually perform open connection calls.
2796         * Modules/indexeddb/IDBDatabaseBackendImpl.h:
2797
2798
2799 2013-11-04  Andreas Kling  <akling@apple.com>
2800
2801         CTTE: RenderFrameBase's widget is always a FrameView.
2802         <https://webkit.org/b/123771>
2803
2804         Delete widget() from RenderFrameBase and supplant a childView()
2805         that returns FrameView*. Strip away unnecessary casts and asserts.
2806
2807         Reviewed by Antti Koivisto.
2808
2809 2013-11-04  Zoltan Horvath  <zoltan@webkit.org>
2810
2811         [CSS Regions][CSS Shapes] Content in region doesn't respect shape-outside after initial layout pass
2812         <https://webkit.org/b/114829>
2813
2814         Although we set the size of a shape for shape-outside in RenderBlockFlow::insertFloatingObject based on the
2815         float's size, the actual height of the float is not always resolved at that point. (Look at cases when the shape
2816         has percentage based height or percentage based radius.) ShapeInfo::setShapeSize triggers a layout for 0 height
2817         value, which will be overriden later, when RenderBlockFlow::positionNewFloats sets the actual size of the float (shape).
2818         Thus it doesn't make sense to set the shape's size in insertFloatingObject and run those extra unnecessary layout passes,
2819         since it'll be overriden anyways. I moved the shape size setting logic into RenderBlockFlow::positionNewFloats.
2820
2821         The problem showed up when we had a shape-outside ellipse with percentage based radius, and we inserted the content
2822         with JavaScript into a region flow. The content has been layed out based on the 0 border radius, and relayout hasn't been
2823         triggered when it flew into the flow. This change sets the shape size only when we already have the height of the float,
2824         so the radius(es) can be resolved correctly, thus no unnecessary layout passes will happen and the layout will be correct as well.
2825
2826         Reviewed by David Hyatt.
2827
2828         Test: fast/shapes/shape-outside-floats/shape-outside-floats-layout-after-initial-layout-pass.html
2829
2830         * rendering/RenderBlockFlow.cpp:
2831         (WebCore::RenderBlockFlow::insertFloatingObject): Remove setting the size of the shape.
2832         (WebCore::RenderBlockFlow::positionNewFloats): Set the size of the shape here.
2833
2834 2013-11-04  Samuel White  <samuel_white@apple.com>
2835
2836         AX: AXShowMenu doesn't always work.
2837         https://bugs.webkit.org/show_bug.cgi?id=123649
2838
2839         Reviewed by Chris Fleizach.
2840
2841         No new tests, the change occurs in a code path that forces the context menu to show which
2842         locks up DRT if we try to test it (platform menu is shown). The change itself gives the mouse
2843         event handler a chance to handle our platform mouse event BEFORE the event ends up in the show
2844         context menu machinery. This is necessary because without it, the element will not become
2845         focused. Without focus, accessibility shows different/less menu items than a mouse click. The
2846         end result is that context menus shown via accessibility are consistent with menus shown via click.
2847
2848         * page/ContextMenuController.cpp:
2849         (WebCore::ContextMenuController::showContextMenuAt):
2850
2851 2013-11-04  Jeffrey Pfau  <jpfau@apple.com>
2852
2853         SMIL timers can still fire after the containing document has been torn down
2854         <https://webkit.org/b/123291>
2855
2856         Reviewed by Darin Adler.
2857
2858         Ensure that the timers get paused when the document is preparing to be torn down.
2859
2860         Test: svg/animations/smil-timers-not-disabled-crash.html
2861
2862         * dom/Document.cpp:
2863         (WebCore::Document::dropChildren):
2864         (WebCore::Document::commonTeardown):
2865         (WebCore::Document::prepareForDestruction):
2866         * dom/Document.h:
2867
2868 2013-11-04  Brendan Long  <b.long@cablelabs.com>
2869
2870         Move duplicate code in TrackPrivate classes to a common base class
2871         https://bugs.webkit.org/show_bug.cgi?id=123619
2872
2873         Reviewed by Darin Adler.
2874
2875         No new tests because this is just refactoring.
2876
2877         * GNUmakefile.list.am: Add TrackPrivateBase.
2878         * WebCore.vcxproj/WebCore.vcxproj: Same.
2879         * WebCore.vcxproj/WebCore.vcxproj.filters: Same.
2880         * WebCore.xcodeproj/project.pbxproj: Same.
2881         * html/track/AudioTrack.cpp:
2882         (WebCore::AudioTrack::inbandTrackIndex): Renamed audioTrackIndex() to trackIndex().
2883         (WebCore::AudioTrack::labelChanged): First argument is now a TrackPrivateBase*.
2884         (WebCore::AudioTrack::languageChanged): Same.
2885         (WebCore::AudioTrack::willRemove): Same.
2886         * html/track/AudioTrack.h: Update TrackPrivateBaseClient function signatures.
2887         * html/track/InbandTextTrack.cpp:
2888         (WebCore::InbandTextTrack::inbandTrackIndex): Renamed textTrackIndex() to trackIndex().
2889         (WebCore::InbandTextTrack::labelChanged): First argument is now a TrackPrivateBase*.
2890         (WebCore::InbandTextTrack::languageChanged): Same.
2891         (WebCore::InbandTextTrack::willRemove): Same.
2892         * html/track/InbandTextTrack.h: Update TrackPrivateBaseClient function signatures.
2893         * html/track/VideoTrack.cpp:
2894         (WebCore::VideoTrack::inbandTrackIndex): Renamed videoTrackIndex() to trackIndex().
2895         (WebCore::VideoTrack::labelChanged): First argument is now a TrackPrivateBase*.
2896         (WebCore::VideoTrack::languageChanged): Same.
2897         (WebCore::VideoTrack::willRemove): Same.
2898         * html/track/VideoTrack.h: Update TrackPrivateBaseClient function signatures.
2899         * platform/graphics/AudioTrackPrivate.h: Remove code that was moved to TrackPrivateBase.
2900         * platform/graphics/InbandTextTrackPrivate.h: Same.
2901         * platform/graphics/InbandTextTrackPrivateClient.h: Same.
2902         * platform/graphics/VideoTrackPrivate.h: Same.
2903         * platform/graphics/TrackPrivateBase.h: Refactored out duplicate code in AudioTrackPrivate, InbandTextTrackPrivate and VideoTrackPrivate.
2904         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h: Renamed textTrackIndex() to trackIndex().
2905         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h: Same.
2906         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h: Renamed audioTrackIndex() to trackIndex().
2907         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h: Renamed videoTrackIndex() to trackIndex90.
2908
2909 2013-11-04  Andreas Kling  <akling@apple.com>
2910
2911         FrameView destructor is worried about being retained by a renderer.
2912         <https://webkit.org/b/123763>
2913
2914         There's no way we can be in ~FrameView() while also being owned by
2915         a RenderWidget. Remove some overly paranoid code that was making sure
2916         the renderer didn't have a reference on us.
2917
2918         Reviewed by Anders Carlsson.
2919
2920 2013-11-04  Eric Carlson  <eric.carlson@apple.com>
2921
2922         REGRESSION(r158311): media/media-fragments/TC0054.html and TC0061.html hit assertions
2923         https://bugs.webkit.org/show_bug.cgi?id=123555
2924
2925         Reviewed by Darin Adler.
2926
2927         No new tests, covered by existing tests.
2928
2929         * html/MediaFragmentURIParser.cpp:
2930         (WebCore::MediaFragmentURIParser::parseFragments): Don't add a fragment with empty key or value as
2931             they will not processed.
2932         (WebCore::MediaFragmentURIParser::parseNPTFragment): Remove excess whitespace.
2933
2934 2013-11-04  Patrick Gansterer  <paroga@webkit.org>
2935
2936         Remove code duplications in createFontCustomPlatformData()
2937         https://bugs.webkit.org/show_bug.cgi?id=123706
2938
2939         Reviewed by Darin Adler.
2940
2941         Move OpenTypeSanitizer and WOFF handling from the port specific
2942         implementations in createFontCustomPlatformData() into the only
2943         caller of this function CachedFont::ensureCustomFontData().
2944         Also change the parameter passing the SharedBuffer from a
2945         pointer to a reference since it is never null.
2946
2947         * loader/cache/CachedFont.cpp:
2948         (WebCore::CachedFont::ensureCustomFontData):
2949         * platform/graphics/blackberry/FontCustomPlatformData.h:
2950         * platform/graphics/blackberry/FontCustomPlatformDataBlackBerry.cpp:
2951         (WebCore::FontCustomPlatformData::FontCustomPlatformData):
2952         (WebCore::createFontCustomPlatformData):
2953         * platform/graphics/cairo/FontCustomPlatformData.h:
2954         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
2955         (WebCore::FontCustomPlatformData::FontCustomPlatformData):
2956         (WebCore::createFontCustomPlatformData):
2957         * platform/graphics/mac/FontCustomPlatformData.cpp:
2958         (WebCore::createFontCustomPlatformData):
2959         * platform/graphics/mac/FontCustomPlatformData.h:
2960         * platform/graphics/win/FontCustomPlatformData.cpp:
2961         (WebCore::createFontCustomPlatformData):
2962         * platform/graphics/win/FontCustomPlatformData.h:
2963         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
2964         (WebCore::createFontCustomPlatformData):
2965         * platform/graphics/wince/FontCustomPlatformData.cpp:
2966         (WebCore::createFontCustomPlatformData):
2967         * platform/graphics/wince/FontCustomPlatformData.h:
2968
2969 2013-11-04  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
2970
2971         Fixing MediaStreamDescriptor addSource and addTrack methods
2972         https://bugs.webkit.org/show_bug.cgi?id=123755
2973
2974         Reviewed by Eric Carlson.
2975
2976         We must store the track and source that is passed as parameter in a RefPtr,
2977         otherwise we will refer to a null pointer.
2978
2979         No new tests needed.
2980
2981         * platform/mediastream/MediaStreamDescriptor.cpp:
2982         (WebCore::MediaStreamDescriptor::addSource):
2983         (WebCore::MediaStreamDescriptor::addTrack):
2984
2985 2013-11-04  Tim Horton  <timothy_horton@apple.com>
2986
2987         Remove PlatformCALayer::playerLayer
2988         https://bugs.webkit.org/show_bug.cgi?id=123764
2989
2990         Reviewed by Sam Weinig.
2991
2992         * platform/graphics/ca/PlatformCALayer.h:
2993         * platform/graphics/ca/mac/PlatformCALayerMac.h:
2994         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
2995         (PlatformCALayerMac::clone):
2996         Remove playerLayer(), fold it into clone().
2997
2998 2013-11-04  Chris Fleizach  <cfleizach@apple.com>
2999
3000         AX: Mail attachments at the start of an email are not output by VoiceOver
3001         https://bugs.webkit.org/show_bug.cgi?id=123697
3002
3003         Reviewed by Ryosuke Niwa.
3004
3005         VoiceOver is expecting that "replaced elements" (attachments in a Mail message in this case) to be
3006         represented by the replacement character when asking for a stringForRange.
3007
3008         However, when that replaced element is at the beginning of the document, the logic does not work because
3009         there is a few code places that will take that first Position and advance it forward, not accounting for replaced elements.
3010         When using the TextIterator normally, it does account for these, so that's why it's only affecting as at the beginning of the document.
3011
3012         Also a "replaced element" can be more than just renderer->isReplaced(), hence the externing of the isRendererReplacedElement method
3013         and using that it in pertinent places.
3014
3015         Tests: platform/mac/accessibility/object-replacement-with-no-rendered-children-at-node-start.html
3016                platform/mac/accessibility/object-replacement-with-rendered-children-at-node-start.html
3017
3018         * accessibility/AccessibilityObject.cpp:
3019         (WebCore::replacedNodeNeedsCharacter):
3020         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3021         (nsStringForReplacedNode):
3022         * dom/Position.cpp:
3023         (WebCore::Position::isCandidate):
3024         * dom/PositionIterator.cpp:
3025         * dom/Range.cpp:
3026         (WebCore::Range::firstNode):
3027         * editing/TextIterator.cpp:
3028         (WebCore::isRendererReplacedElement):
3029         * editing/TextIterator.h:
3030
3031 2013-11-04  Andreas Kling  <akling@apple.com>
3032
3033         Use RenderAncestorIterator in a couple of places.
3034         <https://webkit.org/b/123725>
3035
3036         Take the ancestorsOfType<RenderMoo>() thingy out for a spin.
3037
3038         Found a bunch of parent chain walking loops that were really just
3039         looking for the first ancestor renderer of a certain type.
3040         They were a perfect fit for this pattern:
3041
3042             if (auto svgRoot = ancestorsOfType<RenderSVGRoot>(renderer).first())
3043                 svgRoot->shakeMoneyMaker();
3044
3045         Quite a bit clearer than the previous:
3046
3047             for (auto ancestor = renderer.parent(); ancestor; ancestor = ancestor->parent()) {
3048                 if (ancestor->isSVGRoot())
3049                     toRenderSVGRoot(ancestor)->makeMoneyShaker();
3050             }
3051
3052         Reviewed by Antti Koivisto.
3053
3054 2013-10-25  Jer Noble  <jer.noble@apple.com>
3055
3056         [MSE] Add a SourceBufferPrivateClient interface for platform -> html communication.
3057         https://bugs.webkit.org/show_bug.cgi?id=123373
3058
3059         Reviewed by Eric Carlson.
3060
3061         To enable communication between SourceBuffer and SourceBufferPrivate without introducing
3062         layering violations, add a new interface class SourceBufferPrivateInterface from which
3063         SourceBuffer will inherit.
3064
3065         * Modules/mediasource/SourceBuffer.cpp:
3066         (WebCore::SourceBuffer::SourceBuffer): Set the private's client.
3067         (WebCore::SourceBuffer::~SourceBuffer): Clear the private's client.
3068         (WebCore::SourceBuffer::sourceBufferPrivateDidEndStream): Added stub.
3069         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): Hinno.
3070         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Ditto.
3071         (WebCore::SourceBuffer::sourceBufferPrivateHasAudio): Ditto.
3072         (WebCore::SourceBuffer::sourceBufferPrivateHasVideo): Ditto.
3073         * Modules/mediasource/SourceBuffer.h:
3074         * WebCore.xcodeproj/project.pbxproj: Add new files to project.
3075         * platform/graphics/SourceBufferPrivate.h:
3076         * platform/graphics/SourceBufferPrivateClient.h: Added.
3077         (WebCore::SourceBufferPrivateClient::~SourceBufferPrivateClient): Empty destructor.
3078
3079 2013-11-01  Jer Noble  <jer.noble@apple.com>
3080
3081         [PluginProxy] Add a setting to disable video plugin proxy support in HTMLMediaElement.
3082         https://bugs.webkit.org/show_bug.cgi?id=123621
3083
3084         Reviewed by Eric Carlson.
3085
3086         Add a new Setting which will disable the video plugin proxy. Enable support for AVFoundation
3087         in iOS (which requries fixing a few compile errors resulting from classes and methods which
3088         are not available on iOS.
3089
3090         * WebCore.exp.in: Export wkAVAssetResolvedURL.
3091         * css/StyleResolver.cpp:
3092         (WebCore::StyleResolver::canShareStyleWithElement): Make conditional upon
3093             new isVideoPluginProxyEnabled() setting.
3094         * html/HTMLMediaElement.cpp:
3095         (WebCore::HTMLMediaElement::parseAttribute): Ditto.
3096         * html/HTMLMediaElement.h:
3097         * html/HTMLVideoElement.cpp:
3098         (WebCore::HTMLVideoElement::createRenderer): Ditto.
3099         (WebCore::HTMLVideoElement::attach): Ditto.
3100         (WebCore::HTMLVideoElement::parseAttribute): Ditto.
3101         (HTMLVideoElement::setDisplayMode): Ditto.
3102         * html/HTMLVideoElement.h:
3103         * page/Settings.cpp:
3104         (WebCore::Settings::setVideoPluginProxyEnabled): Simple setter.
3105         * page/Settings.h:
3106         (WebCore::Settings::isVideoPluginProxyEnabled): Simple getter.
3107         * platform/graphics/MediaPlayer.cpp:
3108         (WebCore::installedMediaEngines): Conditionally add MediaPlayerPrivateIOS and always add
3109             MediaPlayerPriateAVFoundationObjC.
3110         * platform/graphics/MediaPlayerPrivate.h:
3111         (WebCore::MediaPlayerPrivateInterface::deliverNotification): Add default implementation.
3112         (WebCore::MediaPlayerPrivateInterface::setMediaPlayerProxy): Ditto.
3113         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3114         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3115         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): Use new
3116             HAS_ and USE_ macros instead of __MAC_OS_MIN_VERNSION_REQUIRED.
3117         (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC): Ditto.
3118         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasContextRenderer): Ditto.
3119         (WebCore::MediaPlayerPrivateAVFoundationObjC::createContextVideoRenderer): Ditto.
3120         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyContextVideoRenderer): Ditto.
3121         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto.
3122         (WebCore::MediaPlayerPrivateAVFoundationObjC::paint): Ditto.
3123         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer): Use cachedCGColor instead
3124             of CGColorGetConstantColor.
3125         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput): Use CVPixelBuffer pixel
3126             format constant instead of QuickDraw constant.
3127         (WebCore::MediaPlayerPrivateAVFoundationObjC::createPixelBuffer): Ditto.
3128         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput): Draw to intermediary
3129             CGImage on iOS.
3130         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
3131         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
3132         * platform/ios/WebCoreSystemInterfaceIOS.mm:
3133         * platform/mac/WebCoreSystemInterface.h:
3134
3135 2013-11-04  Andreas Kling  <akling@apple.com>
3136
3137         REGRESSION(r158561): fast/block/float/float-append-child-crash.html asserting.
3138
3139         The non-const ancestor iterator was walking siblings, not ancestors.
3140
3141         Rubber-stamped by Antti Koivisto.
3142
3143 2013-10-31  Jer Noble  <jer.noble@apple.com>
3144
3145         [MSE] [Mac] Disclaim support for MSE in AVFoundation and QTKit engines
3146         https://bugs.webkit.org/show_bug.cgi?id=123593
3147
3148         Reviewed by Eric Carlson.
3149
3150         Immediately fail if asked to load a Media Source in engines which do not support
3151         them.
3152
3153         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3154         (WebCore::MediaPlayerPrivateAVFoundation::load):
3155         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
3156         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3157         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
3158         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
3159         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3160         (WebCore::MediaPlayerPrivateQTKit::load):
3161         (WebCore::MediaPlayerPrivateQTKit::supportsType):
3162
3163 2013-11-04  Hans Muller  <hmuller@adobe.com>
3164
3165         [CSS Shapes] image valued shape element margin can cause an ASSERT fail
3166         https://bugs.webkit.org/show_bug.cgi?id=123743
3167
3168         Reviewed by Andreas Kling.
3169
3170         When margin-top is specified for a shape's element, the Y coordinates passed
3171         to RasterShapeIntervals::getExcludedIntervals() may be negative. This is
3172         because the incoming logical coordinates are relative to the content or
3173         padding box, depending on the box-sizing property. The RasterShape::getExcludedIntervals()
3174         method now clips the incoming Y coordinates to the shape's bounds before
3175         accessing the shape's intervals.
3176
3177         Test: fast/shapes/shape-outside-floats/shape-outside-floats-margin-crash.html
3178
3179         * rendering/shapes/RasterShape.cpp:
3180         (WebCore::RasterShapeIntervals::getExcludedIntervals):
3181
3182 2013-11-04  Antti Koivisto  <antti@apple.com>
3183
3184         Make LiveNodeListBase use Elements instead of Nodes
3185         https://bugs.webkit.org/show_bug.cgi?id=123745
3186
3187         Reviewed by Anders Carlsson.
3188
3189         * WebCore.exp.in:
3190         * dom/Element.cpp:
3191         (WebCore::Element::firstElementChild):
3192         (WebCore::Element::lastElementChild):
3193         
3194             Switch to correct calls. ElementTraversal::previous and previousChild are no longer equivalent.
3195
3196         * dom/ElementTraversal.h:
3197         (WebCore::::lastWithinTemplate):
3198         (WebCore::::previousTemplate):
3199         
3200             Fix ElementTraversal::lastWithin and previous. They had no real clients and didn't work correctly.
3201             With LiveNodeListBase starting to use these they get excellent test coverage.
3202
3203         * dom/LiveNodeList.cpp:
3204         (WebCore::LiveNodeListBase::invalidateCache):
3205         * dom/LiveNodeList.h:
3206         (WebCore::LiveNodeListBase::LiveNodeListBase):
3207         (WebCore::LiveNodeListBase::isElementCacheValid):
3208         (WebCore::LiveNodeListBase::cachedElement):
3209         (WebCore::LiveNodeListBase::cachedElementOffset):
3210         (WebCore::LiveNodeListBase::setCachedElement):
3211         
3212             Make the cache Element based.
3213             Switch to Elements in all helpers.
3214             Rename item -> element for clarity.
3215
3216         * dom/NodeIterator.cpp:
3217         (WebCore::NodeIterator::NodePointer::moveToPrevious):
3218         (WebCore::NodeIterator::updateForNodeRemoval):
3219         
3220             This code expected the old inconsistent NodeTraversal::previous behavior where the traversal includes
3221             the root as the last item. Drop the stayWithin parameter and handle the one case where it is needed here.
3222
3223         * dom/NodeTraversal.cpp:
3224         (WebCore::NodeTraversal::last):
3225         (WebCore::NodeTraversal::deepLastChild):
3226         * dom/NodeTraversal.h:
3227         
3228             Support ElementTraversal::previous/lastWithin.
3229
3230         (WebCore::NodeTraversal::previous):
3231         
3232             This was slightly wrong too.
3233
3234         * html/HTMLCollection.cpp:
3235         (WebCore::previousElement):
3236         (WebCore::lastElement):
3237         (WebCore::LiveNodeListBase::iterateForPreviousElement):
3238         (WebCore::LiveNodeListBase::itemBefore):
3239         (WebCore::LiveNodeListBase::isLastItemCloserThanLastOrCachedItem):
3240         (WebCore::LiveNodeListBase::isFirstItemCloserThanCachedItem):
3241         (WebCore::LiveNodeListBase::setCachedElement):
3242         (WebCore::LiveNodeListBase::item):
3243         (WebCore::LiveNodeListBase::elementBeforeOrAfterCachedElement):
3244         * html/HTMLCollection.h:
3245         (WebCore::HTMLCollection::isEmpty):
3246         (WebCore::HTMLCollection::hasExactlyOneItem):
3247
3248 2013-11-04  Michael Saboff  <msaboff@apple.com>
3249
3250         Eliminate HostCall bit from JSC Stack CallerFrame
3251         https://bugs.webkit.org/show_bug.cgi?id=123642
3252
3253         Reviewed by Geoffrey Garen.
3254
3255         Updated JavaScript stack walking as a result of the corresponding changes made in
3256         JavaScriptCore.
3257
3258         * bindings/js/ScriptController.cpp:
3259         (WebCore::ScriptController::shouldBypassMainWorldContentSecurityPolicy):
3260         * bindings/js/ScriptDebugServer.cpp:
3261         (WebCore::ScriptDebugServer::stepOutOfFunction):
3262         (WebCore::ScriptDebugServer::returnEvent):
3263         (WebCore::ScriptDebugServer::didExecuteProgram):
3264
3265 2013-11-04  Bem Jones-Bey  <bjonesbe@adobe.com>
3266
3267         [css shapes] Fix support for shape-outside on a float with padding
3268         https://bugs.webkit.org/show_bug.cgi?id=123590
3269
3270         Reviewed by Alexandru Chiculita.
3271
3272         The line top was being improperly converted to the coordinates of the
3273         shape, causing the shape to be positioned incorrectly when the float
3274         had padding. This fixes that problem.
3275
3276         No new tests, covered by updates to existing ones.
3277
3278         * rendering/shapes/ShapeOutsideInfo.cpp:
3279         (WebCore::ShapeOutsideInfo::updateDeltasForContainingBlockLine):
3280
3281 2013-11-04  Alexey Proskuryakov  <ap@apple.com>
3282
3283         Implement generateKey for HMAC and AES-CBC
3284         https://bugs.webkit.org/show_bug.cgi?id=123669
3285
3286         Reviewed by Dan Bernstein.
3287
3288         Tests: crypto/subtle/aes-cbc-generate-key.html
3289                crypto/subtle/hmac-generate-key.html
3290
3291         * WebCore.xcodeproj/project.pbxproj: Added new files.
3292
3293         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
3294         (WebCore::createAesKeyGenParams): Added bindings for AesKeyGenParams.
3295         (WebCore::JSCryptoAlgorithmDictionary::createParametersForGenerateKey): Handle
3296         algorithms that generate AES and HMAC keys.
3297
3298         * bindings/js/JSSubtleCryptoCustom.cpp: (WebCore::JSSubtleCrypto::generateKey): Added.
3299
3300         * crypto/CryptoAlgorithmAesKeyGenParams.h: Added.
3301
3302         * crypto/CryptoKey.cpp: (WebCore::CryptoKey::randomData):
3303         * crypto/CryptoKey.h:
3304         * crypto/CryptoKeyMac.cpp: Added
3305         Expose a function that produces random data for symmetric crypto keys. Cross-platform
3306         implementation uses ARC4 code from WTF, while Mac uses a system function that
3307         provides a FIPS validated random number generator.
3308
3309         * crypto/CryptoKeyAES.cpp: (WebCore::CryptoKeyAES::generate):
3310         * crypto/CryptoKeyAES.h:
3311         Added a function that creates AES keys.
3312
3313         * crypto/SubtleCrypto.idl: Added generateKey.
3314
3315         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
3316         (WebCore::CryptoAlgorithmAES_CBC::generateKey): Added.
3317
3318         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
3319         (WebCore::CryptoAlgorithmHMAC::generateKey): Added.
3320
3321         * crypto/keys/CryptoKeyHMAC.cpp: (WebCore::CryptoKeyHMAC::generate):
3322         * crypto/keys/CryptoKeyHMAC.h:
3323         Added a function that creates HMAC keys.
3324
3325         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp: Removed generateKey stub, the implementation
3326         ended up in cross-platform file.
3327
3328         * crypto/mac/CryptoAlgorithmHMACMac.cpp: Ditto.
3329
3330 2013-11-04  Daniel Bates  <dabates@apple.com>
3331
3332         Revert SetCGFontRenderingMode() build fix for Chromium Mac
3333         https://bugs.webkit.org/show_bug.cgi?id=123633
3334
3335         Reviewed by Darin Adler.
3336
3337         Reverts <http://trac.webkit.org/changeset/134380>, which
3338         was a Chromium Mac build fix for <http://trac.webkit.org/changeset/134348>
3339         (https://bugs.webkit.org/show_bug.cgi?id=101787). Chromium doesn't
3340         build against top-of-tree WebKit.
3341
3342         * platform/graphics/mac/FontMac.mm:
3343         (WebCore::Font::drawGlyphs):
3344         * platform/mac/WebCoreSystemInterface.h:
3345         * platform/mac/WebCoreSystemInterface.mm:
3346
3347 2013-11-04  Commit Queue  <commit-queue@webkit.org>
3348
3349         Unreviewed, rolling out r158526.
3350         http://trac.webkit.org/changeset/158526
3351         https://bugs.webkit.org/show_bug.cgi?id=123744
3352
3353         it broke the build (Requested by jessieberlin on #webkit).
3354
3355         * WebCore.xcodeproj/project.pbxproj:
3356         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
3357         (WebCore::createAesCbcParams):
3358         (WebCore::createHmacParams):
3359         (WebCore::createHmacKeyParams):
3360         (WebCore::JSCryptoAlgorithmDictionary::createParametersForGenerateKey):
3361         * bindings/js/JSSubtleCryptoCustom.cpp:
3362         * crypto/CryptoAlgorithmAesKeyGenParams.h: Removed.
3363         * crypto/CryptoKey.cpp:
3364         * crypto/CryptoKey.h:
3365         * crypto/CryptoKeyAES.cpp:
3366         * crypto/CryptoKeyAES.h:
3367         * crypto/CryptoKeyMac.cpp: Removed.
3368         * crypto/SubtleCrypto.idl:
3369         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
3370         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
3371         * crypto/keys/CryptoKeyHMAC.cpp:
3372         * crypto/keys/CryptoKeyHMAC.h:
3373         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
3374         (WebCore::CryptoAlgorithmAES_CBC::generateKey):
3375         * crypto/mac/CryptoAlgorithmHMACMac.cpp:
3376         (WebCore::CryptoAlgorithmHMAC::generateKey):
3377
3378 2013-11-04  Przemyslaw Szymanski  <p.szymanski3@samsung.com>
3379
3380         [Texmap] Remove redundant calls in CoordinatedGraphicsScene
3381         https://bugs.webkit.org/show_bug.cgi?id=123737
3382
3383         Reviewed by Noam Rosenthal.
3384
3385         Removing unused code left after few refactoring patches.
3386
3387         No new tests. Covered by existing ones.
3388
3389         * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:
3390         (WebCore::CoordinatedGraphicsScene::paintToCurrentGLContext):
3391
3392 2013-11-04  Andreas Kling  <akling@apple.com>
3393
3394         CSSPrimitiveValue color constructors should return PassRef.
3395         <https://webkit.org/b/123728>
3396
3397         Make CSSPrimitiveValue::createColor() and the corresponding
3398         CSSValuePool helper functions return PassRef<CSSPrimitiveValue>.
3399
3400         Also made CSSValuePool slightly less stupid when hitting the upper
3401         size limit on the color value cache: instead of throwing out cache
3402         and rebuilding it from scratch, just remove one value at random.
3403
3404         Reviewed by Antti Koivisto.
3405
3406 2013-11-04  Andreas Kling  <akling@apple.com>
3407
3408         Some more RenderChildIterator deployment.
3409         <https://webkit.org/b/123735>
3410
3411         Convert another handful of loops to use childrenOfType<RenderFoo>
3412         iterators, mostly for skipping over uninteresting text renderers.
3413
3414         Reviewed by Antti Koivisto.
3415
3416 2013-11-04  Andreas Kling  <akling@apple.com>
3417
3418         LabelsNodeList always is always rooted at a LabelableElement.
3419         <https://webkit.org/b/123730>
3420
3421         Tighten up LabelsNodeList by enforcing that it's only rooted to
3422         a LabelableElement. Also marked the class FINAL and made its
3423         create() helper return PassRef.
3424
3425         Reviewed by Antti Koivisto.
3426
3427 2013-11-04  Andreas Kling  <akling@apple.com>
3428
3429         REGRESSION: RenderStyle is leaked when not creating renderer for display:none
3430         <https://webkit.org/b/123726>
3431
3432         Explicitly drop the RenderStyle reference in RenderElement::createFor
3433         if we decide to not create any renderer.
3434
3435         Reviewed by Antti Koivisto.
3436
3437         Test: fast/css/renderstyle-leak-with-display-none.html
3438
3439         * rendering/RenderElement.cpp:
3440         (WebCore::RenderElement::createFor):
3441
3442 2013-11-04  Santosh Mahto  <santosh.ma@samsung.com>
3443
3444         [webcore/dom] Remove extra header includes from cpp files.
3445         https://bugs.webkit.org/show_bug.cgi?id=123720
3446
3447         Reviewed by Andreas Kling.
3448
3449         Removing redundant headers from dom related cpp files.
3450
3451         * dom/Attr.cpp:
3452         * dom/CharacterData.cpp:
3453         * dom/ChildListMutationScope.cpp:
3454         * dom/ChildNodeList.cpp:
3455         * dom/ContainerNode.cpp:
3456         * dom/ContainerNodeAlgorithms.cpp:
3457         * dom/DOMNamedFlowCollection.cpp:
3458         * dom/DatasetDOMStringMap.cpp:
3459         * dom/Document.cpp:
3460         * dom/DocumentEventQueue.cpp:
3461         * dom/DocumentMarkerController.cpp:
3462         * dom/DocumentOrderedMap.cpp:
3463         * dom/DocumentStyleSheetCollection.cpp:
3464         * dom/Element.cpp:
3465         * dom/ElementRareData.cpp:
3466         * dom/Event.cpp:
3467         * dom/EventContext.cpp:
3468         * dom/EventDispatcher.cpp:
3469         * dom/EventTarget.cpp:
3470         * dom/ExceptionBase.cpp:
3471         * dom/FocusEvent.cpp:
3472         * dom/InlineStyleSheetOwner.cpp:
3473         * dom/KeyboardEvent.cpp:
3474         * dom/LiveNodeList.cpp:
3475         * dom/MessageEvent.cpp:
3476         * dom/MessagePort.cpp:
3477         * dom/MouseRelatedEvent.cpp:
3478         * dom/MutationEvent.cpp:
3479         * dom/MutationObserver.cpp:
3480         * dom/MutationObserverInterestGroup.cpp:
3481         * dom/MutationObserverRegistration.cpp:
3482         * dom/MutationRecord.cpp:
3483         * dom/NameNodeList.cpp:
3484         * dom/NamedFlowCollection.cpp:
3485         * dom/NamedNodeMap.cpp:
3486         * dom/Node.cpp:
3487         * dom/NodeIterator.cpp:
3488         * dom/NodeTraversal.cpp:
3489         * dom/PositionIterator.cpp:
3490         * dom/ProcessingInstruction.cpp:
3491         * dom/Range.cpp:
3492         * dom/RegisteredEventListener.cpp:
3493         * dom/ScopedEventQueue.cpp:
3494         * dom/ScriptElement.cpp:
3495         * dom/ScriptRunner.cpp:
3496         * dom/SelectorQuery.cpp:
3497         * dom/ShadowRoot.cpp:
3498         * dom/StyledElement.cpp:
3499         * dom/TagNodeList.cpp:
3500         * dom/Text.cpp:
3501         * dom/TextEvent.cpp:
3502         * dom/TouchEvent.cpp:
3503         * dom/TreeScope.cpp:
3504         * dom/TreeScopeAdopter.cpp:
3505         * dom/TreeWalker.cpp:
3506         * dom/UIEvent.cpp:
3507         * dom/UserActionElementSet.cpp:
3508         * dom/UserTypingGestureIndicator.cpp:
3509         * dom/VisitedLinkState.cpp:
3510         * dom/WebKitNamedFlow.cpp:
3511
3512 2013-11-04  Andreas Kling  <akling@apple.com>
3513
3514         HTMLAllCollection is always rooted at a Document.
3515         <https://webkit.org/b/123724>
3516
3517         Tighten up HTMLAllCollection by making the constructor take a
3518         Document& instead of a ContainerNode&. Drive-by application of
3519         FINAL and PassRef also happened.
3520
3521         Reviewed by Antti Koivisto.
3522
3523 2013-11-04  Andreas Kling  <akling@apple.com>
3524
3525         Make more CSSValue subclass constructors return PassRef.
3526         <https://webkit.org/b/123731>
3527
3528         Make the constructor helpers for the following classes return
3529         PassRef instead of PassRefPtr:
3530
3531             - CSSFontValue
3532             - CSSImageSetValue
3533             - CSSUnicodeRangeValue
3534             - WebKitCSSArrayFunctionValue
3535             - WebKitCSSFilterValue
3536             - WebKitCSSMatFunctionValue
3537             - WebKitCSSMixFunctionValue
3538             - WebKitCSSShaderValue
3539             - WebKitCSSTransformValue
3540
3541         Reviewed by Antti Koivisto.
3542
3543 2013-11-04  Jozsef Berta  <jberta@inf.u-szeged.hu>
3544
3545         Buildfix after r158182 for GCC 4.6
3546         https://bugs.webkit.org/show_bug.cgi?id=123442
3547
3548         Reviewed by Csaba Osztrogonác.
3549
3550         Added explicit "friend class", because  GCC 4.6 doesn't support extended friend declaration (c++11)
3551
3552         * dom/ScopedEventQueue.h:
3553
3554 2013-11-04  Andreas Kling  <akling@apple.com>
3555
3556         HTMLTableRowsCollection is always rooted at a HTMLTableElement.
3557         <https://webkit.org/b/123721>
3558
3559         Tighten up HTMLTableRowsCollection by making the create() helper
3560         take a HTMLTableElement& and adding a HTMLSelectElement& getter.
3561
3562         Reviewed by Antti Koivisto.
3563
3564 2013-11-04  Andreas Kling  <akling@apple.com>
3565
3566         HTMLNameCollection and friends are always rooted at a Document.
3567         <https://webkit.org/b/123722>
3568
3569         Tighten WindowNameCollection and DocumentNameCollection by making
3570         their constructors take a Document&, and add a slightly better
3571         document() than the one we inherit from LiveNodeListBase.
3572
3573         Also marked the classes FINAL and made create() helpers return
3574         PassRef instead of PassRefPtr.
3575
3576         Reviewed by Antti Koivisto.
3577
3578 2013-11-04  Andreas Kling  <akling@apple.com>
3579
3580         Add an ancestor renderer iterator.
3581         <https://webkit.org/b/123718>
3582
3583         Add ancestor iterators for renderers, analogous to element ancestor
3584         iterators. They walk the chain of parent renderers, stopping at each
3585         ancestor of a certain type.
3586
3587         Just like child renderer iterators, this requires isRendererOfType()
3588         to be implemented for the targeted renderer class.
3589
3590         You use them like this:
3591
3592         auto frameSets = ancestorsOfType<RenderFrameSet>(*this);
3593         for (auto frameSet = frameSets.begin(), end = frameSets.end(); frameSet != end; ++frameSet)
3594             frameSet->thisOrThat();
3595
3596         To complete the patch, I put them to use in a couple of random places.
3597
3598         Reviewed by Antti Koivisto.
3599
3600 2013-11-04  Mihnea Ovidenie  <mihnea@adobe.com>
3601
3602         [CSSRegions] Use auto keyword to clean-up for loops
3603         https://bugs.webkit.org/show_bug.cgi?id=123699
3604
3605         Reviewed by Anders Carlsson.
3606
3607         Start using auto keyword for loops.
3608         Also, since region breaks (forced breaks) can be added only on boxes,
3609         i changed RenderFlowThread::addForcedRegionBreak to use a RenderBox* instead of RenderObject*.
3610
3611         No change in functionality, no new tests.
3612
3613         * dom/WebKitNamedFlow.cpp:
3614         (WebCore::WebKitNamedFlow::firstEmptyRegionIndex):
3615         * rendering/FlowThreadController.cpp:
3616         (WebCore::FlowThreadController::ensureRenderFlowThreadWithName):
3617         (WebCore::FlowThreadController::styleDidChange):
3618         (WebCore::FlowThreadController::layoutRenderNamedFlowThreads):
3619         (WebCore::FlowThreadController::updateFlowThreadsChainIfNecessary):
3620         (WebCore::FlowThreadController::updateFlowThreadsNeedingLayout):
3621         (WebCore::FlowThreadController::updateFlowThreadsNeedingTwoStepLayout):
3622         (WebCore::FlowThreadController::resetFlowThreadsWithAutoHeightRegions):
3623         (WebCore::FlowThreadController::updateFlowThreadsIntoConstrainedPhase):
3624         (WebCore::FlowThreadController::updateFlowThreadsIntoOverflowPhase):
3625         (WebCore::FlowThreadController::updateFlowThreadsIntoMeasureContentPhase):
3626         (WebCore::FlowThreadController::updateFlowThreadsIntoFinalPhase):
3627         (WebCore::FlowThreadController::updateRenderFlowThreadLayersIfNeeded):
3628         (WebCore::FlowThreadController::collectFixedPositionedLayers):
3629         (WebCore::FlowThreadController::isAutoLogicalHeightRegionsCountConsistent):
3630         * rendering/RenderFlowThread.cpp:
3631         (WebCore::RenderFlowThread::validateRegions):
3632         (WebCore::RenderFlowThread::hasCompositingRegionDescendant):
3633         (WebCore::RenderFlowThread::getLayerListForRegion):
3634         (WebCore::RenderFlowThread::updateLayerToRegionMappings):
3635         (WebCore::RenderFlowThread::updateLogicalWidth):
3636         (WebCore::RenderFlowThread::computeLogicalHeight):
3637         (WebCore::RenderFlowThread::repaintRectangleInRegions):
3638         (WebCore::RenderFlowThread::removeRenderBoxRegionInfo):
3639         (WebCore::RenderFlowThread::logicalWidthChangedInRegionsForBlock):
3640         (WebCore::RenderFlowThread::clearRenderObjectCustomStyle):
3641         (WebCore::RenderFlowThread::clearRenderBoxRegionInfoAndCustomStyle):
3642         (WebCore::RenderFlowThread::setRegionRangeForBox):
3643         (WebCore::RenderFlowThread::getRegionRangeForBox):
3644         (WebCore::RenderFlowThread::regionInRange):
3645         (WebCore::RenderFlowThread::checkRegionsWithStyling):
3646         (WebCore::RenderFlowThread::objectInFlowRegion):
3647         (WebCore::RenderFlowThread::isAutoLogicalHeightRegionsCountConsistent):
3648         (WebCore::RenderFlowThread::initializeRegionsComputedAutoHeight):
3649         (WebCore::RenderFlowThread::markAutoLogicalHeightRegionsForLayout):
3650         (WebCore::RenderFlowThread::markRegionsForOverflowLayoutIfNeeded):
3651         (WebCore::RenderFlowThread::updateRegionsFlowThreadPortionRect):
3652         (WebCore::RenderFlowThread::addForcedRegionBreak):
3653         (WebCore::RenderFlowThread::collectLayerFragments):
3654         (WebCore::RenderFlowThread::fragmentsBoundingBox):
3655         (WebCore::RenderFlowThread::addRegionsVisualEffectOverflow):
3656         (WebCore::RenderFlowThread::addRegionsVisualOverflowFromTheme):
3657         (WebCore::RenderFlowThread::addRegionsOverflowFromChild):
3658         (WebCore::RenderFlowThread::addRegionsLayoutOverflow):
3659         (WebCore::RenderFlowThread::clearRegionsOverflow):
3660         * rendering/RenderFlowThread.h:
3661         * rendering/RenderNamedFlowThread.cpp:
3662         (WebCore::RenderNamedFlowThread::nextRendererForNode):
3663         (WebCore::RenderNamedFlowThread::previousRendererForNode):
3664         (WebCore::RenderNamedFlowThread::dependsOn):
3665         (WebCore::addRegionToList):
3666         (WebCore::RenderNamedFlowThread::computeOversetStateForRegions):
3667         (WebCore::RenderNamedFlowThread::checkInvalidRegions):
3668         (WebCore::RenderNamedFlowThread::pushDependencies):
3669         * rendering/RenderRegion.cpp:
3670         (WebCore::RenderRegion::setRegionObjectsRegionStyle):
3671         (WebCore::RenderRegion::restoreRegionObjectsOriginalStyle):
3672         (WebCore::RenderRegion::computeChildrenStyleInRegion):
3673
3674 2013-11-03  Zan Dobersek  <zdobersek@igalia.com>
3675
3676         PingLoader objects unnecessarily pass through OwnPtr
3677         https://bugs.webkit.org/show_bug.cgi?id=122942
3678
3679         Reviewed by Darin Adler.
3680
3681         There's no need to store new PingLoader objects into an OwnPtr just to leak them out a few lines later
3682         into an unused variable. New objects are created through a new helper method and then left unmanaged as
3683         they're guaranteed to destroy themselves when they receive a response of any kind.
3684
3685         * loader/PingLoader.cpp:
3686         (WebCore::PingLoader::loadImage): Call the new createPingLoader method to spawn the PingLoader.
3687         (WebCore::PingLoader::sendPing): Ditto.
3688         (WebCore::PingLoader::sendViolationReport): Ditto.
3689         (WebCore::PingLoader::createPingLoader): A helper method that creates a new PingLoader object
3690         * loader/PingLoader.h: Declare the new PingLoader::createPingLoader method.
3691
3692 2013-11-03  Andreas Kling  <akling@apple.com>
3693
3694         HTMLOptionsCollection is always rooted at a HTMLSelectElement.
3695         <https://webkit.org/b/123719>
3696
3697         Tighten up HTMLOptionsCollection by making the constructor take
3698         a HTMLSelectElement& and adding a HTMLSelectElement& getter instead
3699         of casting all over the place. Removed now-pointless assertions.
3700
3701         Reviewed by Sam Weinig.
3702
3703 2013-11-03  Andreas Kling  <akling@apple.com>
3704
3705         RenderTextFragment: Tighten first-letter logic.
3706         <https://webkit.org/b/123714>
3707
3708         Reviewed by Antti Koivisto.
3709
3710         * editing/TextIterator.cpp:
3711         (WebCore::firstRenderTextInFirstLetter):
3712
3713             Use iterator helper to find first RenderText child.
3714
3715         (WebCore::TextIterator::handleTextNodeFirstLetter):
3716
3717             Tightening through type inference.
3718
3719         * rendering/RenderBlock.cpp:
3720         (WebCore::RenderBlock::updateFirstLetterStyle):
3721         (WebCore::RenderBlock::createFirstLetterRenderer):
3722         * rendering/RenderTextFragment.h:
3723
3724             The first letter renderer is always a RenderBoxModelObject,
3725             so make the code deal in that instead of RenderObject.
3726
3727         * rendering/RenderChildIterator.h:
3728         (WebCore::RenderChildIteratorAdapter::first):
3729         (WebCore::RenderChildIteratorAdapter::last):
3730
3731             Remove excess ampersands that were keeping this from building.
3732
3733 2013-11-03  Andreas Kling  <akling@apple.com>
3734
3735         CSSPrimitiveValue identifier constructors should return PassRef.
3736         <https://webkit.org/b/123712>
3737
3738         Make CSSPrimitiveValue::createIdentifier() and the corresponding
3739         CSSValuePool helper return PassRef<CSSPrimitiveValue>.
3740
3741         Reviewed by Antti Koivisto.
3742
3743 2013-11-03  Andreas Kling  <akling@apple.com>
3744
3745         Use RenderChildIterator in two more loops.
3746         <https://webkit.org/b/123713>
3747
3748         Switch two more renderer child traversal loops to childrenOfType.
3749
3750         Reviewed by Antti Koivisto.
3751
3752 2013-11-03  Andreas Kling  <akling@apple.com>
3753
3754         CSSShadowValue constructor should return PassRef.
3755         <https://webkit.org/b/123711>
3756
3757         Make CSSShadowValue::create() return a PassRef since it will never
3758         return null.
3759
3760         Reviewed by Sam Weinig.
3761
3762 2013-11-03  Andreas Kling  <akling@apple.com>
3763
3764         CSSLineBoxContainValue constructor should return PassRef.
3765         <https://webkit.org/b/123710>
3766
3767         Make CSSLineBoxContainValue::create() return a PassRef since it
3768         will never return null.
3769
3770         Reviewed by Sam Weinig.
3771
3772 2013-11-03  Antti Koivisto  <antti@apple.com>
3773
3774         LiveNodeLists should have non-null ContainerNode as root
3775         https://bugs.webkit.org/show_bug.cgi?id=123709
3776
3777         Reviewed by Andreas Kling.
3778
3779         After moving ChildNodeList off from LiveNodeList the root is now always at least a ContainerNode.
3780
3781         * dom/ContainerNode.cpp:
3782         (WebCore::ContainerNode::getElementsByTagName):
3783         (WebCore::ContainerNode::getElementsByTagNameNS):
3784         (WebCore::ContainerNode::getElementsByName):
3785         (WebCore::ContainerNode::getElementsByClassName):
3786         (WebCore::ContainerNode::radioNodeList):
3787         
3788             Also these move from Node to ContainerNode to make tighter typing work.
3789
3790 2013-11-03  Antti Koivisto  <antti@apple.com>
3791
3792         Switch createContextualFragment to element iterator
3793         https://bugs.webkit.org/show_bug.cgi?id=123704
3794
3795         Reviewed by Andreas Kling.
3796
3797         * editing/FrameSelection.cpp:
3798         (WebCore::scanForForm):
3799         
3800             Use type helpers instead of hasTagName
3801
3802         * editing/markup.cpp:
3803         (WebCore::collectElementsToRemoveFromFragment):
3804         (WebCore::removeElementFromFragmentPreservingChildren):
3805         (WebCore::createContextualFragment):
3806         * html/HTMLFormElement.cpp:
3807         (WebCore::HTMLFormElement::formElementIndex):
3808         
3809             Use type helpers instead of hasTagName
3810
3811         * html/HTMLTagNames.in:
3812         
3813             Generate type helpers for <html>.
3814
3815 2013-11-03  Antti Koivisto  <antti@apple.com>
3816
3817         ChildNodeList should not be LiveNodeList
3818         https://bugs.webkit.org/show_bug.cgi?id=123708
3819
3820         Reviewed by Sam Weinig.
3821
3822         ChildNodeList is a poor fit to be a LiveNodeList. It is heavily special-cased. It is also
3823         the only subtype that returns non-Elements thus preventing tightening.
3824
3825         * bindings/js/JSNodeListCustom.cpp:
3826         (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
3827         
3828             Support new types.
3829
3830         * dom/ChildNodeList.cpp:
3831         (WebCore::EmptyNodeList::~EmptyNodeList):
3832         (WebCore::ChildNodeList::ChildNodeList):
3833         (WebCore::ChildNodeList::~ChildNodeList):
3834         (WebCore::ChildNodeList::length):
3835         (WebCore::childFromFirst):
3836         (WebCore::childFromLast):
3837         (WebCore::ChildNodeList::nodeBeforeCached):
3838         (WebCore::ChildNodeList::nodeAfterCached):
3839         (WebCore::ChildNodeList::item):
3840         (WebCore::ChildNodeList::namedItem):
3841         (WebCore::ChildNodeList::invalidateCache):
3842         
3843             Implement the same caching optimizations as LiveNodeList with tighter, less generic code.
3844
3845         * dom/ChildNodeList.h:
3846         
3847             Inherit ChildNodeList directly from NodeList.
3848
3849             Add new EmptyNodeList type. This is only ever used if NodeList is requested for a non-container node.
3850             It allows tighter typing in ChildNodeList.
3851
3852         * dom/LiveNodeList.cpp:
3853         (WebCore::LiveNodeList::namedItem):
3854         * dom/LiveNodeList.h:
3855         (WebCore::LiveNodeListBase::LiveNodeListBase):
3856         (WebCore::LiveNodeListBase::~LiveNodeListBase):
3857         (WebCore::LiveNodeList::LiveNodeList):
3858         
3859             Remove ChildNodeList specific code and branches.
3860
3861         * dom/Node.cpp:
3862         (WebCore::Node::childNodes):
3863         
3864             Return EmptyNodeList for non-containers.
3865
3866         * dom/NodeList.h:
3867         (WebCore::NodeList::~NodeList):
3868         (WebCore::NodeList::isLiveNodeList):
3869         (WebCore::NodeList::isChildNodeList):
3870         (WebCore::NodeList::isEmptyNodeList):
3871         
3872             For isReachableFromOpaqueRoots.
3873
3874         * dom/NodeRareData.h:
3875         (WebCore::NodeListsNodeData::ensureChildNodeList):
3876         (WebCore::NodeListsNodeData::removeChildNodeList):
3877         (WebCore::NodeListsNodeData::ensureEmptyChildNodeList):
3878         (WebCore::NodeListsNodeData::removeEmptyChildNodeList):
3879         (WebCore::NodeListsNodeData::NodeListsNodeData):
3880         (WebCore::NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList):
3881         
3882             EmptyNodeList support.
3883
3884         * html/CollectionType.h:
3885         * html/HTMLCollection.cpp:
3886         (WebCore::shouldOnlyIncludeDirectChildren):
3887         (WebCore::rootTypeFromCollectionType):
3888         (WebCore::invalidationTypeExcludingIdAndNameAttributes):
3889         (WebCore::isMatchingElement):
3890         (WebCore::LiveNodeListBase::itemBefore):
3891         (WebCore::LiveNodeListBase::traverseLiveNodeListFirstElement):
3892         (WebCore::LiveNodeListBase::traverseLiveNodeListForwardToOffset):
3893         (WebCore::LiveNodeListBase::item):
3894         (WebCore::LiveNodeListBase::itemBeforeOrAfterCachedItem):
3895         
3896             Remove ChildNodeList specific code and branches.
3897
3898 2013-11-03  Patrick Gansterer  <paroga@webkit.org>
3899
3900         [WINCE] Replace OwnPtr with GDIObject
3901         https://bugs.webkit.org/show_bug.cgi?id=123670
3902
3903         Reviewed by Anders Carlsson.
3904
3905         * page/win/FrameGdiWin.cpp:
3906         (WebCore::imageFromRect):
3907         * platform/graphics/wince/FontPlatformData.cpp:
3908         (WebCore::FixedSizeFontData::create):
3909         (WebCore::FontPlatformData::hfont):
3910         (WebCore::FontPlatformData::getScaledFontHandle):
3911         * platform/graphics/wince/GraphicsContextWinCE.cpp:
3912         (WebCore::createPen):
3913         (WebCore::createBrush):
3914         (WebCore::GraphicsContext::drawRect):
3915         (WebCore::GraphicsContext::drawLine):
3916         (WebCore::GraphicsContext::drawEllipse):
3917         (WebCore::GraphicsContext::drawConvexPolygon):
3918         (WebCore::GraphicsContext::fillRect):
3919         (WebCore::GraphicsContext::clip):
3920         (WebCore::GraphicsContext::strokeRect):
3921         (WebCore::GraphicsContext::fillRoundedRect):
3922         (WebCore::GraphicsContext::drawRoundCorner):
3923         (WebCore::GraphicsContext::fillPath):
3924         (WebCore::GraphicsContext::strokePath):
3925         (WebCore::GraphicsContext::drawText):
3926         * platform/graphics/wince/ImageWinCE.cpp:
3927         (WebCore::BitmapImage::getHBITMAPOfSize):
3928         * platform/graphics/wince/SharedBitmap.cpp:
3929         (WebCore::SharedBitmap::createHandle):
3930         (WebCore::SharedBitmap::draw):
3931         (WebCore::SharedBitmap::clipBitmap):
3932         (WebCore::drawPatternSimple):
3933         (WebCore::SharedBitmap::drawPattern):
3934         (WebCore::SharedBitmap::DCProvider::getDC):
3935         * platform/graphics/wince/SharedBitmap.h:
3936
3937 2013-11-03  Antti Koivisto  <antti@apple.com>
3938
3939         Add helpers for partial descendant traversal to element iterators
3940         https://bugs.webkit.org/show_bug.cgi?id=123703
3941
3942         Reviewed by Andreas Kling.
3943
3944         * dom/ElementAncestorIterator.h:
3945         (WebCore::lineageOfType):
3946         
3947             lineageOfType definition didn't match the declaration.
3948
3949         * dom/ElementDescendantIterator.h:
3950         (WebCore::::find):
3951         (WebCore::::from):
3952         
3953             Add find and from for getting begin iterator for partial traversals.
3954
3955         * editing/FrameSelection.cpp:
3956         (WebCore::scanForForm):
3957         (WebCore::FrameSelection::currentForm):
3958         * html/HTMLFormElement.cpp:
3959         (WebCore::HTMLFormElement::formElementIndex):
3960         (WebCore::HTMLFormElement::findClosestFormAncestor):
3961         
3962             Use them in a few places.
3963
3964 2013-11-03  Andreas Kling  <akling@apple.com>
3965
3966         Inline RenderStyle functions for getting/setting pseudo style bits.
3967         <https://webkit.org/b/123702>
3968
3969         hasPseudoStyle() actually shows up on html5-full-render.html,
3970         and it's pretty crazy to eat the cost of a function call just
3971         to do some basic bit twiddling.
3972
3973         Reviewed by Antti Koivisto.
3974
3975 2013-11-03  Xabier Rodriguez Calvar  <calvaris@igalia.com>
3976
3977         Remove HTMLMediaElement.initialTime
3978         https://bugs.webkit.org/show_bug.cgi?id=123572
3979
3980         Reviewed by Eric Carlson.
3981
3982         Patch based on one by: philipj@opera.com
3983         Blink review URL: https://codereview.chromium.org/35033002
3984
3985         initialTime has been removed from the HTMLMediaElement.
3986
3987         * bindings/gobject/WebKitDOMCustom.cpp:
3988         (webkit_dom_html_media_element_get_initial_time):
3989         * bindings/gobject/WebKitDOMCustom.h:
3990         * bindings/gobject/WebKitDOMCustom.symbols: Added phony function.
3991         * html/HTMLMediaElement.cpp:
3992         * html/HTMLMediaElement.h:
3993         * html/HTMLMediaElement.idl: Removed HTMLMediaElement::initialTime.
3994
3995 2013-11-02  Alexey Proskuryakov  <ap@apple.com>
3996
3997         Implement generateKey for HMAC and AES-CBC
3998         https://bugs.webkit.org/show_bug.cgi?id=123669
3999
4000         Reviewed by Dan Bernstein.
4001
4002         Tests: crypto/subtle/aes-cbc-generate-key.html
4003                crypto/subtle/hmac-generate-key.html
4004
4005         * WebCore.xcodeproj/project.pbxproj: Added new files.
4006
4007         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
4008         (WebCore::createAesKeyGenParams): Added bindings for AesKeyGenParams.
4009         (WebCore::JSCryptoAlgorithmDictionary::createParametersForGenerateKey): Handle
4010         algorithms that generate AES and HMAC keys.
4011
4012         * bindings/js/JSSubtleCryptoCustom.cpp: (WebCore::JSSubtleCrypto::generateKey): Added.
4013
4014         * crypto/CryptoAlgorithmAesKeyGenParams.h: Added.
4015
4016         * crypto/CryptoKey.cpp: (WebCore::CryptoKey::randomData):
4017         * crypto/CryptoKey.h:
4018         * crypto/CryptoKeyMac.cpp: Added
4019         Expose a function that produces random data for symmetric crypto keys. Cross-platform
4020         implementation uses ARC4 code from WTF, while Mac uses a system function that
4021         provides a FIPS validated random number generator.
4022
4023         * crypto/CryptoKeyAES.cpp: (WebCore::CryptoKeyAES::generate):
4024         * crypto/CryptoKeyAES.h:
4025         Added a function that creates AES keys.
4026
4027         * crypto/SubtleCrypto.idl: Added generateKey.
4028
4029         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
4030         (WebCore::CryptoAlgorithmAES_CBC::generateKey): Added.
4031
4032         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
4033         (WebCore::CryptoAlgorithmHMAC::generateKey): Added.
4034
4035         * crypto/keys/CryptoKeyHMAC.cpp: (WebCore::CryptoKeyHMAC::generate):
4036         * crypto/keys/CryptoKeyHMAC.h:
4037         Added a function that creates HMAC keys.
4038
4039         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp: Removed generateKey stub, the implementation
4040         ended up in cross-platform file.
4041
4042         * crypto/mac/CryptoAlgorithmHMACMac.cpp: Ditto.
4043
4044 2013-11-02  Christophe Dumez  <ch.dumez@samsung.com>
4045
4046         EnforceRange doesn't enforce range of a short
4047         https://bugs.webkit.org/show_bug.cgi?id=123661
4048
4049         Reviewed by Alexey Proskuryakov.
4050
4051         Handle Web IDL short / unsigned short types as per the
4052         specification: