2008-01-03 Alp Toker <alp@atoker.com>
[WebKit-https.git] / WebCore / ChangeLog
1 2008-01-03  Alp Toker  <alp@atoker.com>
2
3         Suggested by Mark Rowe.
4
5         Fix indentation and remove trailing whitespace.
6
7         * platform/network/curl/ResourceHandleManager.cpp:
8
9 2008-01-03  Luca Bruno  <lethalman88@gmail.com>
10
11         Reviewed by Alp Toker.
12
13         Fix HTTP POST-based logins to sites like Facebook, GMail by ensuring
14         that the two POST methods don't conflict.
15
16         * platform/network/curl/ResourceHandleManager.cpp:
17         (WebCore::ResourceHandleManager::setupPOST):
18
19 2008-01-02  Darin Adler  <darin@apple.com>
20
21         - touched some files to try to get the Windows buildbot building again
22
23 2008-01-02  Dan Bernstein  <mitz@apple.com>
24
25         Reviewed by Sam Weinig.
26
27         - fix small caps rendering
28
29         Covered by an existing test,
30
31         * platform/graphics/win/FontDataWin.cpp:
32         (WebCore::FontData::smallCapsFontData):
33
34 2008-01-02  Antti Koivisto  <antti@apple.com>
35
36         Reviewed by Oliver.
37
38         Calculate video position and size within the renderer box in WebCore. This
39         way the aspect ratio calculation is not needed in each MediaPlayer implementation.
40         
41         This fixes video aspect ratio on Windows.
42         
43         Covered by an existing pixel test.
44
45         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
46         (WebCore::MediaPlayerPrivate::createQTMovieView):
47         * rendering/RenderVideo.cpp:
48         (WebCore::RenderVideo::videoBox):
49         (WebCore::RenderVideo::paintReplaced):
50         (WebCore::RenderVideo::updatePlayer):
51         * rendering/RenderVideo.h:
52
53 2008-01-02  Ada Chan  <adachan@apple.com>
54
55         Fix windows build.
56
57         * WebCore.vcproj/WebCore.vcproj:
58
59 2008-01-02  John Sullivan  <sullivan@apple.com>
60
61         Reviewed by Dan Bernstein
62         
63         - fixed <rdar://problem/5579010> REGRESSION: Safari inserts newlines in tab names when U+2028 is present
64
65         * loader/DocumentLoader.cpp:
66         (WebCore::canonicalizedTitle):
67         in the code that replaces control characters with white space, also replace the unicode line separator
68         and paragraph separator characters
69
70 2008-01-02  Darin Adler  <darin@apple.com>
71
72         - fix buffer overruns seen on buildbot
73
74         * platform/text/StringImpl.cpp:
75         (WebCore::countCharacter): Added this.
76         (WebCore::StringImpl::toCoordsArray): Use countCharacter instead of incorrect find expression.
77         (WebCore::StringImpl::toLengthArray): Ditto.
78         (WebCore::StringImpl::replace): Added assertions.
79
80 2008-01-02  Darin Adler  <darin@apple.com>
81
82         Reviewed by Maciej.
83
84         - fix http://bugs.webkit.org/show_bug.cgi?id=16657
85           Acid3 failure since table.caption and table.thead do not work for nodes added by appendChild
86         - fix http://bugs.webkit.org/show_bug.cgi?id=16659
87           Acid3 expects HTMLTableElement.rows to include a <tr> element that is an immediate child of the <table>
88
89         Tests: dom/html/level2/html/HTMLCollection07.html
90                dom/html/level2/html/HTMLCollection08.html
91                dom/html/level2/xhtml/HTMLCollection07.xhtml
92                dom/html/level2/xhtml/HTMLCollection08.xhtml
93                fast/dom/HTMLTableElement/early-acid3-65-excerpt.html
94                fast/dom/HTMLTableElement/early-acid3-66-excerpt.html
95
96         * GNUmakefile.am: Added HTMLTableRowsCollection.
97         * WebCore.pro: Ditto.
98         * WebCore.vcproj/WebCore.vcproj: Ditto.
99         * WebCore.xcodeproj/project.pbxproj: Ditto.
100         * WebCoreSources.bkl: Ditto.
101
102         * dom/XMLTokenizer.cpp: Took out stray include.
103
104         * html/HTMLCollection.cpp:
105         (WebCore::HTMLCollection::itemAfter): Removed all the table rows code, since we now use
106         a separate class for that collection. Also got rid of the distinct types for custom collections
107         that don't need them (use Other for both).
108         * html/HTMLCollection.h: Also made firstItem non-virtual because it doesn't need to be virtual.
109
110         * html/HTMLFormCollection.cpp:
111         (WebCore::HTMLFormCollection::HTMLFormCollection): Use Other instead of FormElements
112         for the HTMLCollection type.
113
114         * html/HTMLTableElement.cpp:
115         (WebCore::HTMLTableElement::HTMLTableElement): Eliminated m_head, m_foot, m_firstBody, and m_caption.
116         (WebCore::HTMLTableElement::caption): Added non-inline version. Finds the caption rather than
117         keeping a pointer to it.
118         (WebCore::HTMLTableElement::setCaption): Rewrote.
119         (WebCore::HTMLTableElement::tHead): Ditto.
120         (WebCore::HTMLTableElement::setTHead): Ditto.
121         (WebCore::HTMLTableElement::tFoot): Ditto.
122         (WebCore::HTMLTableElement::setTFoot): Ditto.
123         (WebCore::HTMLTableElement::createTHead): Ditto.
124         (WebCore::HTMLTableElement::deleteTHead): Ditto.
125         (WebCore::HTMLTableElement::createTFoot): Ditto.
126         (WebCore::HTMLTableElement::deleteTFoot): Ditto.
127         (WebCore::HTMLTableElement::createCaption): Ditto.
128         (WebCore::HTMLTableElement::deleteCaption): Ditto.
129         (WebCore::HTMLTableElement::lastBody): Added.
130         (WebCore::HTMLTableElement::insertRow): Rewrote to use a loop based on code in HTMLTableRowsCollection.
131         This is different from the old code mainly in how it handles rows outside any section.
132         (WebCore::HTMLTableElement::deleteRow): Ditto.
133         (WebCore::HTMLTableElement::addChild): Removed code to set the various members. Keeping pointers to
134         these was a possible source of serious bugs too, including crashes with stale pointers, although I
135         didn't write any test cases to prove those bugs existed.
136         (WebCore::HTMLTableElement::parseMappedAttribute): Changed the rules code to visit all cells, not
137         just the cells of the first body. I believe this fixed rendering on some table tests. I think the code
138         visits too many cells and also the use of recursion is overkill, but I didn't try to fix that.
139         (WebCore::HTMLTableElement::rows): Changed to use the new HTMLTableRowsCollection.
140         * html/HTMLTableElement.h: Changed functions to return PassRefPtr, which can be important if strange
141         things like DOM mutation events take things ot of the tree before they are safely referenced by
142         JavaScript wrappers. Also changed functions to take PassRefPtr and added exceptions. Removed unneeded
143         firstTBody and setTBody functions and childrenChanged function override, as well as unused Rules and
144         Frame enums. Removed m_head, m_foot, m_firstBody, and m_caption, and added lastBody function. Removed
145         unneeded friend declaration for HTMLTableCellElement.
146         * html/HTMLTableElement.idl: Allow the setteres for caption, tHead, and tFoot to raise exceptions.
147
148         * html/HTMLTableRowsCollection.cpp: Added. Implements the HTML 5 rule for which rows are in the
149         collection in which order.
150         * html/HTMLTableRowsCollection.h: Added.
151
152         * loader/FTPDirectoryDocument.cpp:
153         (WebCore::FTPDirectoryTokenizer::appendEntry): Use the standard insertRow function instead of
154         coming up with our own way of inserting a row. Simplifies things -- we can remove the code to
155         create a tbody element.
156
157 2008-01-02  Darin Adler  <darin@apple.com>
158
159         Reviewed by Alice and Tim.
160
161         - try to fix GTK and Qt builds
162
163         * platform/win/ScrollViewWin.cpp:
164         (WebCore::ScrollView::scroll): Improve logic slightly for the case of
165         vertical scrolling when there's no vertical scroll bar.
166
167         * platform/gtk/ScrollViewGtk.cpp:
168         (WebCore::ScrollView::scroll): Copy the code from Windows. Maybe this
169         should be factored differently.
170         * platform/qt/ScrollViewQt.cpp:
171         (WebCore::ScrollView::scroll): Ditto.
172
173 2008-01-02  Darin Adler  <darin@apple.com>
174
175         Reviewed by Anders.
176
177         - http://bugs.webkit.org/show_bug.cgi?id=16712
178           change StringImpl to take and return PassRefPtr instead of raw pointers
179
180         Also eliminated use of const StringImpl. Since StringImpl is immutable there
181         is no distinction between a const and non-const one at the moment.
182
183         * WebCore.base.exp: Updated.
184
185         * css/CSSHelper.cpp:
186         (WebCore::parseURL): Make String directly, not by making a StringImpl.
187         * dom/Attr.cpp:
188         (WebCore::Attr::createTextChild): Convert AtomicString to String with domString,
189         not via StringImpl.
190         (WebCore::Attr::setValue): Remove unneed call to impl() when passing a String
191         to a function that takes a String.
192
193         * dom/CDATASection.cpp: Removed unused constructor.
194         (WebCore::CDATASection::cloneNode): Added a now-needed .get().
195         (WebCore::CDATASection::createNew): Changed function to take a PassRefPtr.
196         * dom/CDATASection.h:
197
198         * dom/CharacterData.cpp:
199         (WebCore::CharacterData::CharacterData): Removed unneeded initialization and
200         ref() now that the string is a RefPtr. Also updated to not call "new StringImpl".
201         (WebCore::CharacterData::~CharacterData): Removed unneeded deref() since it's
202         a RefPtr.
203         (WebCore::CharacterData::setData): More of that.
204         (WebCore::CharacterData::substringData): Ditto.
205         (WebCore::CharacterData::appendData): Ditto.
206         (WebCore::CharacterData::insertData): Ditto.
207         (WebCore::CharacterData::deleteData): Ditto.
208         (WebCore::CharacterData::replaceData): Ditto.
209         (WebCore::CharacterData::nodeValue): Ditto.
210         (WebCore::CharacterData::dispatchModifiedEvent): Ditto.
211         (WebCore::CharacterData::dump): Ditto.
212         * dom/CharacterData.h: Changed to use a RefPtr. I could have used a String
213         instead, but since String adds extra branches to handle 0, I figured it was
214         more conservative to just use RefPtr. Later it would be good to figure out
215         which is preferred style and be more consistent. Maybe we'll phase out
216         StringImpl, or maybe we'll go the other way and use it more since it can be
217         more efficient.
218
219         * dom/DOMImplementation.cpp:
220         (WebCore::addString): Changed set to use String rather than StringImpl.
221         (WebCore::isSVG10Feature): Ditto.
222         (WebCore::isSVG11Feature): Ditto.
223         (WebCore::DOMImplementation::createDocument): Replaced custom code to
224         find a colon with a call to String::find.
225
226         * dom/Range.cpp:
227         (WebCore::Range::insertNode): Updated since the result of splitText is now
228         a PassRefPtr.
229
230         * dom/Text.cpp:
231         (WebCore::Text::splitText): Updated since str is now a RefPtr. Also made the
232         result of this function be a PassRefPtr.
233         (WebCore::Text::createRenderer): Ditto.
234         (WebCore::Text::createNew): Made the parameter and result both be PassRefPtr.
235         * dom/Text.h:
236
237         * html/HTMLElement.cpp:
238         (WebCore::HTMLElement::nodeName): Use String::upper.
239
240         * html/HTMLInputElement.cpp:
241         (WebCore::numGraphemeClusters): Remove now-unneeded const.
242         (WebCore::numCharactersInGraphemeClusters): Ditto.
243
244         * html/HTMLTokenizer.cpp:
245         (WebCore::HTMLTokenizer::processToken): Updated for function name change.
246
247         * platform/text/AtomicString.cpp:
248         (WebCore::CStringTranslator::translate): Updated since there is no longer
249         a constructor that takes a string.
250
251         * platform/text/PlatformString.h: Added new constructors that take
252         PassRefPtr and RefPtr. Removed misleading comment.
253
254         * platform/text/String.cpp:
255         (WebCore::String::String): Changed to use StringImpl::create, which handles
256         the empty string automatically.
257         (WebCore::String::append): Ditto.
258         (WebCore::String::charactersWithNullTermination): Similar.
259         (WebCore::String::format): Ditto.
260
261         * platform/text/StringHash.h: Took out unneeded const.
262
263         * platform/text/StringImpl.cpp:
264         (WebCore::deleteUCharVector): Changed to take a const pointer since the
265         buffers are now const UChar buffers.
266         (WebCore::StringImpl::StringImpl): Removed some constructors. Got rid of the
267         separate init functions. The constructors are now private and used only in
268         the create functions and one or two other places.
269         (WebCore::StringImpl::containsOnlyWhitespace): Removed now-meaningless const.
270         (WebCore::StringImpl::substring): Ditto. Also changed return value to be a
271         PassRefPtr.
272         (WebCore::StringImpl::characterStartingAt): Ditto.
273         (WebCore::StringImpl::toLength): Ditto.
274         (WebCore::StringImpl::toCoordsArray): Ditto.
275         (WebCore::StringImpl::toLengthArray): Ditto.
276         (WebCore::StringImpl::isLower): Ditto.
277         (WebCore::StringImpl::lower): Ditto. Changed to use Vector and adopt so we
278         don't have to use new directly here. Makes empty string handling more consistent.
279         (WebCore::StringImpl::upper): Ditto.
280         (WebCore::StringImpl::secure): Ditto.
281         (WebCore::StringImpl::foldCase): Ditto.
282         (WebCore::StringImpl::stripWhiteSpace): Ditto.
283         (WebCore::StringImpl::simplifyWhiteSpace): Ditto.
284         (WebCore::StringImpl::capitalize): Ditto.
285         (WebCore::StringImpl::toInt): Removed now-meaningless const.
286         (WebCore::StringImpl::toInt64): Ditto.
287         (WebCore::StringImpl::toUInt64): Ditto.
288         (WebCore::StringImpl::toDouble): Ditto.
289         (WebCore::StringImpl::toFloat): Ditto.
290         (WebCore::StringImpl::find): Ditto.
291         (WebCore::StringImpl::reverseFind): Ditto.
292         (WebCore::StringImpl::endsWith): Ditto.
293         (WebCore::StringImpl::replace): Ditto.
294         (WebCore::equal): Ditto.
295         (WebCore::equalIgnoringCase): Ditto.
296         (WebCore::StringImpl::ascii): Ditto.
297         (WebCore::StringImpl::defaultWritingDirection): Ditto.
298         (WebCore::StringImpl::createStrippingNullCharacters): Ditto.
299         (WebCore::StringImpl::adopt): Added special case so this uses the shared
300         empty string like other functions. Also optimized the common case where the
301         vector happens to already have the right size so we don't do a fastRealloc
302         at all in those cases.
303         (WebCore::StringImpl::create): Added. These are now the public functions for
304         creating new StringImpl objects. They all implement the shared empty string.
305         (WebCore::StringImpl::createWithTerminatingNullCharacter):
306         * platform/text/StringImpl.h:
307
308         * platform/text/cf/StringCF.cpp:
309         (WebCore::String::String): Use StringImpl::create instead of new StringImpl.
310         * platform/text/cf/StringImplCF.cpp:
311         (WebCore::StringImpl::createCFString): Removed now-obsolete const.
312         * platform/text/mac/StringImplMac.mm:
313         (WebCore::StringImpl::operator NSString *): Ditto.
314         * platform/text/mac/StringMac.mm:
315         (WebCore::String::String): Use StringImpl::create instead of new StringImpl.
316         * platform/text/qt/StringQt.cpp:
317         (WebCore::String::String): Ditto.
318         * platform/text/wx/StringWx.cpp:
319         (WebCore::String::String): Ditto.
320         * rendering/RenderBR.cpp:
321         (WebCore::RenderBR::RenderBR): Ditto.
322
323         * rendering/RenderSVGInlineText.cpp:
324         (WebCore::RenderSVGInlineText::RenderSVGInlineText): Use PassRefPtr.
325         * rendering/RenderSVGInlineText.h:
326
327         * rendering/RenderText.cpp:
328         (WebCore::charactersAreAllASCII): Removed now-unneeded const.
329         * rendering/RenderTextFragment.cpp:
330         (WebCore::RenderTextFragment::originalText): Use RefPtr.
331
332 2008-01-02  Timothy Hatcher  <timothy@apple.com>
333
334         Reviewed by Oliver Hunt.
335
336         <rdar://problem/5618086> WebInspector does not expand the DOM tree after being closed
337
338         Closing the Web Inspector causes the DOM tree outline to be torn down, clearing the
339         internal element lookup tables. The represented DOM node object still holds the identifier
340         it was assigned, and a later call to findTreeElement will use that original identifier
341         against a cleared lookup table. In that case we need to fallback on DOM ancestor lookup.
342
343         * page/inspector/treeoutline.js:
344         (TreeOutline.prototype.findTreeElement): If the DOM node already had a __treeElementIdentifier,
345         but the TreeOutline no longer has the element in the _knownTreeElements list do an ancestor lookup
346         instead of an early return.
347
348 2008-01-02  Alice Liu  <alice.liu@apple.com>
349
350         Reviewed by Maciej.
351
352         Fixed <rdar://5283861> (problems scrolling in gmail message content area)
353
354         * platform/ScrollView.h:
355         * platform/win/ScrollViewWin.cpp:
356         (WebCore::ScrollView::scroll):
357          Changed return value to bool to reflect success of scroll attempt
358
359 2008-01-02  Alexey Proskuryakov  <ap@webkit.org>
360
361         Fixed a typo (pointed out in review, but I somehow missed it at first).
362
363         * editing/EditorCommand.cpp: (WebCore::executeDelete):
364
365 2008-01-02  Alexey Proskuryakov  <ap@webkit.org>
366
367         Reviewed by Darin.
368
369         Resolved several FIXMEs in EditorCommand.
370         Made recently added commands hidden from JS again.
371         Removed BackwardDelete implementation, which used to be dead code, but got exposed now.
372
373         Tests: editing/execCommand/delete-no-scroll.html
374                editing/execCommand/forward-delete-no-scroll.html
375                editing/execCommand/insert-line-break-no-scroll.html
376
377         * editing/EditorCommand.cpp:
378         (WebCore::executeDelete):
379         (WebCore::executeForwardDelete):
380         (WebCore::executeInsertLineBreak):
381         (WebCore::supportedFromMenuOrKeyBinding):
382         (WebCore::CommandEntry::):
383
384 2008-01-02  Alexey Proskuryakov  <ap@webkit.org>
385
386         Reviewed by Darin.
387
388         http://bugs.webkit.org/show_bug.cgi?id=14555
389         action=mailto + method=get - The generated mailto URI is incorrect and the hvalues are encoded twice
390
391         http://bugs.webkit.org/show_bug.cgi?id=14774
392         Submitted data only includes first input item
393
394         Reworked encoding of mailto URLs to match other browsers.
395         Moved most of related logic from FrameLoader::submitForm() to HTMLFormElement::submit().
396
397         Tests: fast/forms/mailto/advanced-get.html
398                fast/forms/mailto/advanced-put.html
399                fast/forms/mailto/get-multiple-items-text-plain.html
400                fast/forms/mailto/get-multiple-items-x-www-form-urlencoded.html
401                fast/forms/mailto/get-multiple-items.html
402                fast/forms/mailto/get-non-ascii.html
403                fast/forms/mailto/get-non-ascii-text-plain.html
404                fast/forms/mailto/get-overwrite-query.html
405                fast/forms/mailto/post-append-query.html
406                fast/forms/mailto/post-multiple-items-multipart-form-data.html
407                fast/forms/mailto/post-multiple-items-text-plain.html
408                fast/forms/mailto/post-multiple-items-x-www-form-urlencoded.html
409                fast/forms/mailto/post-multiple-items.html
410
411         * html/HTMLFormElement.cpp:
412         (WebCore::HTMLFormElement::submit):
413         * loader/FrameLoader.cpp:
414         (WebCore::FrameLoader::submitForm):
415
416 2008-01-02  Mark Rowe  <mrowe@apple.com>
417
418         Autotools build fix.
419
420         * GNUmakefile.am: Remove files before generating them, not after.
421
422 2008-01-02  Mark Rowe  <mrowe@apple.com>
423
424         Rubber-stamped by Alp Toker.
425
426         Add missing dependencies to some GNUmakefile.am rules.
427
428         * GNUmakefile.am:
429
430 2008-01-02  Mark Rowe  <mrowe@apple.com>
431
432         Reviewed by Alp Toker.
433
434         Autotools build fix.  Make can expand $@ to any of the targets for the rule,
435         while we always want to use the name of the .cpp file as the output file.
436
437         * GNUmakefile.am:
438
439 2008-01-02  Luca Bruno  <lethalman88@gmail.com>
440
441         Reviewed by Alp Toker.
442
443         http://bugs.webkit.org/show_bug.cgi?id=16115
444         [GTK] ContextMenu and ContextMenuItem lacks an implementation
445
446         Add context menu support.
447
448         Based on a patch by Holger Freyther.
449
450         * platform/gtk/ContextMenuGtk.cpp:
451         (WebCore::menuItemActivated):
452         (WebCore::ContextMenu::ContextMenu):
453         (WebCore::ContextMenu::~ContextMenu):
454         (WebCore::ContextMenu::appendItem):
455         (WebCore::ContextMenu::setPlatformDescription):
456         (WebCore::ContextMenu::releasePlatformDescription):
457         * platform/gtk/ContextMenuItemGtk.cpp:
458         (WebCore::ContextMenuItem::ContextMenuItem):
459         (WebCore::ContextMenuItem::~ContextMenuItem):
460         (WebCore::ContextMenuItem::releasePlatformDescription):
461         (WebCore::ContextMenuItem::type):
462         (WebCore::ContextMenuItem::action):
463         (WebCore::ContextMenuItem::setAction):
464         (WebCore::ContextMenuItem::platformSubMenu):
465         (WebCore::ContextMenuItem::setSubMenu):
466         (WebCore::ContextMenuItem::setChecked):
467         (WebCore::ContextMenuItem::setEnabled):
468
469 2008-01-02  Alp Toker  <alp@atoker.com>
470
471         GTK+ autotools build fix. Track changes in r29073.
472
473         * GNUmakefile.am:
474
475 2008-01-01  Darin Adler  <darin@apple.com>
476
477         - fix release build
478
479         * bindings/js/kjs_binding.cpp:
480         (KJS::setDOMException): Initialize to avoid uninitialized variable warning.
481         Removed default so we get a warning if there's a missing case.
482
483 2008-01-01  David D. Kilzer  <ddkilzer@webkit.org>
484
485         Scripting MIME Types application/ecmascript, application/javascript not viewable
486         <http://bugs.webkit.org/show_bug.cgi?id=11063>
487
488         Reviewed by Darin.
489
490         This patch consolidates the list of acceptable MIME types for JavaScript
491         source into the MIMETypeRegistry class, and replaces checks for these
492         types with a call to MIMETypeRegistry::isSupportedJavaScriptMIMEType().
493
494         No tests added since viewing JavaScript source is not testable.
495
496         * dom/DOMImplementation.cpp:
497         (WebCore::DOMImplementation::isTextMIMEType): Use
498         MIMETypeRegistry::isSupportedJavaScriptMIMEType() instead of a single
499         hard-coded MIME type, "application/x-javascript".
500
501         * html/HTMLScriptElement.cpp:
502         (WebCore::HTMLScriptElement::shouldExecuteAsJavaScript): Moved list of
503         JavaScript MIME types from here to
504         MIMETypeRegistry::initialiseSupportedJavaScriptMIMETypes().
505
506         * platform/MIMETypeRegistry.cpp:
507         (WebCore::initialiseSupportedJavaScriptMIMETypes): Added. List of
508         MIME types came from HTMLScriptElement::shouldExecuteAsJavaScript().
509         (WebCore::initialiseSupportedNonImageMimeTypes): Remove single
510         hard-coded MIME type, "application/x-javascript", from the list.
511         (WebCore::initialiseMIMETypeRegistry): Initialise
512         supportedJavaScriptMIMETypes, then pre-populate supportedNonImageMIMETypes
513         with values in supportedJavaScriptMIMETypes.
514         (WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType): Added.
515
516         * platform/MIMETypeRegistry.h: Added isSupportedJavaScriptMIMEType().
517
518 2008-01-01  Sam Weinig  <sam@webkit.org>
519
520         Reviewed by Darin.
521
522         Patch for http://bugs.webkit.org/show_bug.cgi?id=16691
523         Use real JS objects for the rest of the DOMExceptions (EventException, RangeException, etc)
524
525         - Create JS objects for all the different types of exceptions, each with there own prototype and constructor.
526         - Abstract all the logic and storage for exception classes in to an ExceptionBase class.
527         - Move specialized ExceptionCodes into the exception classes. (ie. the EventExceptionCode enum is now in EventException).
528
529         Tests: fast/dom/DOMException/EventException.html
530                fast/dom/DOMException/RangeException.html
531                fast/dom/DOMException/XPathException.html
532                http/tests/xmlhttprequest/XMLHttpRequestException.html
533                svg/custom/SVGException.html
534
535         * DerivedSources.make:
536         * WebCore.pro:
537         * WebCore.vcproj/WebCore.vcproj:
538         * WebCore.xcodeproj/project.pbxproj:
539         * WebCoreSources.bkl:
540         * bindings/js/JSSVGMatrixCustom.cpp:
541         (WebCore::JSSVGMatrix::inverse):
542         (WebCore::JSSVGMatrix::rotateFromVector):
543         * bindings/js/kjs_binding.cpp:
544         (KJS::setDOMException):
545         * bindings/scripts/CodeGeneratorJS.pm: Use the constant values defined
546         in the IDL as the ObjC bindings do.
547         * bindings/scripts/CodeGeneratorObjC.pm:
548         * dom/DOMCoreException.cpp: Removed.
549         * dom/DOMCoreException.h:
550         (WebCore::DOMCoreException::DOMCoreException):
551         * dom/DOMCoreException.idl:
552         * dom/Event.h:
553         * dom/EventException.h: Copied from WebCore/dom/DOMCoreException.h.
554         (WebCore::EventException::EventException):
555         (WebCore::EventException::):
556         * dom/EventException.idl: Copied from WebCore/dom/DOMCoreException.idl.
557         * dom/EventTargetNode.cpp:
558         (WebCore::EventTargetNode::dispatchEvent):
559         * dom/ExceptionBase.cpp: Copied from WebCore/dom/DOMCoreException.cpp.
560         (WebCore::ExceptionBase::ExceptionBase):
561         (WebCore::ExceptionBase::toString):
562         * dom/ExceptionBase.h: Copied from WebCore/dom/DOMCoreException.h.
563         (WebCore::ExceptionBase::code):
564         * dom/ExceptionCode.cpp:
565         (WebCore::getExceptionCodeDescription):
566         * dom/ExceptionCode.h:
567         (WebCore::):
568         * dom/Range.cpp:
569         (WebCore::Range::insertNode):
570         (WebCore::Range::checkNodeWOffset):
571         (WebCore::Range::checkNodeBA):
572         (WebCore::Range::selectNode):
573         (WebCore::Range::selectNodeContents):
574         (WebCore::Range::surroundContents):
575         * dom/RangeException.h:
576         (WebCore::RangeException::RangeException):
577         (WebCore::RangeException::):
578         * dom/RangeException.idl:
579         * page/DOMWindow.idl:
580         * svg/SVGColor.cpp:
581         (WebCore::SVGColor::setRGBColor):
582         * svg/SVGException.h:
583         (WebCore::SVGException::SVGException):
584         (WebCore::SVGException::):
585         * svg/SVGException.idl:
586         * svg/SVGLocatable.cpp:
587         (WebCore::SVGLocatable::getTransformToElement):
588         * xml/XMLHttpRequest.cpp:
589         (WebCore::XMLHttpRequest::dispatchEvent):
590         (WebCore::XMLHttpRequest::open):
591         (WebCore::XMLHttpRequest::send):
592         * xml/XMLHttpRequest.h:
593         * xml/XMLHttpRequestException.h: Copied from WebCore/dom/DOMCoreException.h.
594         (WebCore::XMLHttpRequestException::XMLHttpRequestException):
595         (WebCore::XMLHttpRequestException::):
596         * xml/XMLHttpRequestException.idl: Copied from WebCore/dom/DOMCoreException.idl.
597         * xml/XPathEvaluator.h:
598         * xml/XPathException.h: Copied from WebCore/dom/DOMCoreException.h.
599         (WebCore::XPathException::XPathException):
600         (WebCore::XPathException::):
601         * xml/XPathException.idl: Copied from WebCore/dom/DOMCoreException.idl.
602         * xml/XPathParser.cpp:
603         (WebCore::XPath::Parser::parseStatement):
604         * xml/XPathResult.cpp:
605         (WebCore::XPathResult::convertTo):
606         (WebCore::XPathResult::numberValue):
607         (WebCore::XPathResult::stringValue):
608         (WebCore::XPathResult::booleanValue):
609         (WebCore::XPathResult::singleNodeValue):
610         (WebCore::XPathResult::snapshotLength):
611         (WebCore::XPathResult::iterateNext):
612         (WebCore::XPathResult::snapshotItem):
613
614 2008-01-01  Sam Weinig  <sam@webkit.org>
615
616         Remove JSDomExceptionConstructor.lut.h from clean step
617         as it no longer exists.
618
619         * GNUmakefile.am:
620
621 2008-01-01  Dan Bernstein  <mitz@apple.com>
622
623         - Windows build fix
624
625         * WebCore.vcproj/WebCore.vcproj:
626
627 2008-01-01  Sam Weinig  <sam@webkit.org>
628
629         Try again to fix the builds
630
631         * DerivedSources.make:
632
633 2008-01-01  Sam Weinig  <sam@webkit.org>
634
635         Fix non-mac builds.
636
637         * WebCore.pro:
638         * WebCore.vcproj/WebCore.vcproj:
639         * WebCoreSources.bkl:
640
641 2008-01-01  Eric Seidel  <eric@webkit.org>
642
643         Reviewed by Alexey.
644
645         Don't replace \ with / in data: urls
646         http://bugs.webkit.org/show_bug.cgi?id=16692
647
648         Test: fast/loader/url-data-replace-backslash.html
649
650         * platform/KURL.cpp:
651         (WebCore::KURL::init):
652
653 2008-01-01  Alp Toker  <alp@atoker.com>
654
655         GTK+ autotools build fix. Track changes in r29051, r29058 and pass the
656         correct parameter to AM_INIT_AUTOMAKE.
657
658         * GNUmakefile.am:
659
660 2007-12-31  Sam Weinig  <sam@webkit.org>
661
662         Reviewed by Darin.
663
664         Patch for http://bugs.webkit.org/show_bug.cgi?id=16637
665         Acid3 expects ExeceptionCode constants to be defined on DOMException objects
666
667         - Make DOMException a real JS object.
668
669         Test: fast/dom/DOMException/prototype-object.html
670
671         * DerivedSources.make:
672         * WebCore.xcodeproj/project.pbxproj:
673
674         This is no longer needed as the autogenerated classes now includes the
675         constructor.
676         * bindings/js/JSDOMExceptionConstructor.cpp: Removed.
677         * bindings/js/JSDOMExceptionConstructor.h: Removed.
678
679         Create on demand and use the new class for DOMExceptions.
680         * bindings/js/kjs_binding.cpp:
681         (KJS::setDOMException):
682
683         Remove no longer needed custom constructor getter.
684         * bindings/js/kjs_window.cpp:
685         (KJS::Window::getValueProperty):
686
687         Don't expose DOMCoreException as the name of class by special casing
688         the user visible class name to be DOMException.
689         * bindings/scripts/CodeGeneratorJS.pm:
690
691         The DOMException class/file needs to be named DOMCoreException because there is
692         name conflict with one of the Objective-C bindings classes.  It should be renamed
693         to DOMException when the Objective-C bindings are moved into WebKit.
694         * dom/DOMCoreException.cpp: Added.
695         (WebCore::DOMCoreException::DOMCoreException):
696         (WebCore::DOMCoreException::toString):
697         * dom/DOMCoreException.h: Added.
698         (WebCore::DOMCoreException::):
699         (WebCore::DOMCoreException::code):
700         (WebCore::DOMCoreException::name):
701         (WebCore::DOMCoreException::message):
702         * dom/DOMCoreException.idl: Added.
703         * page/DOMWindow.idl:
704
705 2007-12-31  Sam Weinig  <sam@webkit.org>
706
707         Re-enable querySelector and querySelectorAll and touch the necessary files to not
708         kill the windows build.
709
710         * WebCore.vcproj/build-generated-files.sh:
711         * bindings/scripts/CodeGeneratorCOM.pm:
712         * dom/Document.idl:
713         * dom/Element.idl:
714
715 2007-12-31  Darin Adler  <darin@apple.com>
716
717         - fix Windows build
718
719         * dom/Document.idl: Temporarily disable querySelector and querySelectorAll, since they are showing
720         up as pure virtual functions. Sam can fix this later.
721         * dom/Element.idl: Ditto.
722
723 2007-12-31  Dan Bernstein  <mitz@apple.com>
724
725         Reviewed by Darin Adler.
726
727         - fix http://bugs.webkit.org/show_bug.cgi?id=14134
728           <rdar://problem/5655160> REGRESSION (r25353): Whitespace nodes ignored between inline list items
729
730         Test: fast/dynamic/create-renderer-for-whitespace-only-text.html
731
732         * dom/Node.cpp:
733         (WebCore::Node::attach): Added code to check if this node's renderer
734         has become the "previous renderer" of any sibling text node, and if so,
735         ensure that that node gets a renderer if it now needs one.
736         (WebCore::Node::createRendererIfNeeded): Removed the assertion that the
737         node is not attached.
738
739 2007-12-31  Darin Adler  <darin@apple.com>
740
741         Reviewed by Mitz.
742
743         - fix http://bugs.webkit.org/show_bug.cgi?id=16641
744           Acid3 reveals HTMLFormElement.elements fails to update when element name changes
745
746         Test: fast/dom/HTMLFormElement/elements-not-in-document.html
747
748         This was a bug specific to forms that are not in the document tree.
749         The fix was to change the code to increment the document version number to match
750         up with other document change tracking. Maybe at some point we can clean these up
751         so we don't have so many competing change notification systems.
752
753         * dom/ContainerNode.cpp:
754         (WebCore::ContainerNode::replaceChild): Removed bogus comment.
755         (WebCore::ContainerNode::addChild): Added an explicit incDOMTreeVersion
756         call here, since this code path bypasses the subtree-modified event code.
757
758         * dom/Element.cpp:
759         (WebCore::Element::setAttribute): Remove the inDocument() check -- not all HTML
760         collections are for things in the document.
761         (WebCore::Element::setAttributeMap): Ditto.
762
763         * dom/EventTargetNode.cpp:
764         (WebCore::EventTargetNode::dispatchSubtreeModifiedEvent): Added a call to
765         incDOMTreeVersion here; covers most cases of tree structure changes.
766
767         * dom/Node.cpp:
768         (WebCore::Node::attach): Remove call to incDOMTreeVersion -- creating a renderer
769         has nothing to do with changes to the DOM tree!
770         (WebCore::Node::detach): Ditto.
771
772         * html/HTMLFormElement.cpp:
773         (WebCore::HTMLFormElement::registerFormElement): Remove call to incDOMTreeVersion.
774         This is handled at a lower level and doesn't need to be here.
775         (WebCore::HTMLFormElement::removeFormElement): Ditto.
776
777 2007-12-31  Henry Mason  <hmason@mac.com>
778
779         Reviewed by Darin.
780
781         Patch for http://bugs.webkit.org/show_bug.cgi?id=14994
782         Support for MessageEvent and cross-domain messaging
783
784         Test: http/tests/messaging/cross-domain-message-send.html
785
786         * DerivedSources.make:
787         * WebCore.pro:
788         * WebCore.vcproj/WebCore.vcproj:
789         * WebCore.xcodeproj/project.pbxproj:
790         * WebCoreSources.bkl:
791         * bindings/js/JSDOMWindowCustom.cpp:
792         (WebCore::JSDOMWindow::customGetOwnPropertySlot): Allow cross-domain access to the
793         postMessage function.
794         (WebCore::JSDOMWindow::postMessage):
795         * bindings/js/JSEventCustom.cpp:
796         (WebCore::toJS):
797         * dom/Event.cpp:
798         (WebCore::Event::isMessageEvent):
799         * dom/Event.h:
800         * dom/EventNames.h: New event name
801         * dom/MessageEvent.cpp: Added.
802         * dom/MessageEvent.h: Added.
803         * dom/MessageEvent.idl: Added.
804         * page/DOMWindow.cpp:
805         (WebCore::DOMWindow::postMessage): Added.
806         * page/DOMWindow.h:
807         * page/DOMWindow.idl:
808
809 2007-12-31  Darin Adler  <darin@apple.com>
810
811         Suggested by Antti.
812
813         - turn ENABLE_VIDEO back off for Windows until we can install QuickTime on the build bots
814
815         * WebCore.vcproj/WebCore.vcproj: Removed ENABLE_VIDEO.
816         * WebCore.vcproj/build-generated-files.sh: Ditto.
817
818 2007-12-30  Alp Toker  <alp@atoker.com>
819
820         Reviewed by Dan Bernstein.
821
822         Silence warning.
823
824         * dom/NodeList.h:
825
826 2007-12-30  Sam Weinig  <sam@webkit.org>
827
828         Reviewed by Oliver Hunt.
829
830         Fix for http://bugs.webkit.org/show_bug.cgi?id=16387
831         Variable names can be enumerated across domains
832         <rdar://problem/5640454>
833
834         Test: http/tests/security/cross-frame-access-enumeration.html
835
836         * bindings/js/kjs_window.cpp:
837         (KJS::Window::getPropertyNames): Override method to test same-origin policy.
838         * bindings/js/kjs_window.h:
839
840 2007-12-30  Sam Weinig  <sam@webkit.org>
841
842         Reviewed by Oliver Hunt.
843
844         Patch for http://bugs.webkit.org/show_bug.cgi?id=10686
845         event instanceof MouseEvent throws exception
846
847         Add JS constructors for all the Event types.
848
849         Test: fast/events/event-instanceof.html
850
851         * WebCore.xcodeproj/project.pbxproj:
852         * dom/KeyboardEvent.idl:
853         * dom/MouseEvent.idl:
854         * dom/MutationEvent.idl:
855         * dom/OverflowEvent.idl:
856         * dom/ProgressEvent.idl:
857         * dom/TextEvent.idl:
858         * dom/UIEvent.idl:
859         * dom/WheelEvent.idl:
860         * page/DOMWindow.idl:
861
862 2007-12-30  David Kilzer  <ddkilzer@webkit.org>
863
864         Reviewed by Darin.
865
866         - fix http://bugs.webkit.org/show_bug.cgi?id=15359
867           JPEG image not shown when height is specified as percentage inside a table
868
869         The problem occurs when a replaced element (image, canvas, etc.) with
870         a percent-height attribute is contained by a table cell with an auto-
871         or percent-height attribute.  If there are no other conditions to cause
872         the table cell's height to expand, an available height of zero will
873         always be returned.  In these cases, the intrinsic height of the
874         replaced element should be used if it is greater than the available
875         height of the table cell.
876
877         Tests: fast/replaced/table-percent-height.html
878                tables/mozilla/bugs/bug137388-1.html
879                tables/mozilla/bugs/bug137388-2.html
880
881         * rendering/RenderBox.cpp:
882         (WebCore::RenderBox::calcReplacedHeightUsing):
883
884 2007-12-30  Luca Bruno  <lethalman88@gmail.com>
885
886         Reviewed by Alp Toker.
887
888         http://bugs.webkit.org/show_bug.cgi?id=16099
889         Crash in CURL for empty POST
890
891         We have to set POST even when the data is empty, otherwise cURL will
892         hang while waiting for a response.
893
894         * platform/network/curl/ResourceHandleManager.cpp
895         (ResourceHandleManager::setupPOST): allow empty POST
896
897 2007-12-29  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
898
899         Reviewed by Alp Toker.
900
901         Move all SVG related stuff inside SVG block. Don't include
902         SVGNames, SVGElementFactory, and XLinkNames when SVG is not
903         enabled
904
905         * GNUmakefile.am:
906
907 2007-12-29  Alexey Proskuryakov  <ap@webkit.org>
908
909         Reviewed by Darin.
910
911         http://bugs.webkit.org/show_bug.cgi?id=14428
912         FCKEditor: Images disappear on drag/drop and copy/paste
913
914         Test: editing/pasteboard/drag-image-in-about-blank-frame.html
915
916         * editing/markup.cpp: (WebCore::createFragmentFromMarkup): Don't use "about:blank" as a
917         base URL, just like we don't use an empty one.
918
919 2007-12-29  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
920
921         Reviewed by Alp Toker.
922
923         http://bugs.webkit.org/show_bug.cgi?id=16669
924         autotools update and fixes
925
926         Autotools update and database/icon database inclusion guard fixes
927
928         * GNUmakefile.am:
929           - Update autotools config as per -r29012 changes
930           - Fix CSSGrammar.h/cpp generation (Seo Sanghyeon, sanxiyn)
931         * dom/Document.cpp:
932         * loader/icon/IconDatabase.h:
933         * page/DOMWindow.cpp:
934         * page/InspectorController.cpp:
935         * page/Settings.cpp:
936         * storage/Database.h:
937           - Remove ENABLE(DATABASE) inclusion guard. Let the includer add the guard instead.
938
939 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
940
941         Reviewed by Alexey.
942
943         Respect horiz-origin-x / horiz-origin-y / vert-origin-x / vert-origin-y properties when drawing SVG Fonts.
944         (Fixes fonts-elem-05-t.svg in a --svg-fonts build)
945
946         * svg/SVGFont.cpp:
947         (WebCore::Font::drawGlyphsWithSVGFont):
948
949 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
950
951         Reviewed by Oliver.
952
953         Further SVG Font work. Parse all <glyph> attributes, using SVGGlyphElement::buildGlyphIdentifier.
954         SVGFontElement::collectGlyphs() now uses this method. Per character advance values work well now.
955
956         * platform/graphics/FontData.cpp:
957         (WebCore::SVGFontData::convertEmUnitToPixel): Add helper function.
958         (WebCore::FontData::ascent):
959         (WebCore::FontData::descent):
960         * platform/graphics/FontData.h:
961         * svg/SVGFont.cpp:
962         (WebCore::isVerticalWritingMode): Add helper function.
963         (WebCore::Font::drawGlyphsWithSVGFont):
964         * svg/SVGFontElement.cpp:
965         (WebCore::SVGFontElement::collectGlyphs): Simplified implementation - SVGGlyphIdentifier now build by SVGGlyphElement.
966         * svg/SVGGlyphElement.cpp:
967         (WebCore::parseArabicForm): Helper function.
968         (WebCore::parseOrientation): Ditto.
969         (WebCore::parsePathData): Ditto.
970         (WebCore::SVGGlyphElement::buildGlyphIdentifier):
971         * svg/SVGGlyphElement.h:
972         (WebCore::SVGGlyphElement::rendererIsNeeded):
973
974 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
975
976         Reviewed by Oliver.
977
978         Refactor SVGAnimationElement::parseValues into a generic function parseDelimitedString.
979         SVGAnimationElement needs to parse semicolon-seperated strings, SVGGlyphElement comma-seperated.
980
981         * svg/SVGAnimationElement.cpp:
982         (WebCore::SVGAnimationElement::parseMappedAttribute):
983         * svg/SVGParserUtilities.cpp:
984         (WebCore::parseDelimitedString):
985         * svg/SVGParserUtilities.h:
986
987 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
988
989         Reviewed by Maciej.
990
991         Add new helper structure SVGFontData - FontData holds this object as OwnPtr.
992         Store several attribute values there (horiz-adv-x, horiz-origin-x etc..)
993
994         To optimize for the common case ('FontData' used for HTML rendering) it feels
995         better to hold one OwnPtr in FontData, than several floats.
996
997         Parse all <font> attributes in SVGFontFaceElement::createFontData.
998
999         * platform/graphics/FontData.cpp:
1000         (WebCore::SVGFontData::SVGFontData):
1001         (WebCore::FontData::FontData):
1002         (WebCore::FontData::ascent):
1003         (WebCore::FontData::descent):
1004         * platform/graphics/FontData.h:
1005         (WebCore::FontData::isSVGFont):
1006         (WebCore::FontData::svgFontData):
1007         * svg/SVGFont.cpp:
1008         (WebCore::Font::drawGlyphsWithSVGFont):
1009         * svg/SVGFontElement.cpp:
1010         * svg/SVGFontElement.h:
1011         (WebCore::SVGFontElement::rendererIsNeeded):
1012         * svg/SVGFontFaceElement.cpp:
1013         (WebCore::SVGFontFaceElement::unitsPerEm):
1014         (WebCore::SVGFontFaceElement::createFontData):
1015
1016 2007-12-28  Darin Adler  <darin@apple.com>
1017
1018         - try to fix Windows and WX builds (broken by SVG Fonts check-in)
1019
1020         * platform/graphics/win/FontWin.cpp:
1021         (WebCore::Font::drawGlyphs): Pass font size to FontData::ascent, now that it requires it.
1022         I can't see how it can be right to require the font size for ascent and descent,
1023         but not for other metrics functions in FontData.
1024
1025         * platform/graphics/wx/FontWx.cpp:
1026         (WebCore::Font::drawGlyphs): Pass font size to FontData::ascent and FontData::descent.
1027
1028 2007-12-28  Dan Bernstein  <mitz@apple.com>
1029
1030         Reviewed by Mark Rowe.
1031
1032         - fix http://bugs.webkit.org/show_bug.cgi?id=16650
1033           <rdar://problem/5664872> REGRESSION (r28278-r28314): ATSUI uses LTR writing direction for all text runs
1034
1035         Covered by existing pixel tests.
1036
1037         * platform/graphics/mac/FontMac.mm:
1038         (WebCore::Font::drawComplexText): Corrected to maintain the style
1039         information in the adjusted text run when passing it to
1040         ATSUILayoutParameters. Prior to r28298 the style was passed separately.
1041
1042 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
1043
1044         Build fix, not reviewed.
1045
1046         Add wtf/OwnPtr.h include, to fix --svg-fonts build.
1047
1048         * css/SVGCSSFontFace.h:
1049
1050 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
1051
1052         Reviewed by Eric.
1053
1054         Fixes: http://bugs.webkit.org/show_bug.cgi?id=10649 (WebKit SVG needs SVG Fonts support)
1055
1056         Begin implementation of SVG Fonts module. Basic documents using SVG Fonts already work.
1057         Only local, in-document fonts who declare their glyphs using the <glyph d="..."> path syntax
1058         are supported. (<glyph> containing arbitary SVG content as child elements, not supported yet).
1059
1060         Limited to single char <-> glyph mapping, no ligatures supported yet.
1061         (ie. <glyph unicode='A'/> <glyph unicode='AB'/> - it ignores the 'AB' glyph definition for now)
1062
1063         Mark all SVG Font related classes & usages in ENABLE(SVG_FONTS) blocks.
1064
1065         No layout test changes for a --no-svg-fonts build, heavy changes if enabled. Because a lot of SVG Font
1066         attributes are not processed yet, the rendering looks wrong - hence disabled by default.)
1067
1068         * DerivedSources.make: Add SVGFontElement/SVGGlyphElement/SVGMissingGlyphElement
1069         * WebCore.pro: Updated build system.
1070         * WebCore.vcproj/WebCore.vcproj: Ditto.
1071         * WebCore.xcodeproj/project.pbxproj: Ditto.
1072         * bindings/js/JSSVGElementWrapperFactory.cpp: Add JSSVGFontElement/JSSVGGlyphElement/JSSVGMissingGlyphElement
1073         * bindings/objc/DOM.mm: Ditto (for DOMSVG*).
1074         (WebCore::createElementClassMap):
1075         * bindings/objc/DOMInternal.h: Ditto.
1076         * bindings/objc/DOMSVG.h: Ditto.
1077         * css/CSSFontFace.h: Mark three functions 'virtual', to be overriden by SVGCSSFontFace
1078         * css/CSSFontFaceSrcValue.h: Add functionality to identify as SVG CSS font face source.
1079         (WebCore::CSSFontFaceSrcValue::m_fontFaceElement): Hold a pointer to the font face which created it.
1080         (WebCore::CSSFontFaceSrcValue::svgFontFaceElement):
1081         (WebCore::CSSFontFaceSrcValue::setSVGFontFaceElement):
1082         * css/CSSFontSelector.cpp: Build 'SVGCSSFontFace' objects for local, in-document SVG fonts.
1083         (WebCore::CSSFontSelector::addFontFaceRule):
1084         * css/SVGCSSFontFace.cpp: Added. (Simplified implementation for SVG Fonts)
1085         (WebCore::SVGCSSFontFace::SVGCSSFontFace):
1086         (WebCore::SVGCSSFontFace::~SVGCSSFontFace):
1087         (WebCore::SVGCSSFontFace::isValid):
1088         (WebCore::SVGCSSFontFace::addSource):
1089         (WebCore::SVGCSSFontFace::getFontData):
1090         * css/SVGCSSFontFace.h: Added.
1091         * platform/graphics/cg/PathCG.cpp:
1092         (WebCore::Path::closeSubpath): Silence a CG warning when calling closeSubpath() on empty path.
1093         * platform/graphics/Font.cpp: Add some logic to call into SVG Font code when operating on SVG Fonts.
1094         (WebCore::Font::ascent): Pass font size to FontData::ascent() call
1095         (WebCore::Font::descent): Pass font size to FontData::descent() call
1096         (WebCore::Font::canUseGlyphCache): Always return true for SVG fonts here.
1097         (WebCore::Font::drawGlyphBuffer): Call drawGlyphsWithSVGFont (instead of drawGlyphs) if the primary font is a SVG font.
1098         * platform/graphics/Font.h: Add (SVG-only!) ability to store a RenderObject pointer, to the element which invoked the drawText() call.
1099         (WebCore::TextRun::TextRun):
1100         (WebCore::TextRun::referencingRenderObject):
1101         (WebCore::TextRun::setReferencingRenderObject):
1102         * platform/graphics/FontData.cpp:
1103         (WebCore::FontData::FontData):
1104         (WebCore::FontData::ascent):
1105         (WebCore::FontData::descent):
1106         * platform/graphics/FontData.h: Store a pointer to the SVGFontFaceElement, which created this FontData object - needed for drawGlyphsWithSVGFont().
1107         (WebCore::FontData::isSVGFont): Offer a way to determine wheter this is a FontData object, created by a SVGFontFaceElement.
1108         (WebCore::FontData::svgFontFace):
1109         * rendering/SVGInlineTextBox.cpp:
1110         (WebCore::SVGInlineTextBox::calculateGlyphWidth): Add assertion.
1111         * rendering/SVGRootInlineBox.cpp:
1112         (WebCore::svgTextRunForInlineTextBox): Always call 'setReferencingRenderObject(myRenderSVGText)' on the new TextRun
1113         * svg/SVGFont.cpp: Added.
1114         (WebCore::Font::drawGlyphsWithSVGFont): Outsourced implementation of SVG Fonts into it's own file.
1115         * svg/SVGFontElement.cpp: Added. (Note: this holds the GlyphHashMap which associates certain <glyph> objects with unicode values)
1116         (WebCore::SVGFontElement::SVGFontElement):
1117         (WebCore::SVGFontElement::~SVGFontElement):
1118         (WebCore::SVGFontElement::parseMappedAttribute):
1119         (WebCore::SVGFontElement::collectGlyphs):
1120         (WebCore::SVGFontElement::glyphIdentifierForGlyphCode):
1121         * svg/SVGFontElement.h: Added.
1122         (WebCore::GlyphHash::hash):
1123         (WebCore::GlyphHash::equal):
1124         (WebCore::GlyphHashTraits::deletedValue):
1125         (WebCore::SVGFontElement::rendererIsNeeded):
1126         (WebCore::SVGFontElement::contextElement):
1127         * svg/SVGFontElement.idl: Added.
1128         * svg/SVGFontFaceElement.cpp: Build SVG specific 'FontData' object
1129         (WebCore::SVGFontFaceElement::unitsPerEm):
1130         (WebCore::SVGFontFaceElement::fontFamily):
1131         (WebCore::SVGFontFaceElement::createFontData): Builds SVG specified 'FontData' object with the markup specified ascent/descent values etc..
1132         (WebCore::SVGFontFaceElement::rebuildFontFace): Construct CSSFontFaceSrc object (marked as 'isSVGFontFaceSrc') to satisfy CSSFontSelector::addFontFaceRule.
1133         (WebCore::SVGFontFaceElement::insertedIntoDocument): Rebuild font face.
1134         (WebCore::SVGFontFaceElement::glyphIdentifierForGlyphCode): Allows drawGlyphsWithSVGFont to access the glyph hash map living in the SVGFontElement.
1135         * svg/SVGFontFaceElement.h: Fixed code formatting issues & wrap in ENABLE(SVG_FONTS) blocks.
1136         * svg/SVGFontFaceElement.idl: Ditto.
1137         * svg/SVGFontFaceFormatElement.cpp: Ditto.
1138         * svg/SVGFontFaceFormatElement.h: Ditto.
1139         * svg/SVGFontFaceFormatElement.idl: Ditto.
1140         * svg/SVGFontFaceNameElement.cpp: Ditto.
1141         * svg/SVGFontFaceNameElement.h: Ditto.
1142         * svg/SVGFontFaceNameElement.idl: Ditto.
1143         * svg/SVGFontFaceSrcElement.cpp: Ditto.
1144         * svg/SVGFontFaceSrcElement.h: Ditto.
1145         * svg/SVGFontFaceSrcElement.idl: Ditto.
1146         * svg/SVGFontFaceUriElement.cpp: Ditto.
1147         * svg/SVGFontFaceUriElement.h: Ditto.
1148         * svg/SVGFontFaceUriElement.idl: Ditto.
1149         * svg/SVGDefinitionSrcElement.cpp: Ditto.
1150         * svg/SVGDefinitionSrcElement.h: Ditto.
1151         * svg/SVGDefinitionSrcElement.idl: Ditto.
1152         * svg/SVGGlyphElement.cpp: Added.
1153         (WebCore::SVGGlyphElement::SVGGlyphElement):
1154         (WebCore::SVGGlyphElement::parseMappedAttribute):
1155         (WebCore::SVGGlyphElement::childrenChanged):
1156         * svg/SVGGlyphElement.h: Added.
1157         (WebCore::SVGGlyphElement::rendererIsNeeded):
1158         (WebCore::SVGGlyphIdentifier::): Structure holding all data to represent a SVG glyph (origin, advance, orientation etc..)
1159         (WebCore::SVGGlyphIdentifier::SVGGlyphIdentifier):
1160         * svg/SVGGlyphElement.idl: Added.
1161         * svg/SVGMissingGlyphElement.cpp: Added. (stub implementation)
1162         (WebCore::SVGMissingGlyphElement::SVGMissingGlyphElement):
1163         (WebCore::SVGMissingGlyphElement::parseMappedAttribute):
1164         (WebCore::SVGMissingGlyphElement::childrenChanged):
1165         * svg/SVGMissingGlyphElement.h: Added.
1166         (WebCore::SVGMissingGlyphElement::rendererIsNeeded):
1167         * svg/SVGMissingGlyphElement.idl: Added.
1168         * svg/svgtags.in: Wrap all SVGFont* elements in ENABLE(SVG_FONTS) block - to assure --no-svg-fonts compilation works (which is the default for now!).
1169
1170 2007-12-27  Dan Bernstein  <mitz@apple.com>
1171
1172         Reviewed by Alexey Proskuryakov.
1173
1174         - fix http://bugs.webkit.org/show_bug.cgi?id=16628
1175           ASSERTION FAILED: m_resizeLayer (running layout tests)
1176
1177         * rendering/RenderLayer.cpp:
1178         (WebCore::RenderLayer::~RenderLayer): Avoid calling
1179         EventHandler::resizeLayerDestroyed() if the document is being destroyed.
1180
1181 2007-12-27  Dan Bernstein  <mitz@apple.com>
1182
1183         Reviewed by Oliver Hunt.
1184
1185         - fix http://bugs.webkit.org/show_bug.cgi?id=16603
1186           <rdar://problem/5664199> Crash when resizing text field
1187
1188         Test: fast/layers/resize-layer-deletion-crash.html
1189
1190         The event handler has only a weak reference to the layer that is
1191         currently in resize mode, so it is the layer's responsibility to let
1192         the event handler know if it has been destroyed while in that mode.
1193
1194         * page/EventHandler.cpp:
1195         (WebCore::EventHandler::resizeLayerDestroyed): Added. Resets
1196         m_resizeLayer to 0.
1197         * page/EventHandler.h:
1198         * rendering/RenderLayer.cpp:
1199         (WebCore::RenderLayer::~RenderLayer): Added a call to
1200         EventHandler::resizeLayerDestroyed() if the layer is in resize mode.
1201
1202 2007-12-27  Collin Jackson  <webkit@collinjackson.com>
1203
1204         Reviewed by Sam Weinig.
1205
1206         http://bugs.webkit.org/show_bug.cgi?id=16539
1207         <rdar://problem/5659269>
1208
1209         The same-origin check was missing in the implementation of 
1210         setTimeout, setInterval, addEventListener, and removeEventListener.
1211
1212         Suppose <http://www.badguy.com/> contains an iframe to 
1213         <http://www.goodguy.com/>. Now www.badguy.com can steal
1214         www.goodguy.com cookies by running this code:
1215
1216         setTimeout.call(frames[0], "alert(document.cookie)", 1000);
1217
1218         This patch changes the behavior so that setTimeout to does 
1219         nothing and returns an undefined value if the caller is not
1220         permitted to script the window whose setTimeout method is being
1221         called. The same applies to setInterval, addEventListener, and 
1222         removeEventListener.
1223
1224         Tests: http/tests/security/cross-frame-access-call.html
1225
1226         * bindings/js/kjs_window.cpp:
1227         (KJS::WindowProtoFuncSetTimeout::callAsFunction)
1228         (KJS::WindowProtoFuncSetInterval::callAsFunction)
1229         (KJS::WindowProtoFuncAddEventListener::callAsFunction)
1230         (KJS::WindowProtoFuncRemoveEventListener::callAsFunction)
1231
1232 2007-12-27  Dan Bernstein  <mitz@apple.com>
1233
1234         Reviewed by Dave Hyatt and Sam Weinig.
1235
1236         - fix <rdar://problem/5605937> Inspector: Disclosure triangle not drawn in node's properties panel until click
1237
1238         Test: fast/layers/add-layer-with-nested-stacking.html
1239         Test: fast/layers/remove-layer-with-nested-stacking.html
1240
1241         * rendering/RenderLayer.cpp:
1242         (WebCore::RenderLayer::addChild): If the new child is overflow-only
1243         but has children of its own, dirty the stacking context's z-order lists
1244         since the grandchildren might need to be in them.
1245         (WebCore::RenderLayer::removeChild): Similarly for the old child.
1246
1247 2007-12-27  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
1248
1249         Reviewed by Alp Toker.
1250
1251         http://bugs.webkit.org/show_bug.cgi?id=16353
1252         [GTK] Check for deprecated API use (G_DISABLE_DEPRECATED etc.)
1253
1254         Added the flags mentioned in the bug only when doing 'debug'
1255         builds. -DGST_DISABLE_DEPRECATED only added when video is enabled.
1256
1257         * GNUmakefile.am:
1258         * WebCore.pro:
1259
1260 2007-12-27  Dan Bernstein  <mitz@apple.com>
1261
1262         Reviewed by Eric Seidel.
1263
1264         - fix http://bugs.webkit.org/show_bug.cgi?id=16490
1265           ASSERT in ~FrameView while viewing/reloading WICD test case
1266
1267         Test: fast/dynamic/paused-event-dispatch.html
1268
1269         * page/FrameView.cpp:
1270         (WebCore::FrameView::~FrameView):
1271         (WebCore::FrameView::layout): Changed to always pause event dispatch and
1272         always resume event dispatch, regardless of whether the post-layout
1273         task timer is active. However, if it is active, assert that event
1274         dispatch is still paused.
1275
1276 2007-12-27  Alexey Proskuryakov  <ap@webkit.org>
1277
1278         Reviewed by Maciej.
1279
1280         http://bugs.webkit.org/show_bug.cgi?id=14500
1281         need to be more generous about charset declaration with meta tag
1282         
1283         http://bugs.webkit.org/show_bug.cgi?id=12526
1284         <rdar://problem/4867183> Safari ignores encoding description "charset=Shift_JIS" in invalid html
1285
1286         <rdar://problem/4892428> Unlike other browsers, WebKit ignores <meta> charset definitions outside the head
1287
1288         <rdar://problem/5643774> REGRESSION: Text is garbled when clicking a link inside an Arabic website
1289
1290         Tests: fast/encoding/ahram-org-eg.html
1291                fast/encoding/bandai-co-jp-releases.html
1292                fast/encoding/floraexpress-ru.html
1293                fast/encoding/hanarei-blog32-fc2-com.html
1294                fast/encoding/yahoo-mail.html
1295
1296         * loader/TextResourceDecoder.cpp:
1297         (WebCore::TextResourceDecoder::checkForHeadCharset): Don't stop looking for <meta> until we've
1298         seen at least 512 bytes of input.
1299
1300 2007-12-26  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
1301
1302         Reviewed by Alp Toker.
1303
1304         http://bugs.webkit.org/show_bug.cgi?id=16390
1305         Use autotools or GNU make as the build system for the GTK port
1306
1307         * GNUmakefile.am: Added.
1308
1309 2007-12-26  Alexey Proskuryakov  <ap@webkit.org>
1310
1311         Reviewed by Sam Weinig.
1312
1313         http://bugs.webkit.org/show_bug.cgi?id=16609
1314         Make manual-tests/xmlhttprequest-contenttype-empty.html test automatic
1315
1316         * manual-tests/xmlhttprequest-contenttype-empty.html: Removed (moved to LayoutTests/http).
1317
1318 2007-12-26  Mark Rowe  <mrowe@apple.com>
1319
1320         Windows build fix.
1321
1322         * platform/Threading.h:
1323
1324 2007-12-25  Rob Buis  <buis@kde.org>
1325
1326         Reviewed by Eric.
1327
1328         http://bugs.webkit.org/show_bug.cgi?id=15514
1329         <clipPath> with <use> not respected
1330         http://bugs.webkit.org/show_bug.cgi?id=16557
1331         SVG circle elements have been clipped away completely, instead of partially.
1332
1333         Add toClipPath to get clip path data for the clipping paths. Implement it for <use>, thereby allowing clip paths using use.
1334
1335         * svg/SVGClipPathElement.cpp:
1336         (WebCore::SVGClipPathElement::canvasResource):
1337         * svg/SVGStyledTransformableElement.h:
1338         (WebCore::SVGStyledTransformableElement::toClipPath):
1339         * svg/SVGUseElement.cpp:
1340         (WebCore::isDirectReference):
1341         (WebCore::SVGUseElement::toClipPath):
1342         * svg/SVGUseElement.h:
1343
1344 2007-12-25  Sam Weinig  <sam@webkit.org>
1345
1346         Reviewed by Eric Seidel.
1347
1348         Clean up the files relating to NodeLists.
1349
1350         * dom/ChildNodeList.cpp:
1351         (WebCore::ChildNodeList::ChildNodeList):
1352         (WebCore::ChildNodeList::length):
1353         (WebCore::ChildNodeList::item):
1354         (WebCore::ChildNodeList::nodeMatches):
1355         * dom/ChildNodeList.h:
1356         * dom/DynamicNodeList.cpp:
1357         (WebCore::DynamicNodeList::itemForwardsFromCurrent):
1358         (WebCore::DynamicNodeList::itemBackwardsFromCurrent):
1359         (WebCore::DynamicNodeList::itemWithName):
1360         * dom/DynamicNodeList.h:
1361         (WebCore::DynamicNodeList::needsNotifications):
1362         * dom/NameNodeList.cpp:
1363         (WebCore::NameNodeList::NameNodeList):
1364         (WebCore::NameNodeList::rootNodeAttributeChanged):
1365         (WebCore::NameNodeList::nodeMatches):
1366         * dom/NameNodeList.h:
1367         * dom/NodeList.h:
1368         * dom/SelectorNodeList.h:
1369
1370 2007-12-25  Sam Weinig  <sam@webkit.org>
1371
1372         Fix non-mac builds.
1373
1374         * WebCore.pro:
1375         * WebCore.vcproj/WebCore.vcproj:
1376         * WebCoreSources.bkl:
1377
1378 2007-12-25  Sam Weinig  <sam@webkit.org>
1379
1380         Rubber stamped by Eric Seidel.
1381
1382         Move TagNodeList into its own file.
1383
1384         * WebCore.xcodeproj/project.pbxproj:
1385         * dom/Node.cpp:
1386         * dom/TagNodeList.cpp: Copied from dom/Node.cpp.
1387         (WebCore::TagNodeList::TagNodeList):
1388         * dom/TagNodeList.h: Copied from dom/Node.cpp.
1389
1390 2007-12-25  Sam Weinig  <sam@webkit.org>
1391
1392         Reviewed by Eric Seidel.
1393
1394         Simplify the NodeList architecture.
1395         - Rename recursiveItem() to item(), since it is not recursive.
1396         - Make recursiveLength() iterative and rename to length().
1397         - Remove now unneeded overrides of item() and length() that used 
1398           to call the recursive variants.
1399
1400         * dom/ClassNodeList.cpp:
1401         * dom/ClassNodeList.h:
1402         * dom/DynamicNodeList.cpp:
1403         (WebCore::DynamicNodeList::length):
1404         (WebCore::DynamicNodeList::item):
1405         (WebCore::DynamicNodeList::rootNodeAttributeChanged): Move implementation 
1406         into the .cpp file since virtual methods can't be inlined.
1407         * dom/DynamicNodeList.h:
1408         * dom/NameNodeList.cpp:
1409         * dom/NameNodeList.h:
1410         * dom/Node.cpp:
1411
1412 2007-12-25  Alp Toker  <alp@atoker.com>
1413
1414         More complete GTK+/Qt/Wx/Win build fixes for breakage introduced in
1415         r28981.
1416
1417         * WebCore.pro:
1418         * WebCore.vcproj/WebCore.vcproj:
1419         * WebCoreSources.bkl:
1420
1421 2007-12-25  Alp Toker  <alp@atoker.com>
1422
1423         Win build fix for breakage introduced in r28981.
1424
1425         * WebCore.vcproj/WebCore.vcproj:
1426
1427 2007-12-25  Alp Toker  <alp@atoker.com>
1428
1429         Wx build fix for breakage introduced in r28981.
1430
1431         * WebCoreSources.bkl:
1432
1433 2007-12-25  Alp Toker  <alp@atoker.com>
1434
1435         GTK+/Qt build fix for breakage introduced in r28981.
1436
1437         * WebCore.pro:
1438
1439 2007-12-25  David Smith  <catfish.man@gmail.com> and Sam Weinig  <sam@webkit.org>
1440
1441         Reviewed by Oliver.
1442         
1443         - http://bugs.webkit.org/show_bug.cgi?id=16587
1444         Implement the most useful part of the W3C Selectors API.
1445
1446         * WebCore.xcodeproj/project.pbxproj:
1447         * css/CSSStyleSelector.h: Make Node a friend of CSSStyleSelector so it can use checkSelector()
1448         * dom/ChildNodeList.cpp:
1449         (WebCore::ChildNodeList::ChildNodeList): Change to being a DynamicNodeList
1450         * dom/ChildNodeList.h:
1451         * dom/ClassNodeList.cpp:
1452         (WebCore::ClassNodeList::ClassNodeList): Change to being a DynamicNodeList
1453         * dom/ClassNodeList.h:
1454         * dom/Document.idl: Add the new functions
1455         * dom/DynamicNodeList.cpp: Copied from WebCore/dom/NodeList.cpp.
1456         (WebCore::DynamicNodeList::DynamicNodeList): Rename NodeList to DynamicNodeList, to differentiate it from the new StaticNodeList
1457         (WebCore::DynamicNodeList::~DynamicNodeList):
1458         (WebCore::DynamicNodeList::recursiveLength):
1459         (WebCore::DynamicNodeList::itemForwardsFromCurrent):
1460         (WebCore::DynamicNodeList::itemBackwardsFromCurrent):
1461         (WebCore::DynamicNodeList::recursiveItem):
1462         (WebCore::DynamicNodeList::itemWithName):
1463         (WebCore::DynamicNodeList::rootNodeChildrenChanged):
1464         (WebCore::DynamicNodeList::Caches::Caches):
1465         (WebCore::DynamicNodeList::Caches::reset):
1466         * dom/DynamicNodeList.h: Copied from WebCore/dom/NodeList.h.
1467         (WebCore::DynamicNodeList::rootNodeAttributeChanged):
1468         * dom/Element.idl: Add the new functions
1469         * dom/NameNodeList.cpp: Change to being a DynamicNodeList
1470         (WebCore::NameNodeList::NameNodeList):
1471         * dom/NameNodeList.h:
1472         (WebCore::NameNodeList::rootNodeAttributeChanged):
1473         * dom/Node.cpp:
1474         (WebCore::TagNodeList::TagNodeList): Change to being a DynamicNodeList
1475         (WebCore::Node::registerDynamicNodeList):
1476         (WebCore::Node::unregisterDynamicNodeList):
1477         (WebCore::Node::getElementsByName):
1478         (WebCore::Node::getElementsByClassName):
1479         (WebCore::Node::querySelector): new
1480         (WebCore::Node::querySelectorAll): new
1481         * dom/Node.h:
1482         * dom/NodeList.cpp: Removed.
1483         * dom/NodeList.h: This is now an abstract superclass of DynamicNodeList and StaticNodeList
1484         (WebCore::NodeList::NodeList):
1485         (WebCore::NodeList::~NodeList):
1486         * dom/SelectorNodeList.cpp: Added.
1487         (WebCore::SelectorNodeList::SelectorNodeList): New StaticNodeList subclass that filters elements by CSS selector
1488         * dom/SelectorNodeList.h: Added.
1489         * dom/StaticNodeList.cpp: Added.
1490         (WebCore::StaticNodeList::length):
1491         (WebCore::StaticNodeList::item):
1492         (WebCore::StaticNodeList::itemWithName):
1493         * dom/StaticNodeList.h: Added.
1494         (WebCore::StaticNodeList::StaticNodeList):
1495         (WebCore::StaticNodeList::~StaticNodeList):
1496
1497 2007-12-25  Mark Rowe  <mrowe@apple.com>
1498
1499         Reviewed by Sam Weinig.
1500
1501         Implement a lock-free ThreadSafeShared for i386, x86_64, ppc and ppc64.
1502         http://bugs.webkit.org/show_bug.cgi?id=16596
1503
1504         This is a 1.7x as fast as the lock-based implementation on x86 for a single-threaded use
1505         of ThreadSafeShared but is closer to 280x as fast when there is heavy concurrent multi-threaded
1506         access to a single ThreadSafeShared object.
1507
1508         The atomic operations are based on those used by the Boost C++ library's shared_ptr implementation.
1509
1510         * platform/Threading.h:
1511         (WebCore::atomicIncrement):
1512         (WebCore::atomicDecrement):
1513         (WebCore::ThreadSafeShared::ThreadSafeShared):
1514         (WebCore::ThreadSafeShared::ref): Use lock-free operations if available.
1515         (WebCore::ThreadSafeShared::deref): Ditto.
1516         (WebCore::ThreadSafeShared::hasOneRef):
1517         (WebCore::ThreadSafeShared::refCount):
1518         (WebCore::ThreadSafeShared::isThreadSafe):
1519
1520 2007-12-24  Darin Adler  <darin@apple.com>
1521
1522         * platform/text/PlatformString.h: Removed now-incorrect comment.
1523         Added a comment about copy().
1524         * platform/text/StringImpl.h: Added a comment about copy().
1525
1526 2007-12-24  Darin Adler  <darin@apple.com>
1527
1528         Reviewed by Maciej.
1529
1530         - http://bugs.webkit.org/show_bug.cgi?id=16550
1531           make StringImpl immutable
1532
1533         I tried to keep the changes to a minimum. In some cases there is
1534         room for optimization -- I didn't try to add in the "single ref count"
1535         optimizations and there might be a tiny bit more string copying than
1536         we had before.
1537
1538         * WebCore.base.exp: Updated.
1539
1540         * dom/CharacterData.cpp:
1541         (WebCore::CharacterData::appendData): Changed to use String since
1542         StringImpl doesn't have mutating functions any more.
1543         (WebCore::CharacterData::insertData): Ditto.
1544         (WebCore::CharacterData::deleteData): Ditto.
1545         (WebCore::CharacterData::replaceData): Ditto.
1546         * dom/Text.cpp:
1547         (WebCore::Text::splitText): Changed to use substring instead of
1548         remove since StringImpl does't have mutating functions any more.
1549         * editing/CompositeEditCommand.cpp:
1550         (WebCore::CompositeEditCommand::deleteInsignificantText): Changed
1551         to use String instead of StringImpl so we can use remove.
1552
1553         * platform/text/PlatformString.h: Removed newUninitialized.
1554         Added append that takes a character pointer and length.
1555
1556         * platform/text/String.cpp:
1557         (WebCore::String::insert): Added an implementation that does not
1558         rely on an underlying StringImpl function.
1559         (WebCore::String::append): Ditto.
1560         (WebCore::String::truncate): Ditto.
1561         (WebCore::String::remove): Ditto.
1562         (WebCore::String::charactersWithNullTermination): Added an
1563         implementation that uses the new StringImpl null termination feature,
1564         which does not require modifying a string.
1565
1566         * platform/text/StringImpl.cpp:
1567         (WebCore::isSpace): Fix comment.
1568         (WebCore::StringImpl::StringImpl): Added a new constructor that makes
1569         a string with a trailing null character.
1570         (WebCore::StringImpl::substring): Marked const.
1571         (WebCore::StringImpl::replace): Marked const; had to add quite a few
1572         const_cast. Also rewrote one of these to work without modifying the
1573         existing string.
1574
1575         * platform/text/StringImpl.h: Fixed a mistake where the empty string had
1576         m_hasTerminatingNullCharacter uninitialized. Added a type and constructor
1577         for creating strings that have a trailing null character. Added a
1578         hasTerminatingNullCharacter function. Removed newUninitialized,
1579         charactersWithNullTermination, append, insert, truncate, and remove.
1580         Marked lots of other functions const.
1581
1582         * platform/text/TextCodecLatin1.cpp:
1583         (WebCore::TextCodecLatin1::decode): Rewrote to use a Vector instead of
1584         newUninitialized.
1585         * platform/text/TextCodecUTF16.cpp:
1586         (WebCore::TextCodecUTF16::decode): Ditto.
1587         * platform/text/TextCodecUserDefined.cpp:
1588         (WebCore::TextCodecUserDefined::decode): Ditto.
1589
1590         * rendering/RenderStyle.cpp:
1591         (WebCore::RenderStyle::setContent): Changed to use String since
1592         StringImpl doesn't have mutating functions any more.
1593
1594 2007-12-24  Alexey Proskuryakov  <ap@webkit.org>
1595
1596         Reviewed by Oliver.
1597
1598         Fix fast/events/arrow-keys-on-body.html, failing on Windows.
1599
1600         * platform/win/KeyEventWin.cpp:
1601         (WebCore::isKeypadEvent):
1602         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1603         Use HIWORD() macro instead of shifting the value explicitly (no change in behavior).
1604
1605 2007-12-23  Alexey Proskuryakov  <ap@webkit.org>
1606
1607         Fix Debug and Release QTMovieWin bulds.
1608
1609         * WebCore.vcproj/QTMovieWin.vcproj:
1610         * WebCore.vcproj/debug.vsprops:
1611         * WebCore.vcproj/debug_internal.vsprops:
1612         * WebCore.vcproj/release.vsprops:
1613         Use LibraryConfigSuffix instead of WebKitConfigSuffix for pthreadVC2.
1614         Build release import lib into \lib, not \bin.
1615
1616 2007-12-23  Alp Toker  <alp@atoker.com>
1617
1618         Reviewed by Holger Freyther.
1619
1620         http://bugs.webkit.org/show_bug.cgi?id=15382
1621         [CAIRO] Canvas pattern support
1622
1623         http://bugs.webkit.org/show_bug.cgi?id=16577
1624         Merge Cairo enhancements from Apollo project
1625
1626         Add support for canvas patterns.
1627
1628         Make Image::nativeImageForCurrentFrame() public.
1629
1630         Fix some typos along the way.
1631
1632         The globalAlpha canvas fixes are not included in this patch as
1633         they're slightly more intrusive and may conflict conceptually with
1634         GraphicsContext::setAlpha().
1635
1636         * html/CanvasPattern.cpp:
1637         (WebCore::CanvasPattern::CanvasPattern):
1638         (WebCore::CanvasPattern::~CanvasPattern):
1639         (WebCore::CanvasPattern::createPattern):
1640         * html/CanvasPattern.h:
1641         (WebCore::CanvasPattern::platformImage):
1642         * html/CanvasRenderingContext2D.cpp:
1643         (WebCore::CanvasRenderingContext2D::setShadow):
1644         (WebCore::CanvasRenderingContext2D::applyShadow):
1645         (WebCore::CanvasRenderingContext2D::drawImage):
1646         (WebCore::CanvasRenderingContext2D::createPattern):
1647         (WebCore::CanvasRenderingContext2D::applyStrokePattern):
1648         (WebCore::CanvasRenderingContext2D::applyFillPattern):
1649         * platform/graphics/Image.h:
1650         (WebCore::Image::nativeImageForCurrentFrame):
1651
1652 2007-12-23  Kevin Ollivier  <kevino@theolliviers.com>
1653
1654         Reviewed by Eric Seidel.
1655
1656         Remove getWxBitmap as we have nativeImageForCurrentFrame now,
1657         and don't draw a border in fillRect.
1658
1659         * platform/graphics/BitmapImage.h:
1660         * platform/graphics/wx/GraphicsContextWx.cpp:
1661         (WebCore::GraphicsContext::fillRect):
1662         * platform/graphics/wx/ImageWx.cpp:
1663
1664 2007-12-23  Alp Toker  <alp@atoker.com>
1665
1666         Reviewed by Holger Freyther.
1667
1668         http://bugs.webkit.org/show_bug.cgi?id=16577
1669         Merge Cairo enhancements from Apollo project
1670
1671         This patch is based on initial merging work by Brent Fulgham. Adobe's
1672         code has been modified in a few places to better suit the existing
1673         coding style.
1674
1675         Implement more clipping and drawing functions.
1676
1677         Save and restore the fill rule manually when clipping.
1678
1679         Avoid image surface creation when the image buffer has height zero.
1680
1681         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1682         (WebCore::GraphicsContext::clip):
1683         (WebCore::GraphicsContext::addInnerRoundedRectClip):
1684         (WebCore::GraphicsContext::addPath):
1685         (WebCore::GraphicsContext::clipOut):
1686         (WebCore::GraphicsContext::clipOutEllipseInRect):
1687         (WebCore::GraphicsContext::fillRoundedRect):
1688         * platform/graphics/cairo/ImageSourceCairo.cpp:
1689         (WebCore::ImageSource::createFrameAtIndex):
1690
1691 2007-12-23  Nikolas Zimmermann  <zimmermann@kde.org>
1692
1693         Reviewed by Mark.
1694
1695         Fix wrong placed ifdef - wrapping SVGDefsElement, instead of SVGDefinitionSrcElement in SVG_FONTS block.
1696
1697         * bindings/objc/DOM.mm:
1698         (WebCore::createElementClassMap):
1699
1700 2007-12-22  Alp Toker  <alp@atoker.com>
1701
1702         GTK+ build fix
1703
1704         GTK_TARGET_OTHER_APP is not available in older GTK+ versions. Pass
1705         empty target flags for now.
1706
1707         Check GTK+, not GLib versions, since they are different.
1708
1709         * platform/gtk/PasteboardGtk.cpp:
1710         (WebCore::Pasteboard::documentFragment):
1711
1712 2007-12-22  Luca Bruno  <lethalman88@gmail.com>
1713
1714         Reviewed by Alp Toker.
1715
1716         http://bugs.webkit.org/show_bug.cgi?id=16311
1717         [Gtk] Copy rich text to clipboard as text/plain and text/html.
1718
1719         Hook into the WebView to get the correct clipboard object on the
1720         appropriate display. This is necessary because GTK+ does not have
1721         global clipboards.
1722
1723         * WebCore.pro:
1724         * platform/Pasteboard.h:
1725         (WebCore::Pasteboard::setHelper): added for GTK
1726         (WebCore::Pasteboard::m_helper): private added for GTK
1727         * platform/gtk/PasteboardGtk.cpp:
1728         (WebCore::PasteboardSelectionData): added to support GTK selection data callback
1729         (WebCore::clipboard_get_contents_cb): added
1730         (WebCore::clipboard_clear_contents_cb): added
1731         (WebCore::Pasteboard::~Pasteboard):
1732         (WebCore::Pasteboard::setHelper):
1733         (WebCore::Pasteboard::writeSelection): copy rich text
1734         (WebCore::Pasteboard::documentFragment): 
1735         (WebCore::Pasteboard::plainText): 
1736         * platform/gtk/PasteboardHelper.h: Added.
1737
1738 2007-12-22  Nikolas Zimmermann  <zimmermann@kde.org>
1739
1740         Reviewed by Oliver.
1741
1742         Fixes: http://bugs.webkit.org/show_bug.cgi?id=15966 (Crash in SVGRootInlineBox::walkTextChunks() on mouse hover)
1743
1744         Add new isSVGRootInlineBox() function to InlineBox to be able to differentiate between RootInlineBox/SVGRootInlineBox.
1745         SVG assumed it's root inline box (for <text> elements) is always of type SVGRootInlineBox, which is not the case
1746         for HTML text in <foreignObject>. Text selection doesn't work so far as line box offsets are wrong - which is visible
1747         in Web Inspector.
1748
1749         * rendering/InlineBox.h:
1750         (WebCore::InlineBox::isSVGRootInlineBox):
1751         * rendering/SVGInlineTextBox.cpp:
1752         (WebCore::SVGInlineTextBox::svgRootInlineBox):
1753         (WebCore::SVGInlineTextBox::closestCharacterToPosition):
1754         (WebCore::SVGInlineTextBox::selectionRect):
1755         * rendering/SVGRenderTreeAsText.cpp:
1756         (WebCore::writeSVGInlineTextBox):
1757         * rendering/SVGRootInlineBox.h:
1758         (WebCore::SVGRootInlineBox::isSVGRootInlineBox):
1759
1760 2007-12-22  Alp Toker  <alp@atoker.com>
1761
1762         LOW_BANDWIDTH_DISPLAY build fix
1763
1764         Track recent KURL DeprecatedString changes.
1765
1766         * loader/FrameLoader.cpp:
1767         (WebCore::FrameLoader::switchOutLowBandwidthDisplayIfReady):
1768
1769 2007-12-22  Dan Bernstein  <mitz@apple.com>
1770
1771         - Windows build fix
1772
1773         * WebCore.vcproj/WebCore.vcproj:
1774
1775 2007-12-22  Xan Lopez  <xan@gnome.org>
1776
1777         Reviewed by Alp Toker.
1778
1779         Add missing return 0 to fix a compile warning.
1780
1781         * page/gtk/FrameGtk.cpp:
1782         (WebCore::Frame::createScriptInstanceForWidget):
1783
1784 2007-12-21  Antti Koivisto  <antti@apple.com>
1785
1786         Reviewed by Darin, Adam and Steve.
1787
1788         Add media playback support for Windows.
1789         
1790         The implementation uses low level QuickTime API. DLL is
1791         needed to work around CF use in both WebKit and QuickTime.
1792         
1793         This makes Windows build depend on the QuickTime SDK 
1794         
1795         http://developer.apple.com/quicktime/download/
1796         
1797         but not QuickTime itself.
1798         
1799         QTMovieWinTimer contains some copy code from SharedTimerWin. It
1800         is used in the QuickTime access DLL which can't use WebCore
1801         SharedTimer due to dependency problems.
1802
1803         * WebCore.vcproj/QTMovieWin.vcproj: Added.
1804         * WebCore.vcproj/WebCore.vcproj:
1805         * WebCore.vcproj/build-generated-files.sh:
1806         * html/HTMLMediaElement.cpp:
1807         (WebCore::HTMLMediaElement::setSrc):
1808         * platform/graphics/MediaPlayer.cpp:
1809         * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp: Added.
1810         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
1811         (WebCore::MediaPlayerPrivate::~MediaPlayerPrivate):
1812         (WebCore::MediaPlayerPrivate::load):
1813         (WebCore::MediaPlayerPrivate::play):
1814         (WebCore::MediaPlayerPrivate::pause):
1815         (WebCore::MediaPlayerPrivate::duration):
1816         (WebCore::MediaPlayerPrivate::currentTime):
1817         (WebCore::MediaPlayerPrivate::seek):
1818         (WebCore::MediaPlayerPrivate::doSeek):
1819         (WebCore::MediaPlayerPrivate::cancelSeek):
1820         (WebCore::MediaPlayerPrivate::seekTimerFired):
1821         (WebCore::MediaPlayerPrivate::setEndTime):
1822         (WebCore::MediaPlayerPrivate::startEndPointTimerIfNeeded):
1823         (WebCore::MediaPlayerPrivate::endPointTimerFired):
1824         (WebCore::MediaPlayerPrivate::paused):
1825         (WebCore::MediaPlayerPrivate::seeking):
1826         (WebCore::MediaPlayerPrivate::naturalSize):
1827         (WebCore::MediaPlayerPrivate::hasVideo):
1828         (WebCore::MediaPlayerPrivate::setVolume):
1829         (WebCore::MediaPlayerPrivate::setMuted):
1830         (WebCore::MediaPlayerPrivate::setRate):
1831         (WebCore::MediaPlayerPrivate::dataRate):
1832         (WebCore::MediaPlayerPrivate::maxTimeBuffered):
1833         (WebCore::MediaPlayerPrivate::maxTimeSeekable):
1834         (WebCore::MediaPlayerPrivate::maxTimeLoaded):
1835         (WebCore::MediaPlayerPrivate::bytesLoaded):
1836         (WebCore::MediaPlayerPrivate::totalBytesKnown):
1837         (WebCore::MediaPlayerPrivate::totalBytes):
1838         (WebCore::MediaPlayerPrivate::cancelLoad):
1839         (WebCore::MediaPlayerPrivate::updateStates):
1840         (WebCore::MediaPlayerPrivate::didEnd):
1841         (WebCore::MediaPlayerPrivate::setRect):
1842         (WebCore::MediaPlayerPrivate::setVisible):
1843         (WebCore::MediaPlayerPrivate::paint):
1844         (WebCore::MediaPlayerPrivate::getSupportedTypes):
1845         (WebCore::MediaPlayerPrivate::movieEnded):
1846         (WebCore::MediaPlayerPrivate::movieLoadStateChanged):
1847         (WebCore::MediaPlayerPrivate::movieTimeChanged):
1848         (WebCore::MediaPlayerPrivate::movieNewImageAvailable):
1849         * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.h: Added.
1850         (WebCore::MediaPlayerPrivate::networkState):
1851         (WebCore::MediaPlayerPrivate::readyState):
1852         * platform/graphics/win/QTMovieWin.cpp: Added.
1853         (updateTaskTimer):
1854         (QTMovieWinPrivate::QTMovieWinPrivate):
1855         (QTMovieWinPrivate::~QTMovieWinPrivate):
1856         (taskTimerFired):
1857         (QTMovieWinPrivate::startTask):
1858         (QTMovieWinPrivate::endTask):
1859         (QTMovieWinPrivate::task):
1860         (QTMovieWinPrivate::registerDrawingCallback):
1861         (QTMovieWinPrivate::drawingComplete):
1862         (QTMovieWinPrivate::createGWorld):
1863         (QTMovieWinPrivate::setSize):
1864         (QTMovieWinPrivate::deleteGWorld):
1865         (QTMovieWin::QTMovieWin):
1866         (QTMovieWin::~QTMovieWin):
1867         (QTMovieWin::play):
1868         (QTMovieWin::pause):
1869         (QTMovieWin::rate):
1870         (QTMovieWin::setRate):
1871         (QTMovieWin::duration):
1872         (QTMovieWin::currentTime):
1873         (QTMovieWin::setCurrentTime):
1874         (QTMovieWin::setVolume):
1875         (QTMovieWin::setMuted):
1876         (QTMovieWin::dataSize):
1877         (QTMovieWin::maxTimeLoaded):
1878         (QTMovieWin::loadState):
1879         (QTMovieWin::getNaturalSize):
1880         (QTMovieWin::setSize):
1881         (QTMovieWin::setVisible):
1882         (QTMovieWin::paint):
1883         (QTMovieWin::load):
1884         (movieDrawingCompleteProc):
1885         (initializeSupportedTypes):
1886         (QTMovieWin::countSupportedTypes):
1887         (QTMovieWin::getSupportedType):
1888         (QTMovieWin::initializeQuickTime):
1889         (DllMain):
1890         * platform/graphics/win/QTMovieWin.h: Added.
1891         * platform/graphics/win/QTMovieWinTimer.cpp: Added.
1892         (TimerWindowWndProc):
1893         (initializeOffScreenTimerWindow):
1894         (setSharedTimerFiredFunction):
1895         (timerFired):
1896         (setSharedTimerFireDelay):
1897         (stopSharedTimer):
1898         (setSharedTimerInstanceHandle):
1899         (systemTime):
1900         * platform/graphics/win/QTMovieWinTimer.h: Added.
1901         * rendering/RenderMedia.cpp:
1902         (WebCore::MediaControlPlayButtonElement::update):
1903
1904 2007-12-21  Brent Fulgham  <bfulgham@gmail.com>
1905
1906         Reviewed by Alp Toker.
1907
1908         http://bugs.webkit.org/show_bug.cgi?id=16558
1909         Cairo WebCore Rendering Fails on arc drawing
1910
1911         Fix for bug reported (and patched) by Apollo team in which
1912         arcs were draw in reverse (resulting in inverted images).
1913         Review of the source found that the 'clockwise' term was
1914         actually meant to mean 'anticlockwise' so the IDL and
1915         supporting classes have been changed to match this. 
1916
1917         * html/CanvasRenderingContext2D.cpp:
1918         (WebCore::CanvasRenderingContext2D::arc):
1919         * html/CanvasRenderingContext2D.idl:
1920         * platform/graphics/cairo/PathCairo.cpp:
1921         (WebCore::Path::addArc):
1922         (WebCore::Path::addEllipse):
1923         * platform/graphics/Path.h:
1924
1925 2007-12-21  Alexey Proskuryakov  <ap@webkit.org>
1926
1927         Reviewed by Oliver.
1928
1929         <rdar://problem/5629995> Incorrect display of Danish characters on web site.
1930
1931         Test: http/tests/xmlhttprequest/response-encoding.html
1932
1933         * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::didReceiveData):
1934         Default to UTF-8 for HTML, too. It's unfortunate that we have to use different
1935         rules for main content and XHR responses, but this matches both IE and Firefox.
1936
1937 2007-12-20  Jon Honeycutt  <jhoneycutt@apple.com>
1938
1939         Reviewed by Kevin Decker.
1940
1941         <rdar://problem/5655797> REGRESSION(304-306A10) Safari does not find
1942         shockwave plugin on freshly installed OS
1943
1944         Look for Director plugin in its native directory.
1945
1946         * plugins/win/PluginDatabaseWin.cpp:
1947         (WebCore::PluginDatabaseWin::getPluginsInPaths): The Director plugin
1948         doesn't start with "np," so special case its filename.
1949         (WebCore::addMacromediaPluginPaths): Add Flash and "Shockwave 10"
1950         directories to the plugin paths.
1951         (WebCore::PluginDatabaseWin::defaultPluginPaths):
1952
1953 2007-12-20  Peter Kasting  <zerodpx@gmail.com>
1954
1955         Reviewed by Alp Toker.
1956
1957         http://bugs.webkit.org/show_bug.cgi?id=16508
1958         Fix regression in GIFImageDecoder.cpp: "Haeberli hack" led to wrongly
1959         decoded transparent areas.
1960
1961         * platform/image-decoders/gif/GIFImageDecoder.cpp:
1962         (WebCore::GIFImageDecoder::haveDecodedRow):
1963         * platform/image-decoders/gif/GIFImageDecoder.h:
1964         * platform/image-decoders/gif/GIFImageReader.cpp:
1965         (GIFImageReader::output_row):
1966
1967 2007-12-20  Justin Garcia  <justin.garcia@apple.com>
1968
1969         Reviewed by Oliver Hunt.
1970
1971         <rdar://problem/5543472> GoogleDocs: Safari hangs when creating a list from a particular selection
1972         
1973         Still need to fix similar issues with the other operations that iterate 
1974         over selected paragraphs, like FormatBlock, Indent and Outdent (<rdar://problem/5658933>).
1975
1976         * editing/IndentOutdentCommand.cpp:
1977         (WebCore::IndentOutdentCommand::indentRegion): Added a FIXME.
1978         * editing/IndentOutdentCommand.h: Removed an unused function.
1979         * editing/InsertListCommand.cpp:
1980         (WebCore::InsertListCommand::modifyRange): 
1981         Renamed visibleStart to startOfSelection and visibleEnd to endOfSelection.
1982         Call the new selectionForParagraphIteration, which a) prevents operations like this
1983         one from being performed on a table that isn't fully selected (where the selection
1984         starts just before the table and ends inside it), and b) helps prevent paragraph
1985         iteration from going past the end of the selection.
1986         Call the new startOfNextParagraph, instead of using endOfParagraph(v).next(),
1987         since when v is in the last paragraph of the last cell of a table, that expression 
1988         will return the position after the table, not the start of the next paragraph.
1989         * editing/htmlediting.cpp:
1990         (WebCore::enclosingListChild): Don't go above a table cell, so that list operations
1991         take effect inside the table cell where they are performed.
1992         (WebCore::selectionForParagraphIteration): Added, see above.
1993         (WebCore::indexForVisiblePosition): Moved from IndentOutdentCommand.cpp.
1994         * editing/htmlediting.h:
1995         * editing/visible_units.cpp:
1996         (WebCore::startOfNextParagraph): Added, see above.
1997         * editing/visible_units.h:
1998         * editing/TextIterator.h:
1999         (WebCore::TextIterator::exitNode): Added a FIXME.
2000
2001 2007-12-20  Alp Toker  <alp@atoker.com>
2002
2003         Rubber-stamped by Maciej.
2004
2005         http://bugs.webkit.org/show_bug.cgi?id=16542
2006         [GTK] Text is missing with old Pango version
2007
2008         Back out commits r28880, r28876, r28865, r28864 which added Pango font
2009         selection support. These changes caused a regression where no text was
2010         displayed with older Pango versions.
2011
2012         * platform/graphics/gtk/FontCacheGtk.cpp:
2013         (WebCore::FontCache::fontExists):
2014         * platform/graphics/gtk/FontDataGtk.cpp:
2015         (WebCore::FontData::platformDestroy):
2016         (WebCore::FontData::containsCharacters):
2017         * platform/graphics/gtk/FontPlatformData.h:
2018         (WebCore::FontPlatformData::FontPlatformData):
2019         (WebCore::FontPlatformData::hash):
2020         * platform/graphics/gtk/FontPlatformDataGtk.cpp:
2021         (WebCore::FontPlatformData::FontPlatformData):
2022         (WebCore::FontPlatformData::init):
2023         (WebCore::FontPlatformData::~FontPlatformData):
2024         (WebCore::FontPlatformData::isFixedPitch):
2025         (WebCore::FontPlatformData::operator==):
2026         * platform/graphics/gtk/GlyphPageTreeNodeGtk.cpp:
2027         (WebCore::GlyphPage::fill):
2028
2029 2007-12-20  Timothy Hatcher  <timothy@apple.com>
2030
2031         Reviewed by Sam Weinig.
2032
2033         <rdar://problem/5604897> Double-clicking on JavaScript console error
2034         won't show the line where it occurred
2035
2036         Make the URLs clickable in the console, since double clicking is used for
2037         word text selection. Makes the word "line" localizable. Messages that don't
2038         have a URL will no longer print "undefined". Messages that have a line number
2039         less than or equal to 0 will no longer be printed.
2040
2041         * English.lproj/InspectorLocalizedStrings.js: Add "%s (line %d)".
2042         * page/inspector/ConsolePanel.js: Tweak how the DOM nodes are created
2043           and change the click handler to look for a link with the
2044           "console-message-url" class name.
2045         * page/inspector/SourcePanel.js: Call setupSourceFrameIfNeeded() if a
2046           line row is needed. 
2047         * page/inspector/inspector.css: Update the look of the URL in the console.
2048
2049 2007-12-20  Adam Barth  <hk9565@gmail.com>
2050
2051         Reviewed and landed by Sam Weinig.
2052
2053         http://bugs.webkit.org/show_bug.cgi?id=15313
2054         <rdar://problem/5514516>
2055
2056         The same-origin check was incorrect in two cases (both fixed in this
2057         patch):
2058
2059         A) If both the source and the target have set their document.domain
2060            to the same value, the protocol must also match in order for
2061            access to be allowed.  Without this requirement, the browser is
2062            vulnerable to the following attack:
2063
2064            1) Suppose there is an HTTPS site (www.example.com) that sets
2065               document.domain = "example.com".
2066            2) A network attacker redirects the browser to http://www.example.com/
2067               a) injects script to set document.domain = "example.com", and
2068               b) opens a window to https://www.example.com/
2069            3) Now the network attacker can inject script into the HTTPS page,
2070               stealing cookies and issuing banking transactions.
2071
2072         B) If only one of the source and target has set document.domain, then
2073            access should be denied.  With this behavior, the browser is
2074            vulnerable to the following attack:
2075
2076            1) Suppose http://foo.example.com/ opens an iframe to
2077               http://foo.example.com/frame.html that
2078               a) sets document.domain = "example.com", and
2079               b) opens an iframe to http://bar.example.com/
2080               This is a common usage of document.domain for cross-domain
2081               communication, see for example:
2082                 http://www.collinjackson.com/research/papers/fp801-jackson.pdf
2083            2) The inner-most iframe, which is from bar.example.com, sets
2084               document.domain = "example.com".
2085            3) Now the inner-most iframe can inject script into the middle
2086               iframe (say via document.write).  This bar.example.com script
2087               now has access to the outer-most frame (from foo.example.com).
2088
2089         Both these changes cause WebKit to match the behavior of Firefox 2 and
2090         IE6 in these cases.  This patch includes regression tests for both
2091         issues.
2092
2093         Internet Explorer 7 and Opera 9 are more strict in that they require
2094         the port numbers to match when both pages have document.domain set.
2095         Opera 9 allows access when only one page has set document.domain, but
2096         this is a security vulnerability.
2097
2098         Tests: http/tests/security/cross-frame-access-child-explicit-domain.html
2099                http/tests/security/cross-frame-access-parent-explicit-domain.html
2100
2101         * bindings/js/kjs_window.cpp:
2102         (KJS::createWindow):
2103         (KJS::Window::allowsAccessFrom):
2104         * dom/Document.cpp:
2105         (WebCore::Document::domain):
2106         (WebCore::Document::setDomain):
2107         (WebCore::Document::initSecurityOrigin):
2108         * dom/Document.h:
2109         (WebCore::Document::securityOrigin):
2110         * loader/FrameLoader.cpp:
2111         (WebCore::FrameLoader::begin):
2112         (WebCore::FrameLoader::checkCallImplicitClose):
2113         (WebCore::FrameLoader::shouldAllowNavigation):
2114         * platform/SecurityOrigin.cpp:
2115         (WebCore::SecurityOrigin::setForURL):
2116         (WebCore::SecurityOrigin::createForFrame):
2117         (WebCore::SecurityOrigin::canAccess):
2118         * platform/SecurityOrigin.h:
2119         (WebCore::SecurityOrigin::domain):
2120         * storage/Database.cpp:
2121         (WebCore::Database::openDatabase):
2122         (WebCore::Database::Database):
2123         (WebCore::Database::securityOriginData):
2124         * storage/Database.h:
2125         (WebCore::Database::databaseDebugName):
2126         * storage/DatabaseTracker.cpp:
2127         (WebCore::DatabaseTracker::canEstablishDatabase):
2128         * storage/SQLTransaction.cpp:
2129         (WebCore::SQLTransaction::postflightAndCommit):
2130         (WebCore::SQLTransaction::cleanupAfterTransactionErrorCallback):
2131
2132 2007-12-20  Rodney Dawes  <dobey@wayofthemonkey.com>
2133
2134         Reviewed by Darin Adler.
2135
2136         Define XP_UNIX when building with plugins on X11.
2137         Use new npruntime_internal.h instead of npruntime.h.
2138         http://bugs.webkit.org/show_bug.cgi?id=15669
2139
2140         * ForwardingHeaders/bindings/npruntime_internal.h
2141         * WebCore.pro:
2142         * html/HTMLPlugInElement.h:
2143
2144 2007-12-19  johnnyding.webkit  <johnnyding.webkit@gmail.com>
2145
2146         Reviewed by Alexey. Landed by Stephanie.
2147
2148         - fix http://bugs.webkit.org/show_bug.cgi?id=16179 | <rdar://problem/5619399>
2149           Any attribute name start with a unicode which like #xx00(x could be any hex number[0-9a-f]) will cause HTMLTokenizer parse error
2150           Actually any unicode characters which great than 255 in attribute name will cause Webkit parse the attribute name wrong. So after comparing 
2151           the same scenario in IE 6/7, FireFox 2/3, Opera, we should treat those characters as part of attribute name.
2152
2153
2154         * html/HTMLTokenizer.cpp:
2155         (WebCore::HTMLTokenizer::parseEntity): Handle Unicode Entity Name by using ASCII version of findEntity.
2156         (WebCore::HTMLTokenizer::parseTag): Let type of ptr match type of cBuffer.
2157         * html/HTMLTokenizer.h: Change type of cBuffer from char to UChar.
2158
2159 2007-12-20  Eric Seidel  <eric@webkit.org>
2160
2161         Reviewed by Nikolas Zimmermann.
2162
2163         WebKit claims to support SVG feature strings it shouldn't
2164         http://bugs.webkit.org/show_bug.cgi?id=15480
2165
2166         * dom/DOMImplementation.cpp:
2167         (WebCore::isSVG10Feature):
2168         (WebCore::isSVG11Feature):
2169
2170 2007-12-20  John Sullivan  <sullivan@apple.com>
2171
2172         Reviewed by Oliver and Geoff
2173         
2174         - fix <rdar://problem/5536858> Yellow highlight for find results is sometimes shorter 
2175           than white "hole" behind it
2176
2177         * rendering/RenderText.cpp:
2178         (WebCore::RenderText::addLineBoxRects):
2179         respect useSelectionHeight in all cases; we were only respecting it in one of the two cases
2180
2181 2007-12-20  Dan Bernstein  <mitz@apple.com>
2182
2183         Reviewed by Darin Adler.
2184
2185         - fix <rdar://problem/5656368> REGRESSION(3.0.4-ToT): Acid2 test fails to render anything
2186
2187         * platform/win/ScrollViewWin.cpp:
2188         (WebCore::ScrollView::maximumScroll): Changed back to return the maximum
2189         scroll offsets even if scrolling is not allowed, because navigation and
2190         scrollTo should still work.
2191         (WebCore::ScrollView::wheelEvent): Added early return if scrolling is
2192         not allowed.
2193
2194 2007-12-17  Tony Chang  <idealisms@gmail.com>
2195
2196         Reviewed by Darin.
2197
2198         - Fix for http://bugs.webkit.org/show_bug.cgi?id=16479
2199           text selection does not always begin at mouse down point
2200           Reset the m_dragSrc object on mouse down on all platforms.
2201
2202         Test: fast/text/reset-drag-on-mouse-down.html
2203
2204         * page/EventHandler.cpp:
2205         (WebCore::EventHandler::handleMousePressEvent):
2206         * page/mac/EventHandlerMac.mm:
2207         (WebCore::EventHandler::mouseDown):
2208
2209 2007-12-19  Geoffrey Garen  <ggaren@apple.com>
2210
2211         Reviewed by Oliver Hunt.
2212
2213         Build support:
2214         * ForwardingHeaders/kjs/SymbolTable.h: Added.
2215         * ForwardingHeaders/wtf/VectorTraits.h: Added.
2216
2217         * bindings/js/JSDOMWindowCustom.cpp:
2218         (WebCore::JSDOMWindow::customGetOwnPropertySlot): Replaced use of
2219         getDirectLocation with getOwnPropertySlot. getDirectLocation is no
2220         longer valid, since global declarations are not stored in the property
2221         map.
2222
2223         (WebCore::JSDOMWindow::customPut): Replaced use of JSObject::put with
2224         JSGlobalObject::put. JSObject::put is no longer valid, since global
2225         declarations are not stored in the property map.
2226
2227         * bindings/js/kjs_window.cpp: Replaced JSObject:: calls with Base::
2228         calls, since JSObject is not our base class. This was always a bug, but
2229         the bug is even more apparent after some of my changes.
2230
2231         (KJS::Window::clear): Removed call to clearProperties because
2232         JSGlobalObject::reset takes care of that now.
2233
2234         * history/CachedPage.cpp:
2235         * history/CachedPage.h: Added support for saving a symbol table and
2236         localStorage to the page cache, and restoring it.
2237
2238 2007-12-19  Dan Bernstein  <mitz@apple.com>
2239
2240         Reviewed by Darin Adler and Dave Hyatt.
2241
2242         - Substitute the user's preferred standard font for an unknown primary
2243           font before falling back on the platform's last resort font
2244
2245         Cannot be tested in DumpRenderTree because it sets the standard font to
2246         Times, which is also the hard-coded last resort font on Mac.
2247
2248         * css/CSSFontSelector.cpp:
2249         (WebCore::CSSFontSelector::getFontData): Changed the early bail out
2250         condition to allow getting generic font families from settings even if
2251         there are not @font-face rules. Fixed a typo that mapped fantasy to
2252         cursive. Added a mapping from -webkit-standard to the standard family.
2253         * css/CSSStyleSelector.cpp:
2254         (WebCore::CSSStyleSelector::CSSStyleSelector): Changed to always create
2255         a font selector.
2256         (WebCore::CSSRuleSet::addRulesFromSheet):
2257         (WebCore::CSSStyleSelector::applyProperty): Changed to always use the
2258         font selector.
2259         * css/CSSStyleSelector.h:
2260         (WebCore::CSSStyleSelector::fontSelector):
2261         * platform/graphics/FontCache.cpp:
2262         (WebCore::FontCache::getFontData): Try the user's preferred standard
2263         font before the platform's last resort font.
2264
2265 2007-12-19  Sven Herzberg  <sven@imendio.com>
2266
2267         Reviewed by Alp Toker.
2268
2269         Scaled font destruction takes place in FontData::platformDestroy(). No
2270         need to do it in FontPlatformData::~FontPlatformData().
2271
2272         Destroying platform data in platformDestroy() is a convention we
2273         borrow from the Mac and Win ports.
2274
2275         * platform/graphics/gtk/FontPlatformDataGtk.cpp:
2276
2277 2007-12-19  Alice Liu  <alice.liu@apple.com>
2278
2279         build fix (Windows)
2280
2281         Changed uint to unsigned int.  uint caused Windows build breakage
2282
2283         * page/Page.cpp:
2284         (WebCore::Page::markAllMatchesForText):
2285         * page/Page.h:
2286
2287 2007-12-19  Christian Dywan  <christian@twotoasts.de> 
2288
2289         Reviewed by Alp Toker.
2290
2291         http://bugs.webkit.org/show_bug.cgi?id=16222
2292         [GTK] Implement inline search and highlighting of matching strings.
2293
2294         Implement search and highlighting logic directly in WebCore.
2295
2296         * page/Page.cpp:
2297         (WebCore::incrementFrame):
2298         (WebCore::Page::findString):
2299         (WebCore::Page::markAllMatchesForText):
2300         (WebCore::Page::unmarkAllTextMatches):
2301         * page/Page.h:
2302
2303 2007-12-19  Geoffrey Garen  <ggaren@apple.com>
2304
2305         Reviewed by Sam Weinig, Dan Bernstein.
2306
2307         Tiger build fix: restored some graphics code still needed on Tiger.
2308
2309         * platform/graphics/GraphicsTypes.h:
2310         * platform/graphics/cg/GraphicsContextCG.cpp:
2311         * platform/graphics/mac/GraphicsContextMac.mm:
2312         (WebCore::GraphicsContext::setCompositeOperation):
2313
2314 2007-12-19  Alp Toker  <alp@atoker.com>
2315
2316         Build fix for Pango < 1.18.0 breakage introduced in r28864. Use Fc and
2317         the Pango backend API in these cases.
2318
2319         * platform/graphics/gtk/FontPlatformDataGtk.cpp:
2320         (WebCore::FontPlatformData::FontPlatformData):
2321         (WebCore::FontPlatformData::~FontPlatformData):
2322
2323 2007-12-19  Alice Liu  <alice.liu@apple.com>
2324
2325         Reviewed by Darin.
2326
2327         Fixed <rdar://problem/5592485> Safari crashed trying to get a motorcycle insurance quote
2328         on Geico.com WebCore::Document::inPageCache()
2329
2330         Calling Node::willRemove on the focusedNode would immediately tell the document to remove
2331         the focused node, and trigger JS events.  This means that the document is mutated while
2332         the engine is trying to tell all child nodes that it's about to removed.  To avoid
2333         crashing, we need to hold off on mutating the document until node traversal is finished.
2334
2335         * dom/ContainerNode.cpp:
2336         (WebCore::ContainerNode::removeChild):
2337         (WebCore::ContainerNode::removeChildren):
2338         * dom/Node.cpp:
2339         * dom/Node.h:
2340         (WebCore::Node::willRemove):
2341         * loader/FrameLoader.cpp:
2342         (WebCore::FrameLoader::clear):
2343
2344 2007-12-19  Andre Boule  <aboule@apple.com>
2345
2346         Reviewed by Dan Bernstein.
2347
2348         Test: fast/canvas/canvas-composite.html
2349
2350         Fix for:
2351         <rdar://problem/5640059> GraphicsContext::setCompositeOperation should use CGContextSetBlendMode
2352
2353         This fix makes setCompositeOperation consistent across all platforms that use CG.
2354
2355         The following compositing modes don't pass however that is covered by another bug:
2356         source-in
2357         source-out
2358         destination-in
2359         destination-atop
2360         copy
2361         <rdar://problem/5651783> Some canvas tag compositing modes don't render correctly
2362
2363         * platform/graphics/GraphicsTypes.h:
2364         * platform/graphics/cg/GraphicsContextCG.cpp:
2365         (WebCore::GraphicsContext::setCompositeOperation):
2366         * platform/graphics/mac/GraphicsContextMac.mm:
2367         * platform/win/GraphicsContextWin.cpp:
2368
2369 2007-12-19  Dan Bernstein  <mitz@apple.com>
2370
2371         Reviewed by Dave Hyatt.
2372
2373         - fix <rdar://problem/5650045> REGRESSION: major layout problems in svn r28754 WebKit on Vox.com page
2374
2375         Test: fast/dynamic/subtree-boundary-percent-height.html
2376
2377         * rendering/RenderObject.cpp:
2378         (WebCore::objectIsRelayoutBoundary): Do not allow overflows with
2379         percent heights because sometimes they compute to 'auto'.
2380
2381 2007-12-19  Sam Weinig  <sam@webkit.org>
2382
2383         Reviewed by Maciej.
2384
2385         http://bugs.webkit.org/show_bug.cgi?id=16511
2386         Speed up ClassNodeList and NamedNodeList by using the caching mechanism employed by ChildNodeList.
2387         - This give a ~2.15x speedup on the native test @ http://ejohn.org/apps/classname/
2388
2389         * dom/ChildNodeList.cpp: Use the caching NodeList constructor to turn on caching.
2390         (WebCore::ChildNodeList::ChildNodeList):
2391         * dom/ClassNodeList.cpp:
2392         (WebCore::ClassNodeList::ClassNodeList):
2393         * dom/ClassNodeList.h:
2394
2395         Move getElementsByName and getElementsByClassName to Node so they
2396         can use easily employ the caching already used by ChildNodeLists.  In the case of 
2397         getElementsByClassName, this reduces code duplication in Element as well
2398         * dom/Document.cpp:
2399         * dom/Document.h:
2400
2401         Move getElementsByClassName to Node.
2402         * dom/Element.cpp:
2403         * dom/Element.h:
2404
2405         * dom/NameNodeList.cpp: Use the caching NodeList constructor to turn on caching.
2406         (WebCore::NameNodeList::NameNodeList):
2407         (WebCore::NameNodeList::item):
2408         * dom/NameNodeList.h:
2409
2410         Add maps of caches for ClassNodeLists and NameNodeList to NodeListsNodeData.
2411         * dom/Node.cpp:
2412         (WebCore::TagNodeList::TagNodeList):
2413         (WebCore::Node::Node):
2414         (WebCore::Node::~Node):
2415         (WebCore::Node::childNodes):
2416         (WebCore::Node::registerNodeList):
2417         (WebCore::Node::getElementsByName):
2418         (WebCore::Node::getElementsByClassName):
2419         * dom/Node.h: Make m_nodeLists an OwnPtr.  Moved getElementsByName and getElementsByClassName here
2420
2421         Allow subclasses to choose whether they want to receive the notifications using a new bit.
2422         * dom/NodeList.cpp:
2423         (WebCore::NodeList::NodeList):
2424         * dom/NodeList.h:
2425         (WebCore::NodeList::needsNotifications):
2426
2427 2007-12-19  Dave Hyatt  <hyatt@apple.com>
2428
2429         Add support for GDI text rendering to WebKit.
2430       
2431         Reviewed by mitz
2432         
2433         * css/CSSStyleSelector.cpp:
2434         (WebCore::CSSStyleSelector::applyProperty):
2435         * dom/Document.cpp:
2436         (WebCore::Document::recalcStyle):
2437         * page/Settings.cpp:
2438         (WebCore::Settings::setFontRenderingMode):
2439         (WebCore::Settings::fontRenderingMode):
2440         * page/Settings.h:
2441         * platform/graphics/Font.h:
2442         (WebCore::Font::renderingMode):
2443         * platform/graphics/FontCache.cpp:
2444         (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
2445         (WebCore::FontPlatformDataCacheKey::operator==):
2446         (WebCore::computeHash):
2447         (WebCore::FontCache::getCachedFontPlatformData):
2448         * platform/graphics/FontDescription.h:
2449         (WebCore::):
2450         (WebCore::FontDescription::FontDescription):
2451         (WebCore::FontDescription::renderingMode):
2452         (WebCore::FontDescription::setRenderingMode):
2453         (WebCore::FontDescription::operator==):
2454         * platform/graphics/GraphicsContext.h:
2455         * platform/graphics/win/FontCacheWin.cpp:
2456         (WebCore::FontCache::fontExists):
2457         (WebCore::FontCache::createFontPlatformData):
2458         * platform/graphics/win/FontDataWin.cpp:
2459         (WebCore::FontData::platformInit):
2460         (WebCore::FontData::smallCapsFontData):
2461         (WebCore::FontData::containsCharacters):
2462         (WebCore::FontData::determinePitch):
2463         (WebCore::FontData::platformWidthForGlyph):
2464         * platform/graphics/win/FontPlatformData.h:
2465         (WebCore::FontPlatformData::FontPlatformData):
2466         (WebCore::FontPlatformData::useGDI):
2467         (WebCore::FontPlatformData::operator==):
2468         * platform/graphics/win/FontPlatformDataWin.cpp:
2469         (WebCore::FontPlatformData::FontPlatformData):
2470         * platform/graphics/win/FontWin.cpp:
2471         (WebCore::Font::drawGlyphs):
2472         * platform/graphics/win/IconWin.cpp:
2473         (WebCore::Icon::paint):
2474         * platform/win/GraphicsContextWin.cpp:
2475         (WebCore::GraphicsContext::getWindowsContext):
2476         (WebCore::GraphicsContext::releaseWindowsContext):
2477         * platform/win/UniscribeController.cpp:
2478         (WebCore::UniscribeController::shapeAndPlaceItem):
2479         * platform/win/UniscribeController.h:
2480         * plugins/win/PluginViewWin.cpp:
2481         (WebCore::PluginViewWin::paint):
2482
2483 2007-12-19  Sven Herzberg  <sven@imendio.com>
2484
2485         Reviewed by Alp Toker.
2486
2487         Replace the fontconfig/freetype based font management with a pango
2488         based one. Fixes:
2489         http://bugs.webkit.org/show_bug.cgi?id=15229
2490
2491         * platform/gtk/FontDataGtk.cpp (FontData::platformDestroy()): updated
2492         the platform specific destroy code
2493         (FontData::containsCharacters()): implemented font coverage with pango
2494         * platform/gtk/FontPlatformData.h: replaced fontconfig specific
2495         members with pango-specific ones
2496         * platform/gtk/FontPlatformDataGtk.cpp: added static members for the
2497         FontPlatformData class
2498         (FontPlatformData::FontPlatformData()): implemented the font-matching
2499         with a PangoFontDescription instead of an FcPattern; initialize the
2500         scaled font by using the API for PangoCairoFont
2501         (FontPlatformData::init()): initialize the PangoFontMap and set up a
2502         hash table to translate the font family name into a font family
2503         (FontPlatformData::isFixedPitch()): implemented by querying the
2504         PangoFontFamily
2505         (FontPlatformData::operator==): compare the FontPlatformData by
2506         comparing the font pointers or the described fonts
2507         * platform/gtk/GlyphPageTreeNodeGtk.cpp (pango_font_get_glyph()):
2508         added a function to query a glyph from a PangoFont
2509         (GlyphPage::fill()): implemented the fill function with Pango instead
2510         of fontconfig/freetype
2511
2512 2007-12-19  Alp Toker  <alp@atoker.com>
2513
2514         Reviewed by Holger Freyther.
2515
2516         Improve graphics operator approximations
2517         
2518         These changes match Cairo's own CG approximations.
2519
2520         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2521         (WebCore::toCairoOperator):
2522
2523 2007-12-19  Alp Toker  <alp@atoker.com>
2524
2525         Reviewed by Holger Freyther.
2526
2527         Check the bounding box before doing a full hit test
2528
2529         * platform/graphics/cairo/PathCairo.cpp:
2530         (WebCore::Path::contains):
2531
2532 2007-12-18  Sam Weinig  <sam@webkit.org>
2533
2534         Reviewed by Geoff.
2535
2536         Fix for <rdar://problem/5646478>
2537         REGRESSION: fast/events/event-view-toString fails on Leopard
2538
2539         This fixes an issue where we were incorrectly setting the lastInPrototypeChain
2540         for the JSDOMWindow (the global object) before a call to setPrototype overwrote
2541         it. This fixes it by passing the prototype up the constructor chain so that it
2542         is set before any calls can be made.
2543
2544         * bindings/js/kjs_window.cpp:
2545         (KJS::Window::Window):
2546         * bindings/js/kjs_window.h:
2547         * bindings/scripts/CodeGeneratorJS.pm:
2548
2549 2007-12-18  Beth Dakin  <bdakin@apple.com>
2550
2551         Reviewed by Oliver.
2552
2553         Fix for <rdar://problem/5616982> SVGs with width and height 100% 
2554         fail to render when used as <img> or CSS image (16167)
2555
2556         This final part of the work fixes the <img> tag.
2557
2558         This is the real fix. 
2559         * rendering/RenderImage.cpp:
2560         (WebCore::RenderImage::calcReplacedWidth): Set the container size 
2561         on the image. Setting the container size only actually sticks if 
2562         the values are non-zero, so if the container size really was set, 
2563         use the imageSize that is calculated using the container size. If 
2564         it did not stick but the image does have relative width (meaning 
2565         that the container size is 0), set the width to 0 by hand. We want 
2566         to avoid setting the width before we have a container size or we 
2567         will end up incorrectly using the default size of 300x150.
2568         (WebCore::RenderImage::calcReplacedHeight): Same as above, but for 
2569         height.
2570
2571         A few more pieces of information have to be exposed through cached 
2572         image to make this happen.
2573         * loader/CachedImage.cpp:
2574         (WebCore::CachedImage::usesImageContainerSize): As mentioned above, 
2575         when setContainerSize() is called, the container size is only 
2576         actually set if the values are non-zero. This call tells you if it 
2577         was set.
2578         (WebCore::CachedImage::imageHasRelativeWidth):
2579         (WebCore::CachedImage::imageHasRelativeHeight):
2580         * loader/CachedImage.h:
2581         * platform/graphics/Image.h:
2582         (WebCore::Image::usesContainerSize):
2583         * svg/graphics/SVGImage.cpp:
2584         (WebCore::SVGImage::usesContainerSize):
2585         * svg/graphics/SVGImage.h:
2586
2587 2007-12-18  Mark Rowe  <mrowe@apple.com>
2588
2589         Rubber-stamped by Maciej Stachowiak.
2590
2591         Remove outdated and non-functioning project files for the Apollo port.
2592
2593         * WebCore.apolloproj: Removed.
2594
2595 2007-12-18  Steve Falkenburg  <sfalken@apple.com>
2596
2597         <rdar://problem/5649911> REGRESSION (304-306A9): Typing 'p' in popup menu for type-to-select brings up Safari Help
2598         
2599         Need to translate the char back into a key code for posting our WM_KEYDOWN.
2600         
2601         Reviewed by Ada.
2602
2603         * platform/win/PopupMenuWin.cpp:
2604         (WebCore::PopupWndProc):
2605
2606 2007-12-18  Steve Falkenburg  <sfalken@apple.com>
2607
2608         <rdar://problem/5651534> REGRESSION(r28764-r28765): GDI leak drawing text when no appropriate font is available
2609         
2610         Our captured metafile from Uniscribe may contain multiple calls to CreateFontIndirect.
2611         Only create a font with the last one.
2612         
2613         Reviewed by Mitz, Darin.
2614
2615         * platform/graphics/win/FontCacheWin.cpp:
2616         (WebCore::metaFileEnumProc):
2617         (WebCore::FontCache::getFontDataForCharacters):
2618
2619 2007-12-17  Brent Fulgham  <bfulgham@gmail.com>
2620
2621         Reviewed by Darin.
2622
2623         http://bugs.webkit.org/show_bug.cgi?id=16464
2624         Modify WebCore to use win32 thread primitives
2625
2626         Updates to support native windows threading primitives
2627         rather than pthreads emulation library.
2628
2629         * WebCore.vcproj/WebCore.vcproj:
2630         * config.h:
2631         * platform/Threading.h:
2632         * platform/win/MutexWin.cpp: Added.
2633         (WebCore::Mutex::Mutex):
2634         (WebCore::Mutex::~Mutex):
2635         (WebCore::Mutex::lock):
2636         (WebCore::Mutex::tryLock):
2637         (WebCore::Mutex::unlock):
2638         * platform/win/ThreadConditionWin.cpp: Added.
2639         (WebCore::ThreadCondition::ThreadCondition):
2640         (WebCore::ThreadCondition::~ThreadCondition):
2641         (WebCore::ThreadCondition::wait):
2642         (WebCore::ThreadCondition::signal):
2643         (WebCore::ThreadCondition::broadcast):
2644         * platform/win/ThreadingWin.cpp:
2645         (WebCore::threadMapMutex):
2646         (WebCore::threadMap):
2647         (WebCore::storeThreadHandleByIdentifier):
2648         (WebCore::identifierByThreadHandle):
2649         (WebCore::threadHandleForIdentifier):
2650         (WebCore::clearThreadHandleForIdentifier):
2651         (WebCore::createThread):
2652         (WebCore::waitForThreadCompletion):
2653         (WebCore::detachThread):
2654         (WebCore::currentThread):
2655
2656 2007-12-18  Rodney Dawes  <dobey@wayofthemonkey.com>
2657
2658         Reviewed by Darin Adler.
2659
2660         Handle EINTR when set by select() and try the select() again
2661         http://bugs.webkit.org/show_bug.cgi?id=16071
2662
2663         * platform/network/curl/ResourceHandleManager.cpp:
2664         (ResourceHandleManager::downloadTimerCallback):
2665
2666 2007-12-18  Dan Bernstein  <mitz@apple.com>
2667
2668         Reviewed by Dave Hyatt.
2669
2670         - avoid the simplified Chinese font linking code for characters that are
2671           not in any Windows code page
2672
2673         * platform/graphics/win/FontCacheWin.cpp:
2674         (WebCore::FontCache::getFontDataForCharacters):
2675
2676 2007-12-18  Brady Eidson <beidson@apple.com>
2677
2678         Reviewed by Adele
2679
2680         <rdar://problem/5525770> REGRESSION: HTTP Auth protected favicon request results in a password sheet
2681
2682         Some http-auth protected sites have the main resource(s) unprotected, but many subresources are
2683         protected by authentication.  Occasionally one can view the main page of a site but the favicon
2684         is behind the iron curtain - in these cases, we should *not* prompt for a username and password
2685         solely for the favicon.
2686
2687         * loader/ResourceLoader.h: Make didReceiveAuthenticationChallenge virtual
2688
2689         * loader/SubresourceLoader.cpp:
2690         (WebCore::SubresourceLoader::didReceiveAuthenticationChallenge): Now that this method
2691           is virtual from ResourceLoader, SubresourceLoader can override.  First call to the 
2692           SubresourceLoaderClient.  If they cancel the resource load, return early. Otherwise, let
2693           ResourceLoader work its magic (resulting in the auth sheet coming down)
2694         * loader/SubresourceLoader.h:
2695
2696         * loader/SubresourceLoaderClient.h:
2697         (WebCore::SubresourceLoaderClient::didReceiveAuthenticationChallenge):
2698
2699         * loader/icon/IconLoader.cpp:
2700         (WebCore::IconLoader::didReceiveAuthenticationChallenge): Cancel the resource load, since we should
2701           never prompt the user for credentials just for a favicon.
2702         * loader/icon/IconLoader.h:
2703
2704 2007-12-18  John Sullivan  <sullivan@apple.com>
2705
2706         Reviewed by Brady
2707         
2708         - fixed <rdar://problem/5652380> Initial prompt shows "" for databases with no user-visible name
2709
2710         * storage/DatabaseTracker.cpp:
2711         (WebCore::DatabaseTracker::canEstablishDatabase):
2712         pass "name" instead of "displayName" if there's no displayName
2713
2714 2007-12-17  Dan Bernstein  <mitz@apple.com>
2715
2716         Reviewed by Maciej Stachowiak.
2717
2718         - restore ButtonFace and ThreeDFace to their previous values for non-Mac
2719           platforms. The Mac port also uses the same values for now instead
2720           of NSColor-based ones.
2721
2722         * rendering/RenderTheme.cpp:
2723         (WebCore::RenderTheme::systemColor):
2724
2725 2007-12-17  Rodney Dawes  <dobey@wayofthemonkey.com>
2726
2727         Reviewed by Maciej Stachowiak.
2728
2729         Define WTF_USE_NPOBJECT and WTF_USE_JAVASCRIPTCORE_BINDINGS for GTK+
2730         Add required Frame::createScriptInstanceForWidget to FrameGtk
2731
2732         * config.h:
2733         * page/gtk/FrameGtk.cpp (Frame::createScriptInstanceForWidget):
2734
2735 2007-12-17  Alice Liu  <alice.liu@apple.com>
2736
2737         Reviewed by Adam.
2738
2739         Fixed <rdar://5566435> window with no scrollbars can be scrolled
2740
2741         * platform/win/ScrollViewWin.cpp:
2742         (WebCore::ScrollView::maximumScroll):
2743         corrected maximumScroll() to account for scrolling not allowed.
2744         (WebCore::ScrollView::wheelEvent):
2745
2746 2007-12-14  Juan A. Suarez Romero  <jasuarez@igalia.com>
2747
2748         Reviewed by Alp Toker.
2749
2750         http://bugs.webkit.org/show_bug.cgi?id=16042
2751         [GTK] Eliminate webkit_init()
2752
2753         Move webkit initialization to WebView class init.
2754
2755         * WebCore.pro:
2756
2757 2007-12-17  Jon Honeycutt  <jhoneycutt@apple.com>
2758
2759         Reviewed by Darin.
2760
2761         <rdar://problem/5651291> REGRESSION: Flash content doesn't display
2762         (www.adobe.com)
2763
2764         We were passing NPEvent** instead of NPEvent* to NPP_HandleEvent.
2765
2766         * plugins/win/PluginViewWin.cpp:
2767         (WebCore::PluginViewWin::dispatchNPEvent): Changed to take NPEvent&, not
2768         NPEvent*
2769         (WebCore::PluginViewWin::paint): Pass NPEvent, not NPEvent*
2770         (WebCore::PluginViewWin::handleKeyboardEvent): same
2771         (WebCore::PluginViewWin::handleMouseEvent): same
2772         * plugins/win/PluginViewWin.h:
2773
2774 2007-12-17  Alexey Proskuryakov  <ap@webkit.org>
2775
2776         Reviewed by Darin.
2777
2778         Live to the promise of never making AppKit special character codes visible via DOM.
2779
2780         Test: fast/events/arrow-keys-on-body.html
2781
2782         * page/EventHandler.cpp:
2783         (WebCore::EventHandler::keyEvent): Check for empty keypress characters after disambiguation,
2784         to let quirks-aware code strip special charactrers.
2785         * platform/mac/KeyEventMac.mm:
2786         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): If not in keyboard event quirks
2787         mode, remove the text if it's a special character.
2788
2789 2007-12-17  Mark Rowe  <mrowe@apple.com>
2790
2791         Reviewed by Darin Adler.
2792
2793         Fix incorrect array size and incorrect array index in convertNSColorToColor.
2794
2795         * rendering/RenderThemeMac.mm:
2796         (WebCore::convertNSColorToColor):
2797
2798 2007-12-17  Darin Adler  <darin@apple.com>
2799
2800         Reviewed by Mark Rowe.
2801
2802         - fix http://bugs.webkit.org/show_bug.cgi?id=16468
2803           REGRESSION(r28781): Crash running storage/transaction_callback_exception_crash.html
2804
2805         * storage/DatabaseThread.cpp:
2806         (WebCore::DatabaseThread::dispatchNextTaskIdentifier): Use a RefPtr for the database
2807         because there's no guarantee it won't lose its last reference otherwise.
2808
2809 2007-12-17  Dan Bernstein  <mitz@apple.com>
2810
2811         Reviewed by Maciej Stachowiak.
2812
2813         - fix <rdar://problem/5333260> Some Chinese characters in Text Encoding menu are bold, others are not
2814           and <rdar://problem/5280188> Chinese text looks worse on Safari for Windows cf. Safari for Mac
2815
2816         * platform/graphics/win/FontCacheWin.cpp:
2817         (WebCore::FontCache::getFontDataForCharacters): To ensure that font
2818         linking gives consistent results for characters that are exclusive to
2819         the simplified Chinese code page and characters that belong to that
2820         code page and other code pages, always ask to map to simplified Chinese
2821         alone first.
2822
2823 2007-12-17  Christian Dywan  <christian@twotoasts.de>
2824
2825         Reviewed by Alp Toker.
2826
2827         http://bugs.webkit.org/show_bug.cgi?id=16378
2828         Implement Icon for Gtk
2829
2830         Icon provides a GdkPixbuf containing a themed icon.
2831         The icon theme is probed for an icon name according to the
2832         Icon Naming Specification or conventional Gnome icon names respectively.
2833
2834         See http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
2835
2836         * platform/graphics/Icon.h:
2837         * platform/graphics/gtk/IconGtk.cpp:
2838         (WebCore::Icon::~Icon):
2839         (WebCore::lookupIconName):
2840         (WebCore::Icon::newIconForFile):
2841         (WebCore::Icon::paint):
2842
2843 2007-12-16  Sam Weinig  <sam@webkit.org>
2844
2845         Reviewed by Mitz.
2846
2847         Fix for http://bugs.webkit.org/show_bug.cgi?id=16466
2848         Move the JS Location object to its own file
2849
2850         - Move Location into its own file and rename it JSLocation.
2851
2852         * DerivedSources.make:
2853         * WebCore.pro:
2854         * WebCore.vcproj/WebCore.vcproj:
2855         * WebCore.xcodeproj/project.pbxproj:
2856         * WebCoreSources.bkl:
2857         * bindings/js/JSDocumentCustom.cpp:
2858         * bindings/js/JSLocation.cpp: Copied from WebCore/bindings/js/kjs_window.cpp.
2859         (WebCore::):
2860         (WebCore::JSLocation::JSLocation):
2861         (WebCore::JSLocation::getValueProperty):
2862         (WebCore::JSLocation::getOwnPropertySlot):
2863         (WebCore::JSLocation::put):
2864         (WebCore::JSLocationProtoFuncReplace::callAsFunction):
2865         (WebCore::JSLocationProtoFuncReload::callAsFunction):
2866         (WebCore::JSLocationProtoFuncAssign::callAsFunction):
2867         (WebCore::JSLocationProtoFuncToString::callAsFunction):
2868         * bindings/js/JSLocation.h: Copied from WebCore/bindings/js/kjs_window.h.
2869         (WebCore::JSLocation::):
2870         (WebCore::JSLocation::frame):
2871         (WebCore::JSLocation::classInfo):
2872         * bindings/js/kjs_window.cpp:
2873         (KJS::Window::location):
2874         * bindings/js/kjs_window.h:
2875         * history/CachedPage.cpp:
2876
2877 2007-12-16  Dan Bernstein  <mitz@apple.com>
2878
2879         Reviewed by Sam Weinig.
2880
2881         - make 'cursor: copy' and 'cursor: none' work.
2882
2883         Already covered by manual-tests/cursor.html
2884
2885         * rendering/RenderStyle.h: Increase the _cursor_style field to 6 bits,
2886         needed for the 33rd and 34th cursor values.
2887
2888 2007-12-16  Mark Rowe  <mrowe@apple.com>
2889
2890         Reviewed by Maciej Stachowiak.
2891
2892         Refactor Mac plugin stream code to use the shared NetscapePlugInStreamLoader implementation.
2893
2894         * WebCore.base.exp:
2895         * WebCore.xcodeproj/project.pbxproj:
2896         * loader/NetscapePlugInStreamLoader.h:
2897         * loader/mac/NetscapePlugInStreamLoaderMac.mm: Removed.
2898         * loader/mac/WebPlugInStreamLoaderDelegate.h: Moved to WebKit.
2899
2900 2007-12-16  Sam Weinig  <sam@webkit.org>
2901
2902         Reviewed by Maciej.
2903
2904         Yet more of http://bugs.webkit.org/show_bug.cgi?id=16385
2905         Cleanup kjs_window
2906
2907         - Move ScheduledAction into its own file and put it in the WebCore namespace.
2908
2909         * WebCore.pro:
2910         * WebCore.vcproj/WebCore.vcproj:
2911         * WebCore.xcodeproj/project.pbxproj:
2912         * WebCoreSources.bkl:
2913         * bindings/js/PausedTimeouts.cpp:
2914         * bindings/js/PausedTimeouts.h:
2915         * bindings/js/ScheduledAction.cpp: Copied from bindings/js/kjs_window.cpp.
2916         (WebCore::ScheduledAction::ScheduledAction):
2917         (WebCore::ScheduledAction::execute):
2918         * bindings/js/ScheduledAction.h: Copied from bindings/js/kjs_window.h.
2919         (WebCore::ScheduledAction::ScheduledAction):
2920         * bindings/js/kjs_window.cpp:
2921         (KJS::DOMWindowTimer::DOMWindowTimer):
2922         (KJS::DOMWindowTimer::action):
2923         (KJS::DOMWindowTimer::takeAction):
2924         (KJS::Window::installTimeout):
2925         (KJS::Window::timerFired):
2926         * bindings/js/kjs_window.h:
2927
2928 2007-12-16  Alp Toker  <alp@atoker.com>
2929
2930         Reviewed by Maciej.
2931
2932         http://bugs.webkit.org/show_bug.cgi?id=16356
2933         [GTK] Integrate GStreamer video with the graphics backend
2934
2935         Integrate the GStreamer media backend with the Cairo graphics backend.
2936         There are still some issues: Data is copied more often than necessary,
2937         and repaint() is not called, causing transformed video not to update
2938         sometimes.
2939
2940         * WebCore.pro:
2941         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
2942         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
2943         (WebCore::MediaPlayerPrivate::~MediaPlayerPrivate):
2944         (WebCore::MediaPlayerPrivate::currentTime):
2945         (WebCore::MediaPlayerPrivate::setEndTime):
2946         (WebCore::MediaPlayerPrivate::seeking):
2947         (WebCore::MediaPlayerPrivate::naturalSize):
2948         (WebCore::MediaPlayerPrivate::setMuted):
2949         (WebCore::MediaPlayerPrivate::setRect):
2950         (WebCore::MediaPlayerPrivate::setVisible):
2951         (WebCore::MediaPlayerPrivate::repaint):
2952         (WebCore::MediaPlayerPrivate::paint):
2953         (WebCore::MediaPlayerPrivate::createGSTPlayBin):
2954         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.h:
2955         * platform/graphics/gtk/VideoSinkGStreamer.cpp: Added.
2956         (webkit_video_sink_base_init):
2957         (webkit_video_sink_init):
2958         (webkit_video_sink_idle_func):
2959         (webkit_video_sink_render):
2960         (webkit_video_sink_set_caps):
2961         (webkit_video_sink_dispose):
2962         (webkit_video_sink_finalize):
2963         (webkit_video_sink_set_property):
2964         (webkit_video_sink_get_property):
2965         (webkit_video_sink_stop):
2966         (webkit_video_sink_class_init):
2967         (webkit_video_sink_new):
2968         (webkit_video_sink_set_surface):
2969         (plugin_init):
2970         * platform/graphics/gtk/VideoSinkGStreamer.h: Added.
2971
2972 2007-12-16  Mark Rowe  <mrowe@apple.com>
2973
2974         Mac build fix.
2975
2976         * WebCore.xcodeproj/project.pbxproj: Remove NetscapePlugInStreamLoader.cpp from the WebCore target.
2977         Mac currently has its own implementation in NetscapePlugInStreamLoaderMac.mm which conflicts with the
2978         new shared implementation.
2979
2980 2007-12-16  Rodney Dawes  <dobey@wayofthemonkey.com>
2981
2982         Reviewed by Maciej Stachowiak.
2983
2984         http://bugs.webkit.org/show_bug.cgi?id=16389
2985         Bug 16389: Common Implementation of NetscapePlugInStreamLoader
2986
2987         * WebCore.vcproj/WebCore.vcproj: Remove NetscapePlugInStreamLoaderWin.cpp.
2988         * loader/NetscapePlugInStreamLoader.cpp: Copy method implementations from NetscapePlugInStreamLoaderWin.cpp.
2989         * loader/win/NetscapePlugInStreamLoaderWin.cpp: Removed.
2990
2991 2007-12-16  Grace Kloba  <klobag@gmail.com>
2992
2993         Reviewed by Darin Adler.
2994
2995         Fix http://bugs.webkit.org/show_bug.cgi?id=16433.
2996         Bug 16433: LOW_BANDWIDTH_DISPLAY build is broken
2997
2998         * dom/Document.cpp:
2999         (WebCore::Document::Document):
3000         * loader/FrameLoader.cpp:
3001         (WebCore::FrameLoader::addLowBandwidthDisplayRequest):
3002         (WebCore::FrameLoader::switchOutLowBandwidthDisplayIfReady):
3003
3004 2007-12-16  Darin Adler  <darin@apple.com>
3005
3006         Reviewed by Maciej.
3007
3008         - fix <rdar://problem/5636065> First form of SQLTransaction.executeSql() fails with TYPE_ERROR dom exception
3009
3010         Test: storage/execute-sql-args.html
3011
3012         * bindings/js/JSSQLTransactionCustom.cpp:
3013         (WebCore::JSSQLTransaction::executeSql): Added exception handling code so that once an
3014         exception happens, we won't try to do any more argument processing. Changed processing
3015         of the second argument so that we allow an undefined value or null, and simply omit the
3016         array. Changed processing of the second argument so that we don't require an actual
3017         JavaScript array. Instead, as with the JavaScript array operations themselves, we use
3018         the length property and corresponding numeric properties of the object, allowing other
3019         objects to act as arrays. Changed processing of the third and fourth arguments to
3020         allow the undefined value as well as null; we check the value of the argument rather
3021         than looking at the size of the passed-in arguments list.
3022
3023 2007-12-16  Sam Weinig  <sam@webkit.org>
3024
3025         Reviewed by Darin.
3026
3027         More of http://bugs.webkit.org/show_bug.cgi?id=16385
3028         Cleanup kjs_window
3029
3030         - Move PausedTimeouts into its own file and put it in the WebCore namespace.
3031
3032         * WebCore.pro:
3033         * WebCore.vcproj/WebCore.vcproj:
3034         * WebCore.xcodeproj/project.pbxproj:
3035         * WebCoreSources.bkl:
3036         * bindings/js/PausedTimeouts.cpp: Copied from bindings/js/kjs_window.cpp.
3037         * bindings/js/PausedTimeouts.h: Copied from bindings/js/kjs_window.h.
3038         * bindings/js/kjs_window.cpp:
3039         (KJS::Window::pauseTimeouts):
3040         * bindings/js/kjs_window.h:
3041         * history/CachedPage.cpp:
3042         * history/CachedPage.h:
3043         * page/Chrome.cpp:
3044
3045 2007-12-16  Beth Dakin  <bdakin@apple.com>
3046
3047         Reviewed by Geoff.
3048
3049         Make relative-size SVGs work in border-image.
3050
3051         * rendering/RenderBox.cpp:
3052         (WebCore::RenderBox::calculateBackgroundSize):
3053         * rendering/RenderObject.cpp:
3054         (WebCore::RenderObject::paintBorderImage):
3055
3056 2007-12-16  Darin Adler  <darin@apple.com>
3057
3058         - fix Tiger build (my fault it was broken)
3059
3060         * rendering/RenderThemeMac.mm: Define NSUInteger if on Tiger.
3061
3062 2007-12-16  Andrew Wellington  <proton@wiretapped.net>
3063
3064         Reviewed by Darin.
3065         
3066         http://bugs.webkit.org/show_bug.cgi?id=6129
3067         Incomplete implementation of CSS 2.1 system colors
3068
3069         Test: fast/css/css2-system-color.html
3070         
3071         Based on original patch by Rob Buis.
3072         
3073         System colors are retrieved from NSColor as appropriate. If the color is a pattern color
3074         (and therefore NSColor won't let us retrieve a color from it) we draw a 1x1 image of the
3075         color and sample that to get a solid color.
3076
3077         * css/CSSStyleSelector.cpp:
3078         (WebCore::):
3079         (WebCore::colorForCSSValue):
3080         * rendering/RenderTheme.cpp:
3081         (WebCore::RenderTheme::systemColor):
3082         * rendering/RenderTheme.h:
3083         * rendering/RenderThemeMac.h:
3084         * rendering/RenderThemeMac.mm:
3085         (WebCore::getSystemColor):
3086         (WebCore::RenderThemeMac::platformColorsDidChange):
3087         (WebCore::RenderThemeMac::systemColor):
3088
3089 2007-12-16  Dan Bernstein  <mitz@apple.com>
3090
3091         Reviewed by Darin Adler.
3092
3093         - fix http://bugs.webkit.org/show_bug.cgi?id=16426
3094           Divs with overflow:auto: scrollbars not correctly updated when contents change
3095
3096         Test: fast/overflow/scrollbar-position-update.html
3097
3098         * platform/mac/PlatformScrollBarMac.mm:
3099         (WebCore::PlatformScrollbar::updateThumbProportion): Update the
3100         NSScroller's value for the new proportions.
3101         * rendering/RenderLayer.cpp:
3102         (WebCore::RenderLayer::updateScrollInfoAfterLayout): Removed unnecessary
3103         repaint(). Scrollbars repaint themselves as needed.
3104
3105 2007-12-16  Alexey Proskuryakov  <ap@webkit.org>
3106
3107         Reviewed by Darin.
3108
3109         http://bugs.webkit.org/show_bug.cgi?id=14140
3110         <rdar://problem/5270958> REGRESSION: Complex system KeyBindings don't work properly
3111
3112         * dom/KeyboardEvent.h:
3113         (WebCore::KeypressCommand::KeypressCommand):
3114         (WebCore::KeyboardEvent::keypressCommands):
3115         Change stored command class to preserve complete information about commands.
3116
3117         * editing/EditorCommand.cpp: (WebCore::CommandEntry::): Mark InsertText as a text insertion
3118         command, which it is. Previously, we couldn't do it because WebKit didn't really treat insertText:
3119         as a command.
3120
3121         * page/EventHandler.cpp: (WebCore::EventHandler::keyEvent): Copy commands saved while interpreting
3122         a keydown event into keypress, to avoid losing state when running interpretKeyEvents: again.
3123
3124 2007-12-16  Alexey Proskuryakov  <ap@webkit.org>
3125
3126         Reviewed by Darin.
3127
3128         http://bugs.webkit.org/show_bug.cgi?id=16462
3129         REGRESSION: access keys broken on Windows
3130
3131         * page/EventHandler.cpp:
3132         (WebCore::EventHandler::handleAccessKey):
3133         (WebCore::EventHandler::keyEvent):
3134         * page/EventHandler.h:
3135         Make handleAccessKey a class method; rely on WebKit to call it on Windows and wxWidgets.
3136
3137 2007-12-16  Xan Lopez  <xan@gnome.org>
3138
3139         Reviewed by Alexey Proskuryakov.
3140
3141         http://bugs.webkit.org/show_bug.cgi?id=16454
3142         [GTK] Text input doesn't work consistently on PPC
3143
3144         * platform/gtk/KeyEventGtk.cpp:
3145         (WebCore::singleCharacterString):
3146
3147         UChar is 2 bytes (UTF-16), so transform accordingly from
3148         gunichar (UCS-4). Fixes keyboard input on big endian systems.
3149
3150 2007-12-15  Darin Adler  <darin@apple.com>
3151
3152         Reviewed by Mark Rowe.
3153
3154         - better build fix for the problem affecting GTK and some other platforms
3155           "this time for sure"
3156
3157         * WebCore.xcodeproj/project.pbxproj:
3158         * bindings/js/JSEventTargetBase.cpp: Move the include of the .lut.h file here.
3159         * bindings/js/JSEventTargetBase.h: Instead of including the .lut.h file in the header,
3160         which won't work, declare the tables that are in the .lut.h file in the header.
3161
3162 2007-12-12  Kevin Watters  <kevin@dotsyntax.com>
3163
3164         Reviewed by Darin Adler.
3165
3166         Fixed the Wx port's FontPlatformData for use in HashTable.
3167         - FontPlatformData(Deleted) made unequal to FontPlatformData()
3168
3169         * platform/graphics/wx/FontPlatformData
3170
3171 2007-12-15  Dan Bernstein  <mitz@apple.com>
3172
3173         Reviewed by Darin Adler.
3174
3175         - fix <rdar://problem/5636090> Text in Georgia, Armenian, Inuktitut, Cree, or Cherokee (KA, HY, IU, CR, CHR) draws as all missing glyphs
3176
3177         * platform/graphics/win/FontCacheWin.cpp:
3178         (WebCore::metaFileEnumProc): Added. Called during metafile record
3179         enumeration and extracts the font from the create font record.
3180         (WebCore::FontCache::getFontDataForCharacters): If font linking fails,
3181         let Uniscribe draw the characters and see what font it chooses.
3182
3183 2007-12-15  Darin Adler  <darin@apple.com>
3184
3185         * WebCore.pro: Roll my last change out. Was wrong and didn't fix the build.
3186
3187 2007-12-15  Darin Adler  <darin@apple.com>
3188
3189         Another try at a GTK build fix.
3190
3191         * WebCore.pro: Add JSEventTargetBase.cpp to LUT_TABLE_FILES instead of LUT_FILES.
3192
3193 2007-12-15  Sam Weinig  <sam@webkit.org>
3194
3195         Force windows to regenerate COM DOM bindings.
3196
3197         * WebCore.vcproj/build-generated-files.sh: Add license. 
3198         * bindings/scripts/CodeGeneratorCOM.pm: Use shared WK_ucfirst.
3199
3200 2007-12-15  Sam Weinig  <sam@webkit.org>
3201
3202         Fix Windows and wx builds.
3203
3204         * WebCore.vcproj/WebCore.vcproj:
3205         * WebCoreSources.bkl:
3206
3207 2007-12-15  Mark Rowe  <mrowe@apple.com>
3208
3209         Gtk build fix.  Add JSEventTargetBase.cpp to SOURCES.
3210
3211         * WebCore.pro:
3212
3213 2007-12-15  Sam Weinig  <sam@webkit.org>
3214
3215         Fix wx build.
3216
3217         * WebCoreSources.bkl:
3218
3219 2007-12-15  Nikolas Zimmermann  <zimmermann@kde.org>
3220
3221         Not reviewed. Build fix for Qt/Gtk.
3222
3223         * WebCore.pro: Include JSEventTargetBase.lut.h in generation
3224
3225 2007-12-15  Nikolas Zimmermann  <zimmermann@kde.org>
3226
3227         Reviewed by Eric.
3228
3229         Fixes: http://bugs.webkit.org/show_bug.cgi?id=16445 (Refactor EventTargetNode & JSEventTargetNode for an upcoming SVG patch)
3230
3231         Split up JSEventTargetNode in JSEventTargetNode & JSEventTargetBase - where most functionality has been moved down
3232         in the base class. Applied the same refactorization to EventTargetNode.
3233
3234         This makes it possible for the upcoming patch implementing the EventTarget interface for SVGElementInstance
3235         to share as much code as possible with the EventTargetNode classes.
3236
3237         * DerivedSources.make:
3238         * WebCore.xcodeproj/project.pbxproj:
3239         * bindings/js/JSEventTargetBase.cpp: Added.
3240         (WebCore::retrieveEventTargetAndCorrespondingNode):
3241         (WebCore::eventNameForPropertyToken):
3242         * bindings/js/JSEventTargetBase.h: Added.
3243         (WebCore::JSEventTargetProperties::):
3244         (WebCore::JSEventTargetPrototypeFunctionBase::JSEventTargetPrototypeFunctionBase):
3245         (WebCore::JSEventTargetPrototypeFunction::JSEventTargetPrototypeFunction):
3246         (WebCore::):
3247         (WebCore::::create):
3248         (WebCore::JSEventTargetBase::JSEventTargetBase):
3249         (WebCore::JSEventTargetBase::getValueProperty):
3250         (WebCore::JSEventTargetBase::putValueProperty):
3251         (WebCore::JSEventTargetBase::getOwnPropertySlot):
3252         (WebCore::JSEventTargetBase::put):
3253         (WebCore::JSEventTargetPrototype::JSEventTargetPrototype):
3254         (WebCore::JSEventTargetPrototype::self):
3255         (WebCore::JSEventTargetPrototype::getOwnPropertySlot):
3256         (WebCore::JSEventTargetPrototype::classInfo):
3257         * bindings/js/JSEventTargetNode.cpp:
3258         (WebCore::JSEventTargetNode::getOwnPropertySlot):
3259         (WebCore::JSEventTargetNode::getValueProperty):
3260         (WebCore::JSEventTargetNode::put):
3261         (WebCore::JSEventTargetNode::putValueProperty):
3262         (WebCore::JSEventTargetNode::setListener):
3263         (WebCore::toEventTargetNode):
3264         * bindings/js/JSEventTargetNode.h:
3265         (WebCore::JSEventTargetPrototypeInformation::prototypeClassName):
3266         (WebCore::JSEventTargetPrototypeInformation::prototypeIdentifier):
3267         * dom/EventTarget.cpp:
3268         (WebCore::EventTarget::addEventListener):
3269         (WebCore::EventTarget::removeEventListener):
3270         (WebCore::EventTarget::dispatchGenericEvent):
3271         (WebCore::EventTarget::removeAllEventListeners):
3272         (WebCore::EventTarget::insertedIntoDocument):
3273         (WebCore::EventTarget::removedFromDocument):
3274         (WebCore::EventTarget::handleLocalEvents):
3275         (WebCore::EventTarget::applySVGEventTargetRules):
3276         (WebCore::forbidEventDispatch):
3277         (WebCore::allowEventDispatch):
3278         (WebCore::eventDispatchForbidden):
3279         * dom/EventTarget.h:
3280         (WebCore::EventTarget::preDispatchEventHandler):
3281         (WebCore::EventTarget::postDispatchEventHandler):
3282         (WebCore::forbidEventDispatch):
3283         (WebCore::allowEventDispatch):
3284         * dom/EventTargetNode.cpp:
3285         (WebCore::EventTargetNode::~EventTargetNode):
3286         (WebCore::EventTargetNode::insertedIntoDocument):
3287         (WebCore::EventTargetNode::removedFromDocument):
3288         (WebCore::EventTargetNode::addEventListener):
3289         (WebCore::EventTargetNode::removeEventListener):
3290         (WebCore::EventTargetNode::removeAllEventListeners):
3291         (WebCore::EventTargetNode::handleLocalEvents):
3292         (WebCore::EventTargetNode::dispatchEvent):
3293         (WebCore::EventTargetNode::dispatchWindowEvent):
3294         * dom/EventTargetNode.h:
3295         (WebCore::EventTargetNode::localEventListeners):
3296         * svg/SVGElement.cpp:
3297         (WebCore::SVGElement::sendSVGLoadEventIfPossible):
3298         (WebCore::SVGElement::dispatchEvent):
3299
3300 2007-12-15  Eric Seidel  <eric@webkit.org>
3301
3302         Reviewed by Oliver.
3303         
3304         Width of SVG elements not applied to container elements
3305         http://bugs.webkit.org/show_bug.cgi?id=16305
3306         Added calcPrefWidths for RenderSVGRoot (copied from RenderReplaced)
3307         This is caused by poor factoring in the render tree.  RenderContainer probably should be a template.
3308
3309         svg/css/css-box-min-width.html
3310
3311         * rendering/RenderSVGRoot.cpp:
3312         (WebCore::RenderSVGRoot::calcPrefWidths): Added.
3313         * rendering/RenderSVGRoot.h:
3314         * css/SVGCSSStyleSelector::applySVGProperty: fixed ASSERT in debug builds
3315
3316 2007-12-15  David Kilzer  <ddkilzer@apple.com>
3317
3318         Fix comment after isSafeScript() was renamed to allowsAccessFrom().
3319
3320         * bindings/js/kjs_window.cpp:
3321         (KJS::createWindow):
3322
3323 2007-12-15  Alp Toker  <alp@atoker.com>
3324
3325         Reviewed by Mark Rowe.
3326
3327         http://bugs.webkit.org/show_bug.cgi?id=16449
3328         cairo_arc() functions hang or crash when passed inf as radius or start/end angle
3329
3330         Add checks. This matches a similar workaround for a CG bug in the CG
3331         graphics backend: <rdar://problem/5189233>
3332
3333         Fixes:
3334           fast/canvas/arc-crash.html
3335           fast/canvas/canvas-with-incorrect-args.html
3336
3337         * platform/graphics/cairo/PathCairo.cpp:
3338         (WebCore::Path::addArc):
3339
3340 2007-12-15  Alexey Proskuryakov  <ap@webkit.org>
3341
3342         Reviewed by Darin.
3343
3344         http://bugs.webkit.org/show_bug.cgi?id=16078
3345         Google Maps zooming via the scroll wheel (almost) always zooms IN only.
3346
3347         * dom/WheelEvent.cpp: (WebCore::WheelEvent::WheelEvent):
3348         Ensure that delta is never rounded down to zero - we are getting values less than 1 from 
3349         many mice on OS X, and Google Maps code assumes scrolling up if event.wheelDelta is zero.
3350
3351 2007-12-14  Dan Bernstein  <mitz@apple.com>
3352
3353         - Windows build fix
3354
3355         * WebCore.vcproj/WebCore.vcproj:
3356
3357 2007-12-14  Alp Toker  <alp@atoker.com>
3358
3359         GTK+/Qt build fix. Track added files in r28722.
3360
3361         * WebCore.pro:
3362
3363 2007-12-14  Sam Weinig  <sam@webkit.org>
3364
3365         Reviewed by Geoff.
3366
3367         Speed up getElementByClassName.
3368         - This makes getElementByClassName 33% faster on the stress test
3369           linked to at http://bugs.webkit.org/show_bug.cgi?id=15760.
3370
3371         * platform/text/StringImpl.cpp:
3372         (WebCore::StringImpl::foldCase): Optimize the case when all the characters are ASCII.
3373
3374 2007-12-14  Alp Toker  <alp@atoker.com>
3375
3376         Reviewed by Maciej.
3377
3378         http://bugs.webkit.org/show_bug.cgi?id=16432
3379         [GTK] Update license headers
3380
3381         Consent has been given by the authors of these files to change license
3382         to the LGPL as outlined in the bug report.
3383
3384         * platform/gtk/ClipboardGtk.cpp:
3385         * platform/gtk/ContextMenuGtk.cpp:
3386         * platform/gtk/ContextMenuItemGtk.cpp:
3387         * platform/gtk/CookieJarGtk.cpp:
3388         * platform/gtk/CursorGtk.cpp:
3389         * platform/gtk/DragDataGtk.cpp:
3390         * platform/gtk/DragImageGtk.cpp:
3391         * platform/gtk/PasteboardGtk.cpp:
3392         * platform/gtk/PlatformScreenGtk.cpp:
3393         * platform/gtk/PlatformScrollBarGtk.cpp:
3394         * platform/gtk/SearchPopupMenuGtk.cpp:
3395         * platform/gtk/WidgetGtk.cpp:
3396
3397 2007-12-14  Darin Adler  <darin@apple.com>
3398
3399         Reviewed by Adele.
3400
3401         - fix http://bugs.webkit.org/show_bug.cgi?id=16442
3402           navigation policy delegate gets called twice for each load
3403
3404         * loader/MainResourceLoader.cpp:
3405         (WebCore::MainResourceLoader::willSendRequest): Removed call to checkNavigationPolicy.
3406         That's handled by FrameLoader.
3407
3408         * loader/MainResourceLoader.h: Removed callContinueAfterNavigationPolicy
3409         and continueAfterNavigationPolicy.
3410
3411 2007-12-14  Anders Carlsson  <andersca@apple.com>
3412
3413         Reviewed by Brady.
3414
3415         Make document.open count as committing a document load, so that -[WebFrame dataSource:] won't
3416         return nil in that case.
3417         
3418         * loader/FrameLoader.cpp:
3419         (WebCore::FrameLoader::didExplicitOpen):
3420
3421 2007-12-14  David Smith  <catfish.man@gmail.com>
3422
3423         Reviewed by Mitz.
3424
3425         - fix http://bugs.webkit.org/show_bug.cgi?id=14955
3426           Implement getElementsByClassName.
3427
3428         This patch also renames AtomicStringList to ClassNames to better reflect its actual use,
3429         and takes advantage of admitting that it's class-specific to encapsulate class attribute 
3430         parsing so it can be shared.  It also changes the class to use a Vector, rather than a linked
3431         list to store the class names.
3432
3433         Tests: fast/dom/getElementsByClassName/001.html
3434                fast/dom/getElementsByClassName/002.html
3435                fast/dom/getElementsByClassName/003.html
3436                fast/dom/getElementsByClassName/004.html
3437                fast/dom/getElementsByClassName/005.html
3438                fast/dom/getElementsByClassName/006.html
3439                fast/dom/getElementsByClassName/007.html
3440                fast/dom/getElementsByClassName/008.html
3441                fast/dom/getElementsByClassName/009.html
3442                fast/dom/getElementsByClassName/010.xml
3443                fast/dom/getElementsByClassName/011.xml
3444                fast/dom/getElementsByClassName/012.html
3445                fast/dom/getElementsByClassName/013.html
3446                fast/dom/getElementsByClassName/014.html
3447                fast/dom/getElementsByClassName/array/001.html
3448                fast/dom/getElementsByClassName/array/002.html
3449                fast/dom/getElementsByClassName/array/003.html
3450                fast/dom/getElementsByClassName/array/004.html
3451                fast/dom/getElementsByClassName/dumpNodeList.html
3452
3453         * WebCore.xcodeproj/project.pbxproj:
3454         * css/CSSStyleSelector.cpp:
3455         (WebCore::CSSStyleSelector::matchRules):
3456         (WebCore::CSSStyleSelector::checkOneSelector):
3457         * dom/AtomicStringList.h: Removed.
3458         * dom/ClassNames.cpp: Added.
3459         (WebCore::ClassNames::contains):
3460         (WebCore::ClassNames::parseClassAttribute):
3461         * dom/ClassNames.h: Copied from WebCore/dom/AtomicStringList.h.
3462         (WebCore::ClassNames::ClassNames):
3463         (WebCore::ClassNames::size):
3464         (WebCore::ClassNames::clear):
3465         (WebCore::ClassNames::operator[]):
3466         (WebCore::isClassWhitespace):
3467         * dom/ClassNodeList.cpp: Added.
3468         (WebCore::ClassNodeList::ClassNodeList):
3469         (WebCore::ClassNodeList::length):
3470         (WebCore::ClassNodeList::item):
3471         (WebCore::ClassNodeList::nodeMatches):
3472         * dom/ClassNodeList.h: Added.
3473         * dom/Document.cpp:
3474         (WebCore::Document::getElementsByName):
3475         (WebCore::Document::getElementsByClassName):
3476         * dom/Document.h:
3477         * dom/Document.idl:
3478         * dom/Element.cpp:
3479         (WebCore::Element::getClassNames):
3480         (WebCore::Element::getElementsByClassName):
3481         * dom/Element.h:
3482         * dom/Element.idl:
3483         * dom/NameNodeList.cpp:
3484         (WebCore::NameNodeList::NameNodeList):
3485         (WebCore::NameNodeList::item):
3486         (WebCore::NameNodeList::nodeMatches):
3487         * dom/NameNodeList.h:
3488         * dom/NamedMappedAttrMap.cpp:
3489         (WebCore::NamedMappedAttrMap::clearAttributes):
3490         (WebCore::NamedMappedAttrMap::parseClassAttribute):
3491         * dom/NamedMappedAttrMap.h:
3492         (WebCore::NamedMappedAttrMap::getClassNames):
3493         * dom/StyledElement.cpp:
3494         (WebCore::StyledElement::getClassNames):
3495         * dom/StyledElement.h:
3496
3497 2007-12-14  Darin Adler  <darin@apple.com>
3498
3499         Reviewed by Sam.
3500
3501         - fix http://bugs.webkit.org/show_bug.cgi?id=16351
3502           FontFallbackList.h doesn't include wtf/PassRefPtr.h
3503           
3504         * platform/graphics/FontFallbackList.h: Added include of <wtf/Forward.h>
3505         * platform/graphics/GlyphPageTreeNode.h: Removed an unneeded include.
3506
3507 2007-12-14  Darin Adler  <darin@apple.com>
3508
3509         Reviewed by Alexey.
3510
3511         - http://bugs.webkit.org/show_bug.cgi?id=16420
3512           change regression tests to use document.execCommand instead of textInputController.doCommand
3513
3514         Add a few more operations to document.execCommand.
3515
3516         Finished up the transition to the new Editor::Command, including removing
3517         the Editor::execCommand function.
3518
3519         * WebCore.base.exp: Added Editor::Command::isSupported.
3520         * editing/Editor.h: Removed execCommand.
3521         * editing/EditorCommand.cpp:
3522         (WebCore::expandSelectionToGranularity): Added.
3523         (WebCore::verticalScrollDistance): Added; replaces canScroll.
3524         (WebCore::executeDeleteBackward): Added. Moved code here from WebHTMLView.
3525         (WebCore::executeDeleteBackwardByDecomposingPreviousCharacter): Ditto.
3526         (WebCore::executeDeleteForward): Ditto.
3527         (WebCore::executeDeleteToBeginningOfLine): Ditto.
3528         (WebCore::executeDeleteToBeginningOfParagraph): Ditto.
3529         (WebCore::executeDeleteToEndOfLine): Ditto.
3530         (WebCore::executeDeleteToEndOfParagraph): Ditto.
3531         (WebCore::executeMovePageDown): Renamed this command to be consistent with all the other
3532         Move commands. They all modify the caret. Reimplemented to match the Mac OS X version by
3533         removing the explicit scrolling, and letting it be done automatically by code that makes
3534         the caret visible. In some cases the old code would scroll twice which was harmless but
3535         unnecessary.
3536         (WebCore::executeMovePageDownAndModifySelection): Added. Moved code here from WebHTMLView.
3537         (WebCore::executeMovePageUp): See MovePageDown above.
3538         (WebCore::executeMovePageUpAndModifySelection): Added. Moved code here from WebHTMLView.
3539         (WebCore::executeSelectLine): Ditto.
3540         (WebCore::executeSelectParagraph): Ditto.
3541         (WebCore::executeSelectSentence): Ditto.
3542         (WebCore::executeSelectWord): Ditto.
3543         (WebCore::executeSwapWithMark): Some small tweaks.
3544
3545         * page/ContextMenuController.cpp:
3546         (WebCore::ContextMenuController::contextMenuItemSelected): Changed to use Editor::command()
3547         instead of Editor::execCommand(). This code could be changed to use Editor::Command quite a
3548         bit more, but I didn't do that this time.
3549
3550         - Removed some obsolete unused code.
3551
3552         * page/mac/EventHandlerMac.mm:
3553         (WebCore::EventHandler::passMouseDownEventToWidget): Removed the special case code for
3554         NSTextView. This was left over from when we used NSTextField and NSTextView for form
3555         elements and is no longer used at all.
3556
3557         * page/mac/WebCoreFrameBridge.h: Removed 20 unused methods that were still on one side
3558         of the bridge or another. We really need to find a time to tear down the rest of the
3559         bridge, but that's not this patch.
3560
3561         * page/mac/WebCoreFrameBridge.mm:
3562         (-[WebCoreFrameBridge addData:]): Changed to get at the _shouldCreateRenderers field directly
3563         instead of using a method.
3564         (-[WebCoreFrameBridge rangeByAlteringCurrentSelection:SelectionController::direction:SelectionController::granularity:]):
3565         Took out obsolete comment about matching enums (we use a single enum now and have for some
3566         time).
3567         (-[WebCoreFrameBridge selectionGranularity]): Ditto.
3568
3569 2007-12-14  Justin Garcia  <justin.garcia@apple.com>
3570
3571         Reviewed by Darin Adler.
3572
3573         <rdar://problem/5575101> GoogleDocs: Hang in SplitE