53dc7b38321b95217307d12f9a98495b0d785e75
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-11-27  Brady Eidson  <beidson@apple.com>
2
3         Modern IDB: Class-ify IDBGetResult making it impossible to get the data members wrong.
4         https://bugs.webkit.org/show_bug.cgi?id=151627
5
6         Reviewed by Alexey Proskuryakov.
7
8         No new tests (No change in behavior).
9
10         * CMakeLists.txt:
11         * WebCore.xcodeproj/project.pbxproj:
12
13         * Modules/indexeddb/IDBGetResult.cpp: Added.
14         (WebCore::IDBGetResult::dataFromBuffer):
15         (WebCore::IDBGetResult::isolatedCopy):
16         * Modules/indexeddb/IDBGetResult.h:
17         (WebCore::IDBGetResult::IDBGetResult):
18         (WebCore::IDBGetResult::valueBuffer):
19         (WebCore::IDBGetResult::keyData):
20         (WebCore::IDBGetResult::primaryKeyData):
21         (WebCore::IDBGetResult::keyPath):
22         (WebCore::IDBGetResult::setValueBuffer):
23         (WebCore::IDBGetResult::setKeyData):
24         (WebCore::IDBGetResult::setPrimaryKeyData):
25         (WebCore::IDBGetResult::setKeyPath):
26         (WebCore::IDBGetResult::dataFromBuffer): Deleted.
27         (WebCore::IDBGetResult::isolatedCopy): Deleted.
28
29         * Modules/indexeddb/client/IDBCursorImpl.cpp:
30         (WebCore::IDBClient::IDBCursor::setGetResult):
31         * Modules/indexeddb/client/IDBCursorImpl.h:
32
33         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
34         (WebCore::IDBClient::IDBTransaction::didGetRecordOnServer):
35
36         * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp:
37         (WebCore::GetOperation::perform):
38
39         * Modules/indexeddb/server/IDBBackingStore.h:
40
41         * Modules/indexeddb/server/MemoryCursor.h:
42
43         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
44         (WebCore::IDBServer::MemoryIndexCursor::currentData):
45
46         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
47         (WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
48
49         * platform/CrossThreadCopier.h:
50
51 2015-11-27  Carlos Garcia Campos  <cgarcia@igalia.com>
52
53         [GTK] Do not use the WebCore garbage collector timer
54         https://bugs.webkit.org/show_bug.cgi?id=151623
55
56         Reviewed by Martin Robinson.
57
58         Now that garbage collector timers have been implemented in
59         JavaScriptCore for glib, we don't need to use another Timer in WebCore.
60
61         * bindings/js/GCController.cpp:
62         (WebCore::GCController::garbageCollectSoon):
63         (WebCore::GCController::garbageCollectNowIfNotDoneRecently):
64
65 2015-11-18  Andy Estes  <aestes@apple.com>
66
67         [Content Filtering] Crash in DocumentLoader::notifyFinished() when allowing a media document to load
68         https://bugs.webkit.org/show_bug.cgi?id=151433
69         rdar://problem/23506594
70
71         Reviewed by Alexey Proskuryakov.
72
73         When the main resource of a media document commits, WebKit cancels its load since the plug-in or media engine
74         will do its own loading. If content filtering is enabled, and the filter waits allow the load until the entire
75         resource is downloaded, then ContentFilter will attempt to call DocumentLoader::notifyFinished() immediately
76         after delivering the buffered resource data to DocumentLoader. However, delivering the data will have nulled out
77         DocumentLoader's m_mainResource when the load was cancelled, leading to a crash in notifyFinished().
78
79         To resolve this, add a new Stopped state to ContentFilter. Set this state if DocumentLoader clears its main
80         resource or detaches from its frame. If ContentFilter is in the Stopped state after calling
81         DocumentLoader::dataReceived(), do not proceed to call DocumentLoader::notifyFinished().
82
83         Test: contentfiltering/allow-media-document.html
84
85         * loader/ContentFilter.cpp:
86         (WebCore::ContentFilter::stopFilteringMainResource): Set m_state to Stopped. If m_mainResource is non-null,
87         removed ContentFilter as a client and set m_mainResource to null.
88         (WebCore::ContentFilter::notifyFinished): Stopped calling DocumentLoader::notifyFinished() if m_state is Stopped
89         after calling DocumentLoader::dataReceived().
90         * loader/ContentFilter.h:
91         * loader/DocumentLoader.cpp:
92         (WebCore::DocumentLoader::detachFromFrame): Called ContentFilter::stopFilteringMainResource() instead of setting
93         m_contentFilter to null.
94         (WebCore::DocumentLoader::clearMainResource): Ditto.
95
96 2015-11-25  Pranjal Jumde  <pjumde@apple.com>
97
98         Checks for buffer-overflows when reading characters from textRun
99         https://bugs.webkit.org/show_bug.cgi?id=151055
100         <rdar://problem/23251789>
101
102         Reviewed by Myles C. Maxfield.
103
104         Prevents an off by one error when adding the last font data to the GlyphBuffer.
105
106         * Source/WebCore/platform/graphics/WidthIterator.cpp:
107         * Source/WebCore/platform/graphics/FontCascade.cpp:
108
109 2015-11-22  Andy Estes  <aestes@apple.com>
110
111         Teach MiniBrowser how to enable the mock content filter
112         https://bugs.webkit.org/show_bug.cgi?id=151540
113
114         Reviewed by Andreas Kling.
115
116         Moved the implementation of MockContentFilterEnabler from TestWebKitAPI to here, renamed it to
117         WebMockContentFilterEnabler, and made it compatible with the legacy Objective-C runtime. Renamed Decision and
118         DecisionPoint to WebMockContentFilterDecision and WebMockContentFilterDecisionPoint, and changed them from enum
119         classes to CF_ENUMs so that they can be used by both C++ and Objective-C source files.
120
121         * WebCore.xcodeproj/project.pbxproj:
122         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
123         (WebCore::JSMockContentFilterSettings::decisionPoint):
124         (WebCore::JSMockContentFilterSettings::setDecisionPoint):
125         (WebCore::toDecision):
126         (WebCore::JSMockContentFilterSettings::decision):
127         (WebCore::JSMockContentFilterSettings::setDecision):
128         (WebCore::JSMockContentFilterSettings::unblockRequestDecision):
129         (WebCore::JSMockContentFilterSettings::setUnblockRequestDecision):
130         (WebCore::toJSValue): Deleted.
131         * testing/MockContentFilter.cpp:
132         (WebCore::MockContentFilter::willSendRequest):
133         (WebCore::MockContentFilter::responseReceived):
134         (WebCore::MockContentFilter::addData):
135         (WebCore::MockContentFilter::finishedAddingData):
136         (WebCore::MockContentFilter::unblockHandler):
137         (WebCore::MockContentFilter::maybeDetermineStatus):
138         * testing/MockContentFilter.h:
139         * testing/MockContentFilterEnabler.h: Added.
140         * testing/MockContentFilterEnabler.mm: Added.
141         (-[WebMockContentFilterEnabler initWithDecision:decisionPoint:blockedString:]):
142         (-[WebMockContentFilterEnabler initWithCoder:]):
143         (-[WebMockContentFilterEnabler encodeWithCoder:]):
144         (-[WebMockContentFilterEnabler enable]):
145         (-[WebMockContentFilterEnabler dealloc]):
146         (+[WebMockContentFilterEnabler supportsSecureCoding]):
147         (-[WebMockContentFilterEnabler copyWithZone:]):
148         * testing/MockContentFilterSettings.h:
149         (WebCore::MockContentFilterSettings::decisionPoint):
150         (WebCore::MockContentFilterSettings::setDecisionPoint):
151         (WebCore::MockContentFilterSettings::decision):
152         (WebCore::MockContentFilterSettings::setDecision):
153         (WebCore::MockContentFilterSettings::unblockRequestDecision):
154         (WebCore::MockContentFilterSettings::setUnblockRequestDecision):
155
156 2015-11-24  Xabier Rodriguez Calvar  <calvaris@igalia.com>
157
158         [Streams API] Implement pipeTo method in readable Stream
159         https://bugs.webkit.org/show_bug.cgi?id=151588
160
161         Reviewed by Darin Adler.
162
163         Implemented pipeTo method according to the reference implementation in the spec as the spec is not written
164         yet. It can be found at https://github.com/whatwg/streams/blob/632b26a05f3106650b1ec91239ad5b012e6c64af/reference-implementation/lib/readable-stream.js#L75.
165
166         Tests: streams/pipe-to.html
167                streams/reference-implementation/brand-checks.html
168                streams/reference-implementation/pipe-through.html
169                streams/reference-implementation/pipe-to.html
170                streams/reference-implementation/pipe-to-options.html
171                streams/reference-implementation/readable-stream-templated
172
173         * Modules/streams/ReadableStream.js:
174         (doPipe): Internal function of pipeTo.
175         (closeDest): Internal function of pipeTo.
176         (abortDest): Internal function of pipeTo.
177         (pipeTo): Implemented as per spec with some other internal functions as helpers.
178
179 2015-11-24  Antti Koivisto  <antti@apple.com>
180
181         REGRESSION (r190983): Non-element, non-text nodes should not be distributed to slots
182         https://bugs.webkit.org/show_bug.cgi?id=151566
183         rdar://problem/23430177
184
185         Reviewed by Zalan Bujtas.
186
187         We don't invalidate slot assignments except for text or element children. Fix by not
188         not assigning other nodes to slots as it is not useful.
189
190         Test: fast/html/details-comment-crash.html
191
192         * dom/SlotAssignment.cpp:
193         (WebCore::slotNameFromSlotAttribute):
194         (WebCore::SlotAssignment::findAssignedSlot):
195         (WebCore::SlotAssignment::assignSlots):
196
197 2015-11-23  David Kilzer  <ddkilzer@apple.com>
198
199         Hardening against CSSSelector double frees
200         <http://webkit.org/b/56124>
201         <rdar://problem/9119036>
202
203         Reviewed by Antti Koivisto.
204
205         Add some security assertions to catch this issue if it ever
206         happens in Debug builds, and make changes in
207         CSSSelector::~CSSSelector() and
208         CSSSelectorList::deleteSelectors() to prevent obvious issues if
209         they're ever called twice in Release builds.
210
211         No new tests because we don't know how to reproduce this.
212
213         * css/CSSSelector.cpp:
214         (WebCore::CSSSelector::CSSSelector): Initialize
215         m_destructorHasBeenCalled.
216         * css/CSSSelector.h:
217         (WebCore::CSSSelector::m_destructorHasBeenCalled): Add bitfield.
218         (WebCore::CSSSelector::CSSSelector): Initialize
219         m_destructorHasBeenCalled.
220         (WebCore::CSSSelector::~CSSSelector): Add security assertion
221         that this is never called twice.  Clear out any fields that
222         would have caused us to dereference an object twice.
223
224         * css/CSSSelectorList.cpp:
225         (WebCore::CSSSelectorList::deleteSelectors): Clear
226         m_selectorArray when freeing the memory to which it was
227         pointing.  This prevents re-entrancy issues or calling this
228         method twice on the same thread.  Also restructure the for()
229         loop to prevent calling CSSSelector::isLastInSelectorList()
230         after CSSSelector::~CSSSelector() has been called (via CRBug
231         241892).
232
233 2015-11-23  Brian Burg  <bburg@apple.com>
234
235         Web Inspector: inspector settings should not be shared between different inspection levels
236         https://bugs.webkit.org/show_bug.cgi?id=151151
237
238         Reviewed by Timothy Hatcher.
239
240         InspectorController and InspectorFrontendClient should know how to compute their
241         inspection levels, so that this level can be exposed to the Inspector frontend for
242         preference disambiguation by inspection level.
243
244          - A Page with normal web content has an inspection level of 0.
245          - The first Web Inspector has an inspection level of 1.
246          - The second Web Inspector that inspects the Inspector has an inspection level of 2.
247          - And so forth...
248
249         For local frontend clients (WK1 and the ProtocolTestStub), the inspection level of
250         a Page computed as follows:
251
252         - If the page's inspector controller has no frontend client, then the Page
253         is normal web content (level 0).
254         - If the page's inspector controller has a frontend client, ask for its inspection level.
255         A frontend client looks at the inspection level reported by inspected page's inspector
256         controller and increments by one to account for the crossed inspection boundary.
257
258         No new tests, this is blocked by test infrastructure fixes (https://webkit.org/b/151573).
259
260         * inspector/InspectorController.cpp:
261         (WebCore::InspectorController::inspectionLevel): Added.
262         (WebCore::InspectorController::hasInspectorFrontendClient): Deleted.
263         * inspector/InspectorController.h:
264         * inspector/InspectorFrontendClient.h:
265         * inspector/InspectorFrontendClientLocal.cpp:
266         (WebCore::InspectorFrontendClientLocal::canAttachWindow): Check inspectionLevel().
267         (WebCore::InspectorFrontendClientLocal::inspectionLevel): Added.
268         * inspector/InspectorFrontendClientLocal.h:
269         * inspector/InspectorFrontendHost.cpp:
270         (WebCore::InspectorFrontendHost::inspectionLevel): Added.
271         * inspector/InspectorFrontendHost.h:
272         * inspector/InspectorFrontendHost.idl:
273         * page/ContextMenuController.cpp:
274         (WebCore::ContextMenuController::populate): Check inspectionLevel().
275
276 2015-11-20  Brian Burg  <bburg@apple.com>
277
278         Web Inspector: RemoteInspector should track targets and connections for remote automation
279         https://bugs.webkit.org/show_bug.cgi?id=151042
280
281         Reviewed by Joseph Pecoraro.
282
283         Use the new RemoteControllableTarget API method names.
284
285         No new tests, no behavior change.
286
287         * page/PageDebuggable.cpp:
288         (WebCore::PageDebuggable::connect):
289         (WebCore::PageDebuggable::dispatchMessageFromRemote):
290         (WebCore::PageDebuggable::dispatchMessageFromRemoteFrontend): Deleted.
291         * page/PageDebuggable.h:
292
293 2015-11-23  Brady Eidson  <beidson@apple.com>
294
295         Modern IDB: Unskip all indexeddb/mozilla tests that pass.
296         https://bugs.webkit.org/show_bug.cgi?id=151568
297         
298         Reviewed by Alex Christensen.
299
300         No new tests (Lots of skipped existing tests now pass).
301
302         * Modules/indexeddb/shared/IDBError.h:
303
304 2015-11-23  Nikos Andronikos <nikos.andronikos-webkit@cisra.canon.com.au>
305
306         Add WebCore namespace for generated bindings for supplemental method calls
307         https://bugs.webkit.org/show_bug.cgi?id=151431
308
309         Reviewed by Alex Christensen.
310
311         Address build failures for generated supplemental method calls which are in the WebCore namespace. 
312         The bindings are outside the WebCore namespace - so add WebCore namespace specifier where required.
313
314         * bindings/scripts/CodeGeneratorJS.pm:
315         (GenerateHeader):
316         (GenerateImplementation):
317         (GenerateParametersCheck):
318         * bindings/scripts/CodeGeneratorObjC.pm:
319         (GenerateImplementation):
320         * bindings/scripts/test/JS/JSTestInterface.cpp:
321         (WebCore::jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr):
322         (WebCore::jsTestInterfaceConstructorSupplementalStaticAttr):
323         (WebCore::jsTestInterfaceSupplementalStr1):
324         (WebCore::jsTestInterfaceSupplementalStr2):
325         (WebCore::jsTestInterfaceSupplementalNode):
326         (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
327         (WebCore::setJSTestInterfaceSupplementalStr2):
328         (WebCore::setJSTestInterfaceSupplementalNode):
329         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod1):
330         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
331         (WebCore::jsTestInterfaceConstructorFunctionSupplementalMethod4):
332         * bindings/scripts/test/ObjC/DOMTestInterface.mm:
333         (-[DOMTestInterface supplementalStr1]):
334         (-[DOMTestInterface supplementalStr2]):
335         (-[DOMTestInterface setSupplementalStr2:]):
336         (-[DOMTestInterface supplementalStr3]):
337         (-[DOMTestInterface setSupplementalStr3:]):
338         (-[DOMTestInterface supplementalNode]):
339         (-[DOMTestInterface setSupplementalNode:]):
340         (-[DOMTestInterface builtinAttribute]):
341         (-[DOMTestInterface setBuiltinAttribute:]):
342         (-[DOMTestInterface supplementalMethod1]):
343         (-[DOMTestInterface supplementalMethod2:objArg:]):
344         (-[DOMTestInterface supplementalMethod3]):
345         (-[DOMTestInterface supplementalMethod4]):
346         (-[DOMTestInterface builtinFunction]):
347
348 2015-11-23  Brady Eidson  <beidson@apple.com>
349
350         Modern IDB: When a transaction is aborted, call onerror handlers for all in-progress requests.
351         https://bugs.webkit.org/show_bug.cgi?id=151550
352
353         Reviewed by Alex Christensen.
354
355         Test: storage/indexeddb/modern/abort-requests-cancelled.html
356               storage/indexeddb/modern/idbtransaction-objectstore-failures.html (with changes)
357               storage/indexeddb/modern/index-5.html (with changes)
358               Various (currently skipped) legacy IDB tests.
359
360         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
361         (WebCore::IDBClient::IDBDatabase::transaction):
362         (WebCore::IDBClient::IDBDatabase::startVersionChangeTransaction):
363         (WebCore::IDBClient::IDBDatabase::didStartTransaction):
364         (WebCore::IDBClient::IDBDatabase::willCommitTransaction):
365         (WebCore::IDBClient::IDBDatabase::didCommitTransaction):
366         (WebCore::IDBClient::IDBDatabase::willAbortTransaction):
367         (WebCore::IDBClient::IDBDatabase::didAbortTransaction):
368         (WebCore::IDBClient::IDBDatabase::didCommitOrAbortTransaction):
369         
370         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
371         (WebCore::IDBClient::IDBTransaction::abort):
372         (WebCore::IDBClient::IDBTransaction::abortOnServerAndCancelRequests):
373         (WebCore::IDBClient::IDBTransaction::didCreateObjectStoreOnServer):
374         (WebCore::IDBClient::IDBTransaction::didCreateIndexOnServer):
375         (WebCore::IDBClient::IDBTransaction::didGetRecordOnServer):
376         (WebCore::IDBClient::IDBTransaction::didDeleteObjectStoreOnServer):
377         (WebCore::IDBClient::IDBTransaction::didDeleteIndexOnServer):
378         (WebCore::IDBClient::IDBTransaction::immediateAbort): Deleted.
379         (WebCore::IDBClient::IDBTransaction::abortOnServer): Deleted.
380         * Modules/indexeddb/client/IDBTransactionImpl.h:
381         
382         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
383         (WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
384         (WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
385         
386         * Modules/indexeddb/shared/IDBError.cpp:
387         (WebCore::idbErrorName):
388         (WebCore::idbErrorDescription):
389         * Modules/indexeddb/shared/IDBError.h:
390         
391         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
392         (WebCore::IDBResourceIdentifier::loggingString):
393         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
394
395 2015-11-23  Brady Eidson  <beidson@apple.com>
396
397         Modern IDB: Unskip storage/indexeddb/mozilla/global-data.html.
398         https://bugs.webkit.org/show_bug.cgi?id=151557
399
400         Reviewed by Alex Christensen.
401
402         No new tests (Unskipping existing test storage/indexeddb/mozilla/global-data.html).
403
404         - Reworking some invalid ASSERTS
405         - Actually opening pending open-database-requests after a version change transaction completes
406         - Allow starting new transactions when the version change transaction has *started* finishing, 
407           but before it finishes finishing.
408
409         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
410         (WebCore::IDBClient::IDBDatabase::transaction):
411         
412         * Modules/indexeddb/client/IDBTransactionImpl.h:
413         
414         * Modules/indexeddb/server/MemoryObjectStore.cpp:
415         (WebCore::IDBServer::MemoryObjectStore::~MemoryObjectStore):
416         
417         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
418         (WebCore::IDBServer::MemoryObjectStoreCursor::keyAdded): Deleted.
419         
420         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
421         (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
422         (WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations):
423         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
424         * Modules/indexeddb/server/UniqueIDBDatabase.h:
425
426 2015-11-23  Youenn Fablet  <youenn.fablet@crf.canon.fr>
427
428         Remove DOMPromiseWithCallback
429         https://bugs.webkit.org/show_bug.cgi?id=151565
430
431         Reviewed by Eric Carlson.
432
433         DOMPromiseWithCallback is no longer used as WebCore JS built-ins are used to the cases where DOMPromiseWithCallback made sense.
434
435         No change in behavior.
436
437         * Modules/mediastream/MediaDevices.h: Moved from DOMPromiseWithCallback to DOMPromise since the API is now called by JS built-ins.
438         * bindings/js/JSDOMPromise.h:
439         (WebCore::DOMPromiseWithCallback::DOMPromiseWithCallback): Deleted.
440         (WebCore::DOMPromiseIteratorWithCallback::DOMPromiseIteratorWithCallback): Deleted.
441         (WebCore::Error>::resolve): Deleted.
442         (WebCore::Error>::reject): Deleted.
443         (WebCore::Error>::resolveEnd): Deleted.
444
445 2015-11-23  Brian Burg  <bburg@apple.com>
446
447         Web Inspector: when inspecting the inspector, add the inspection level to the title bar
448         https://bugs.webkit.org/show_bug.cgi?id=151555
449
450         Reviewed by Timothy Hatcher.
451
452         * English.lproj/Localizable.strings: add new localized string for alternate inspector title.
453
454 2015-11-23  Zan Dobersek  <zdobersek@igalia.com>
455
456         [GStreamer] No need to assert the pipeline's bus presence in MediaPlayerPrivateGStreamerBase dtor
457         https://bugs.webkit.org/show_bug.cgi?id=151558
458
459         Reviewed by Carlos Garcia Campos.
460
461         In the MediaPlayerPrivateGStreamerBase destructor, there's some leftover code
462         that acquires a reference to the GStreamer pipeline's bus object and then
463         just asserts that it's not null. Not very useful, so remove it.
464
465         Also use nullptr to null out the m_player member.
466
467         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
468         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
469
470 2015-11-17  Sergio Villar Senin  <svillar@igalia.com>
471
472         ASSERTION FAILED: freeSpace >= 0 in WebCore::RenderGrid::computeTrackSizesForDirection
473         https://bugs.webkit.org/show_bug.cgi?id=151254
474
475         Reviewed by Darin Adler.
476
477         When in quirks mode, abnormally huge margins could lead to
478         negative computations of available logical sizes. We could add
479         an !document.inQuirksMode() check in the assertion but since
480         negative freeSpace values are valid (i.e. the condition is not
481         really part of the contract and everything will work as
482         expected) I've decided to simply remove it.
483
484         Test: fast/css-grid-layout/grid-quirks-mode-huge-margin-crash.html
485
486         * rendering/RenderGrid.cpp:
487         (WebCore::RenderGrid::computeTrackSizesForDirection): Deleted.
488
489 2015-11-22  Myles C. Maxfield  <mmaxfield@apple.com>
490
491         Font selection should not consult font-variant property
492         https://bugs.webkit.org/show_bug.cgi?id=151537
493
494         Reviewed by Simon Fraser.
495
496         In section 4.7 of the CSS Fonts Level 3 spec, it says "[The font-variant and
497         font-feature-settings] do not affect font selection."
498
499         All the other browsers (Chrome, Firefox, and Edge) all obey the spec here. We
500         are the only one who misbehaves. This patch aligns our behavior with the other
501         browsers.
502
503         Test: fast/text/font-selection-font-variant.html
504
505         * css/CSSFontSelector.cpp:
506         (WebCore::computeTraitsMask): Deleted.
507         (WebCore::compareFontFaces): Deleted.
508         (WebCore::CSSFontSelector::getFontFace): Deleted.
509         * css/CSSParser.cpp:
510         (WebCore::isValidKeywordPropertyAndValue):
511         (WebCore::isKeywordPropertyID):
512         (WebCore::CSSParser::createFontFaceRule):
513         (WebCore::CSSParser::CSSParser): Deleted.
514         (WebCore::CSSParser::parseValue): Deleted.
515         (WebCore::CSSParser::parseDeclaration): Deleted.
516         (WebCore::CSSParser::clearProperties): Deleted.
517         (WebCore::CSSParser::parseFontVariant): Deleted.
518         (WebCore::CSSParser::createStyleRule): Deleted.
519         (WebCore::CSSParser::deleteFontFaceOnlyValues): Deleted.
520         * css/CSSParser.h:
521         * platform/graphics/FontDescription.cpp:
522         (WebCore::FontDescription::traitsMask): Deleted.
523         * platform/graphics/win/FontCacheWin.cpp:
524         (WebCore::traitsInFamilyEnumProc):
525         * platform/graphics/cocoa/FontCacheCoreText.cpp:
526         (WebCore::toTraitsMask):
527         * platform/text/TextFlags.h:
528
529 2015-11-22  Carlos Garcia Campos  <cgarcia@igalia.com>
530
531         Unreviewed, rolling out r192727.
532
533         It made the selections transparent again and broke
534         /webkit2/WebKitWebView/snapshot
535
536         Reverted changeset:
537
538         "[GTK] RenderThemeGtk::platformActiveSelectionBackgroundColor,
539         et. al. should not clobber state of cached GtkStyleContexts"
540         https://bugs.webkit.org/show_bug.cgi?id=151533
541         http://trac.webkit.org/changeset/192727
542
543 2015-11-22  Michael Catanzaro  <mcatanzaro@igalia.com>
544
545         [GTK] RenderThemeGtk::platformActiveSelectionBackgroundColor, et. al. should not clobber state of cached GtkStyleContexts
546         https://bugs.webkit.org/show_bug.cgi?id=151533
547
548         Reviewed by Carlos Garcia Campos.
549
550         platformActiveSelectionBackgroundColor(), platformInactiveSelectionBackgroundColor(), etc.
551         are const functions intended only to return a color used for painting, but since r174929
552         they also change the state of the cached style contexts we use for GTK_TYPE_ENTRY and
553         GTK_TYPE_TREE_VIEW. That's wrong; those style contexts should not have any state set. This
554         could cause theme colors returned by those GtkStyleContexts to change unexpectedly,
555         depending on whether the state is explicitly set before each use, or whether the theme
556         actually uses the states.
557
558         This didn't cause any regression only because every place using these style contexts
559         explicitly sets the state of the style contexts before use. In fact, the GtkTreeView style
560         context is not used anywhere else, and the GtkEntry style context is only used in
561         paintTextField, which does set the state before use (and then reverts it using
562         save/restore), so this cannot have broken anything in practice. But it's a landmine waiting
563         for the next programmer to trip it.
564
565         Fix this with a gtk_style_context_save()/gtk_style_context_restore() pair.
566
567         * rendering/RenderThemeGtk.cpp:
568         (WebCore::styleColor):
569
570 2015-11-21  Myles C. Maxfield  <mmaxfield@apple.com>
571
572         Tiny cleanup in ComplexTextController::collectComplexTextRuns()
573         https://bugs.webkit.org/show_bug.cgi?id=151534
574
575         Reviewed by Zalan Bujtas.
576
577         The isMissingGlyph boolean is completely unnecessary. Its entire
578         responsiblity is duplicated by the "font" pointer.
579
580         No new tests because there is no behavior change.
581
582         * platform/graphics/mac/ComplexTextController.cpp:
583         (WebCore::ComplexTextController::collectComplexTextRuns):
584
585 == Rolled over to ChangeLog-2015-11-21 ==