86de68c68359cede0265079fca2c00b69fda5101
[WebKit-https.git] / WebCore / ChangeLog
1 2007-12-29  Alexey Proskuryakov  <ap@webkit.org>
2
3         Reviewed by Darin.
4
5         http://bugs.webkit.org/show_bug.cgi?id=14428
6         FCKEditor: Images disappear on drag/drop and copy/paste
7
8         Test: editing/pasteboard/drag-image-in-about-blank-frame.html
9
10         * editing/markup.cpp: (WebCore::createFragmentFromMarkup): Don't use "about:blank" as a
11         base URL, just like we don't use an empty one.
12
13 2007-12-29  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
14
15         Reviewed by Alp Toker.
16
17         http://bugs.webkit.org/show_bug.cgi?id=16669
18         autotools update and fixes
19
20         Autotools update and database/icon database inclusion guard fixes
21
22         * GNUmakefile.am:
23           - Update autotools config as per -r29012 changes
24           - Fix CSSGrammar.h/cpp generation (Seo Sanghyeon, sanxiyn)
25         * dom/Document.cpp:
26         * loader/icon/IconDatabase.h:
27         * page/DOMWindow.cpp:
28         * page/InspectorController.cpp:
29         * page/Settings.cpp:
30         * storage/Database.h:
31           - Remove ENABLE(DATABASE) inclusion guard. Let the includer add the guard instead.
32
33 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
34
35         Reviewed by Alexey.
36
37         Respect horiz-origin-x / horiz-origin-y / vert-origin-x / vert-origin-y properties when drawing SVG Fonts.
38         (Fixes fonts-elem-05-t.svg in a --svg-fonts build)
39
40         * svg/SVGFont.cpp:
41         (WebCore::Font::drawGlyphsWithSVGFont):
42
43 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
44
45         Reviewed by Oliver.
46
47         Further SVG Font work. Parse all <glyph> attributes, using SVGGlyphElement::buildGlyphIdentifier.
48         SVGFontElement::collectGlyphs() now uses this method. Per character advance values work well now.
49
50         * platform/graphics/FontData.cpp:
51         (WebCore::SVGFontData::convertEmUnitToPixel): Add helper function.
52         (WebCore::FontData::ascent):
53         (WebCore::FontData::descent):
54         * platform/graphics/FontData.h:
55         * svg/SVGFont.cpp:
56         (WebCore::isVerticalWritingMode): Add helper function.
57         (WebCore::Font::drawGlyphsWithSVGFont):
58         * svg/SVGFontElement.cpp:
59         (WebCore::SVGFontElement::collectGlyphs): Simplified implementation - SVGGlyphIdentifier now build by SVGGlyphElement.
60         * svg/SVGGlyphElement.cpp:
61         (WebCore::parseArabicForm): Helper function.
62         (WebCore::parseOrientation): Ditto.
63         (WebCore::parsePathData): Ditto.
64         (WebCore::SVGGlyphElement::buildGlyphIdentifier):
65         * svg/SVGGlyphElement.h:
66         (WebCore::SVGGlyphElement::rendererIsNeeded):
67
68 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
69
70         Reviewed by Oliver.
71
72         Refactor SVGAnimationElement::parseValues into a generic function parseDelimitedString.
73         SVGAnimationElement needs to parse semicolon-seperated strings, SVGGlyphElement comma-seperated.
74
75         * svg/SVGAnimationElement.cpp:
76         (WebCore::SVGAnimationElement::parseMappedAttribute):
77         * svg/SVGParserUtilities.cpp:
78         (WebCore::parseDelimitedString):
79         * svg/SVGParserUtilities.h:
80
81 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
82
83         Reviewed by Maciej.
84
85         Add new helper structure SVGFontData - FontData holds this object as OwnPtr.
86         Store several attribute values there (horiz-adv-x, horiz-origin-x etc..)
87
88         To optimize for the common case ('FontData' used for HTML rendering) it feels
89         better to hold one OwnPtr in FontData, than several floats.
90
91         Parse all <font> attributes in SVGFontFaceElement::createFontData.
92
93         * platform/graphics/FontData.cpp:
94         (WebCore::SVGFontData::SVGFontData):
95         (WebCore::FontData::FontData):
96         (WebCore::FontData::ascent):
97         (WebCore::FontData::descent):
98         * platform/graphics/FontData.h:
99         (WebCore::FontData::isSVGFont):
100         (WebCore::FontData::svgFontData):
101         * svg/SVGFont.cpp:
102         (WebCore::Font::drawGlyphsWithSVGFont):
103         * svg/SVGFontElement.cpp:
104         * svg/SVGFontElement.h:
105         (WebCore::SVGFontElement::rendererIsNeeded):
106         * svg/SVGFontFaceElement.cpp:
107         (WebCore::SVGFontFaceElement::unitsPerEm):
108         (WebCore::SVGFontFaceElement::createFontData):
109
110 2007-12-28  Darin Adler  <darin@apple.com>
111
112         - try to fix Windows and WX builds (broken by SVG Fonts check-in)
113
114         * platform/graphics/win/FontWin.cpp:
115         (WebCore::Font::drawGlyphs): Pass font size to FontData::ascent, now that it requires it.
116         I can't see how it can be right to require the font size for ascent and descent,
117         but not for other metrics functions in FontData.
118
119         * platform/graphics/wx/FontWx.cpp:
120         (WebCore::Font::drawGlyphs): Pass font size to FontData::ascent and FontData::descent.
121
122 2007-12-28  Dan Bernstein  <mitz@apple.com>
123
124         Reviewed by Mark Rowe.
125
126         - fix http://bugs.webkit.org/show_bug.cgi?id=16650
127           <rdar://problem/5664872> REGRESSION (r28278-r28314): ATSUI uses LTR writing direction for all text runs
128
129         Covered by existing pixel tests.
130
131         * platform/graphics/mac/FontMac.mm:
132         (WebCore::Font::drawComplexText): Corrected to maintain the style
133         information in the adjusted text run when passing it to
134         ATSUILayoutParameters. Prior to r28298 the style was passed separately.
135
136 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
137
138         Build fix, not reviewed.
139
140         Add wtf/OwnPtr.h include, to fix --svg-fonts build.
141
142         * css/SVGCSSFontFace.h:
143
144 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
145
146         Reviewed by Eric.
147
148         Fixes: http://bugs.webkit.org/show_bug.cgi?id=10649 (WebKit SVG needs SVG Fonts support)
149
150         Begin implementation of SVG Fonts module. Basic documents using SVG Fonts already work.
151         Only local, in-document fonts who declare their glyphs using the <glyph d="..."> path syntax
152         are supported. (<glyph> containing arbitary SVG content as child elements, not supported yet).
153
154         Limited to single char <-> glyph mapping, no ligatures supported yet.
155         (ie. <glyph unicode='A'/> <glyph unicode='AB'/> - it ignores the 'AB' glyph definition for now)
156
157         Mark all SVG Font related classes & usages in ENABLE(SVG_FONTS) blocks.
158
159         No layout test changes for a --no-svg-fonts build, heavy changes if enabled. Because a lot of SVG Font
160         attributes are not processed yet, the rendering looks wrong - hence disabled by default.)
161
162         * DerivedSources.make: Add SVGFontElement/SVGGlyphElement/SVGMissingGlyphElement
163         * WebCore.pro: Updated build system.
164         * WebCore.vcproj/WebCore.vcproj: Ditto.
165         * WebCore.xcodeproj/project.pbxproj: Ditto.
166         * bindings/js/JSSVGElementWrapperFactory.cpp: Add JSSVGFontElement/JSSVGGlyphElement/JSSVGMissingGlyphElement
167         * bindings/objc/DOM.mm: Ditto (for DOMSVG*).
168         (WebCore::createElementClassMap):
169         * bindings/objc/DOMInternal.h: Ditto.
170         * bindings/objc/DOMSVG.h: Ditto.
171         * css/CSSFontFace.h: Mark three functions 'virtual', to be overriden by SVGCSSFontFace
172         * css/CSSFontFaceSrcValue.h: Add functionality to identify as SVG CSS font face source.
173         (WebCore::CSSFontFaceSrcValue::m_fontFaceElement): Hold a pointer to the font face which created it.
174         (WebCore::CSSFontFaceSrcValue::svgFontFaceElement):
175         (WebCore::CSSFontFaceSrcValue::setSVGFontFaceElement):
176         * css/CSSFontSelector.cpp: Build 'SVGCSSFontFace' objects for local, in-document SVG fonts.
177         (WebCore::CSSFontSelector::addFontFaceRule):
178         * css/SVGCSSFontFace.cpp: Added. (Simplified implementation for SVG Fonts)
179         (WebCore::SVGCSSFontFace::SVGCSSFontFace):
180         (WebCore::SVGCSSFontFace::~SVGCSSFontFace):
181         (WebCore::SVGCSSFontFace::isValid):
182         (WebCore::SVGCSSFontFace::addSource):
183         (WebCore::SVGCSSFontFace::getFontData):
184         * css/SVGCSSFontFace.h: Added.
185         * platform/graphics/cg/PathCG.cpp:
186         (WebCore::Path::closeSubpath): Silence a CG warning when calling closeSubpath() on empty path.
187         * platform/graphics/Font.cpp: Add some logic to call into SVG Font code when operating on SVG Fonts.
188         (WebCore::Font::ascent): Pass font size to FontData::ascent() call
189         (WebCore::Font::descent): Pass font size to FontData::descent() call
190         (WebCore::Font::canUseGlyphCache): Always return true for SVG fonts here.
191         (WebCore::Font::drawGlyphBuffer): Call drawGlyphsWithSVGFont (instead of drawGlyphs) if the primary font is a SVG font.
192         * platform/graphics/Font.h: Add (SVG-only!) ability to store a RenderObject pointer, to the element which invoked the drawText() call.
193         (WebCore::TextRun::TextRun):
194         (WebCore::TextRun::referencingRenderObject):
195         (WebCore::TextRun::setReferencingRenderObject):
196         * platform/graphics/FontData.cpp:
197         (WebCore::FontData::FontData):
198         (WebCore::FontData::ascent):
199         (WebCore::FontData::descent):
200         * platform/graphics/FontData.h: Store a pointer to the SVGFontFaceElement, which created this FontData object - needed for drawGlyphsWithSVGFont().
201         (WebCore::FontData::isSVGFont): Offer a way to determine wheter this is a FontData object, created by a SVGFontFaceElement.
202         (WebCore::FontData::svgFontFace):
203         * rendering/SVGInlineTextBox.cpp:
204         (WebCore::SVGInlineTextBox::calculateGlyphWidth): Add assertion.
205         * rendering/SVGRootInlineBox.cpp:
206         (WebCore::svgTextRunForInlineTextBox): Always call 'setReferencingRenderObject(myRenderSVGText)' on the new TextRun
207         * svg/SVGFont.cpp: Added.
208         (WebCore::Font::drawGlyphsWithSVGFont): Outsourced implementation of SVG Fonts into it's own file.
209         * svg/SVGFontElement.cpp: Added. (Note: this holds the GlyphHashMap which associates certain <glyph> objects with unicode values)
210         (WebCore::SVGFontElement::SVGFontElement):
211         (WebCore::SVGFontElement::~SVGFontElement):
212         (WebCore::SVGFontElement::parseMappedAttribute):
213         (WebCore::SVGFontElement::collectGlyphs):
214         (WebCore::SVGFontElement::glyphIdentifierForGlyphCode):
215         * svg/SVGFontElement.h: Added.
216         (WebCore::GlyphHash::hash):
217         (WebCore::GlyphHash::equal):
218         (WebCore::GlyphHashTraits::deletedValue):
219         (WebCore::SVGFontElement::rendererIsNeeded):
220         (WebCore::SVGFontElement::contextElement):
221         * svg/SVGFontElement.idl: Added.
222         * svg/SVGFontFaceElement.cpp: Build SVG specific 'FontData' object
223         (WebCore::SVGFontFaceElement::unitsPerEm):
224         (WebCore::SVGFontFaceElement::fontFamily):
225         (WebCore::SVGFontFaceElement::createFontData): Builds SVG specified 'FontData' object with the markup specified ascent/descent values etc..
226         (WebCore::SVGFontFaceElement::rebuildFontFace): Construct CSSFontFaceSrc object (marked as 'isSVGFontFaceSrc') to satisfy CSSFontSelector::addFontFaceRule.
227         (WebCore::SVGFontFaceElement::insertedIntoDocument): Rebuild font face.
228         (WebCore::SVGFontFaceElement::glyphIdentifierForGlyphCode): Allows drawGlyphsWithSVGFont to access the glyph hash map living in the SVGFontElement.
229         * svg/SVGFontFaceElement.h: Fixed code formatting issues & wrap in ENABLE(SVG_FONTS) blocks.
230         * svg/SVGFontFaceElement.idl: Ditto.
231         * svg/SVGFontFaceFormatElement.cpp: Ditto.
232         * svg/SVGFontFaceFormatElement.h: Ditto.
233         * svg/SVGFontFaceFormatElement.idl: Ditto.
234         * svg/SVGFontFaceNameElement.cpp: Ditto.
235         * svg/SVGFontFaceNameElement.h: Ditto.
236         * svg/SVGFontFaceNameElement.idl: Ditto.
237         * svg/SVGFontFaceSrcElement.cpp: Ditto.
238         * svg/SVGFontFaceSrcElement.h: Ditto.
239         * svg/SVGFontFaceSrcElement.idl: Ditto.
240         * svg/SVGFontFaceUriElement.cpp: Ditto.
241         * svg/SVGFontFaceUriElement.h: Ditto.
242         * svg/SVGFontFaceUriElement.idl: Ditto.
243         * svg/SVGDefinitionSrcElement.cpp: Ditto.
244         * svg/SVGDefinitionSrcElement.h: Ditto.
245         * svg/SVGDefinitionSrcElement.idl: Ditto.
246         * svg/SVGGlyphElement.cpp: Added.
247         (WebCore::SVGGlyphElement::SVGGlyphElement):
248         (WebCore::SVGGlyphElement::parseMappedAttribute):
249         (WebCore::SVGGlyphElement::childrenChanged):
250         * svg/SVGGlyphElement.h: Added.
251         (WebCore::SVGGlyphElement::rendererIsNeeded):
252         (WebCore::SVGGlyphIdentifier::): Structure holding all data to represent a SVG glyph (origin, advance, orientation etc..)
253         (WebCore::SVGGlyphIdentifier::SVGGlyphIdentifier):
254         * svg/SVGGlyphElement.idl: Added.
255         * svg/SVGMissingGlyphElement.cpp: Added. (stub implementation)
256         (WebCore::SVGMissingGlyphElement::SVGMissingGlyphElement):
257         (WebCore::SVGMissingGlyphElement::parseMappedAttribute):
258         (WebCore::SVGMissingGlyphElement::childrenChanged):
259         * svg/SVGMissingGlyphElement.h: Added.
260         (WebCore::SVGMissingGlyphElement::rendererIsNeeded):
261         * svg/SVGMissingGlyphElement.idl: Added.
262         * 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!).
263
264 2007-12-27  Dan Bernstein  <mitz@apple.com>
265
266         Reviewed by Alexey Proskuryakov.
267
268         - fix http://bugs.webkit.org/show_bug.cgi?id=16628
269           ASSERTION FAILED: m_resizeLayer (running layout tests)
270
271         * rendering/RenderLayer.cpp:
272         (WebCore::RenderLayer::~RenderLayer): Avoid calling
273         EventHandler::resizeLayerDestroyed() if the document is being destroyed.
274
275 2007-12-27  Dan Bernstein  <mitz@apple.com>
276
277         Reviewed by Oliver Hunt.
278
279         - fix http://bugs.webkit.org/show_bug.cgi?id=16603
280           <rdar://problem/5664199> Crash when resizing text field
281
282         Test: fast/layers/resize-layer-deletion-crash.html
283
284         The event handler has only a weak reference to the layer that is
285         currently in resize mode, so it is the layer's responsibility to let
286         the event handler know if it has been destroyed while in that mode.
287
288         * page/EventHandler.cpp:
289         (WebCore::EventHandler::resizeLayerDestroyed): Added. Resets
290         m_resizeLayer to 0.
291         * page/EventHandler.h:
292         * rendering/RenderLayer.cpp:
293         (WebCore::RenderLayer::~RenderLayer): Added a call to
294         EventHandler::resizeLayerDestroyed() if the layer is in resize mode.
295
296 2007-12-27  Collin Jackson  <webkit@collinjackson.com>
297
298         Reviewed by Sam Weinig.
299
300         http://bugs.webkit.org/show_bug.cgi?id=16539
301         <rdar://problem/5659269>
302
303         The same-origin check was missing in the implementation of 
304         setTimeout, setInterval, addEventListener, and removeEventListener.
305
306         Suppose <http://www.badguy.com/> contains an iframe to 
307         <http://www.goodguy.com/>. Now www.badguy.com can steal
308         www.goodguy.com cookies by running this code:
309
310         setTimeout.call(frames[0], "alert(document.cookie)", 1000);
311
312         This patch changes the behavior so that setTimeout to does 
313         nothing and returns an undefined value if the caller is not
314         permitted to script the window whose setTimeout method is being
315         called. The same applies to setInterval, addEventListener, and 
316         removeEventListener.
317
318         Tests: http/tests/security/cross-frame-access-call.html
319
320         * bindings/js/kjs_window.cpp:
321         (KJS::WindowProtoFuncSetTimeout::callAsFunction)
322         (KJS::WindowProtoFuncSetInterval::callAsFunction)
323         (KJS::WindowProtoFuncAddEventListener::callAsFunction)
324         (KJS::WindowProtoFuncRemoveEventListener::callAsFunction)
325
326 2007-12-27  Dan Bernstein  <mitz@apple.com>
327
328         Reviewed by Dave Hyatt and Sam Weinig.
329
330         - fix <rdar://problem/5605937> Inspector: Disclosure triangle not drawn in node's properties panel until click
331
332         Test: fast/layers/add-layer-with-nested-stacking.html
333         Test: fast/layers/remove-layer-with-nested-stacking.html
334
335         * rendering/RenderLayer.cpp:
336         (WebCore::RenderLayer::addChild): If the new child is overflow-only
337         but has children of its own, dirty the stacking context's z-order lists
338         since the grandchildren might need to be in them.
339         (WebCore::RenderLayer::removeChild): Similarly for the old child.
340
341 2007-12-27  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
342
343         Reviewed by Alp Toker.
344
345         http://bugs.webkit.org/show_bug.cgi?id=16353
346         [GTK] Check for deprecated API use (G_DISABLE_DEPRECATED etc.)
347
348         Added the flags mentioned in the bug only when doing 'debug'
349         builds. -DGST_DISABLE_DEPRECATED only added when video is enabled.
350
351         * GNUmakefile.am:
352         * WebCore.pro:
353
354 2007-12-27  Dan Bernstein  <mitz@apple.com>
355
356         Reviewed by Eric Seidel.
357
358         - fix http://bugs.webkit.org/show_bug.cgi?id=16490
359           ASSERT in ~FrameView while viewing/reloading WICD test case
360
361         Test: fast/dynamic/paused-event-dispatch.html
362
363         * page/FrameView.cpp:
364         (WebCore::FrameView::~FrameView):
365         (WebCore::FrameView::layout): Changed to always pause event dispatch and
366         always resume event dispatch, regardless of whether the post-layout
367         task timer is active. However, if it is active, assert that event
368         dispatch is still paused.
369
370 2007-12-27  Alexey Proskuryakov  <ap@webkit.org>
371
372         Reviewed by Maciej.
373
374         http://bugs.webkit.org/show_bug.cgi?id=14500
375         need to be more generous about charset declaration with meta tag
376         
377         http://bugs.webkit.org/show_bug.cgi?id=12526
378         <rdar://problem/4867183> Safari ignores encoding description "charset=Shift_JIS" in invalid html
379
380         <rdar://problem/4892428> Unlike other browsers, WebKit ignores <meta> charset definitions outside the head
381
382         <rdar://problem/5643774> REGRESSION: Text is garbled when clicking a link inside an Arabic website
383
384         Tests: fast/encoding/ahram-org-eg.html
385                fast/encoding/bandai-co-jp-releases.html
386                fast/encoding/floraexpress-ru.html
387                fast/encoding/hanarei-blog32-fc2-com.html
388                fast/encoding/yahoo-mail.html
389
390         * loader/TextResourceDecoder.cpp:
391         (WebCore::TextResourceDecoder::checkForHeadCharset): Don't stop looking for <meta> until we've
392         seen at least 512 bytes of input.
393
394 2007-12-26  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
395
396         Reviewed by Alp Toker.
397
398         http://bugs.webkit.org/show_bug.cgi?id=16390
399         Use autotools or GNU make as the build system for the GTK port
400
401         * GNUmakefile.am: Added.
402
403 2007-12-26  Alexey Proskuryakov  <ap@webkit.org>
404
405         Reviewed by Sam Weinig.
406
407         http://bugs.webkit.org/show_bug.cgi?id=16609
408         Make manual-tests/xmlhttprequest-contenttype-empty.html test automatic
409
410         * manual-tests/xmlhttprequest-contenttype-empty.html: Removed (moved to LayoutTests/http).
411
412 2007-12-26  Mark Rowe  <mrowe@apple.com>
413
414         Windows build fix.
415
416         * platform/Threading.h:
417
418 2007-12-25  Rob Buis  <buis@kde.org>
419
420         Reviewed by Eric.
421
422         http://bugs.webkit.org/show_bug.cgi?id=15514
423         <clipPath> with <use> not respected
424         http://bugs.webkit.org/show_bug.cgi?id=16557
425         SVG circle elements have been clipped away completely, instead of partially.
426
427         Add toClipPath to get clip path data for the clipping paths. Implement it for <use>, thereby allowing clip paths using use.
428
429         * svg/SVGClipPathElement.cpp:
430         (WebCore::SVGClipPathElement::canvasResource):
431         * svg/SVGStyledTransformableElement.h:
432         (WebCore::SVGStyledTransformableElement::toClipPath):
433         * svg/SVGUseElement.cpp:
434         (WebCore::isDirectReference):
435         (WebCore::SVGUseElement::toClipPath):
436         * svg/SVGUseElement.h:
437
438 2007-12-25  Sam Weinig  <sam@webkit.org>
439
440         Reviewed by Eric Seidel.
441
442         Clean up the files relating to NodeLists.
443
444         * dom/ChildNodeList.cpp:
445         (WebCore::ChildNodeList::ChildNodeList):
446         (WebCore::ChildNodeList::length):
447         (WebCore::ChildNodeList::item):
448         (WebCore::ChildNodeList::nodeMatches):
449         * dom/ChildNodeList.h:
450         * dom/DynamicNodeList.cpp:
451         (WebCore::DynamicNodeList::itemForwardsFromCurrent):
452         (WebCore::DynamicNodeList::itemBackwardsFromCurrent):
453         (WebCore::DynamicNodeList::itemWithName):
454         * dom/DynamicNodeList.h:
455         (WebCore::DynamicNodeList::needsNotifications):
456         * dom/NameNodeList.cpp:
457         (WebCore::NameNodeList::NameNodeList):
458         (WebCore::NameNodeList::rootNodeAttributeChanged):
459         (WebCore::NameNodeList::nodeMatches):
460         * dom/NameNodeList.h:
461         * dom/NodeList.h:
462         * dom/SelectorNodeList.h:
463
464 2007-12-25  Sam Weinig  <sam@webkit.org>
465
466         Fix non-mac builds.
467
468         * WebCore.pro:
469         * WebCore.vcproj/WebCore.vcproj:
470         * WebCoreSources.bkl:
471
472 2007-12-25  Sam Weinig  <sam@webkit.org>
473
474         Rubber stamped by Eric Seidel.
475
476         Move TagNodeList into its own file.
477
478         * WebCore.xcodeproj/project.pbxproj:
479         * dom/Node.cpp:
480         * dom/TagNodeList.cpp: Copied from dom/Node.cpp.
481         (WebCore::TagNodeList::TagNodeList):
482         * dom/TagNodeList.h: Copied from dom/Node.cpp.
483
484 2007-12-25  Sam Weinig  <sam@webkit.org>
485
486         Reviewed by Eric Seidel.
487
488         Simplify the NodeList architecture.
489         - Rename recursiveItem() to item(), since it is not recursive.
490         - Make recursiveLength() iterative and rename to length().
491         - Remove now unneeded overrides of item() and length() that used 
492           to call the recursive variants.
493
494         * dom/ClassNodeList.cpp:
495         * dom/ClassNodeList.h:
496         * dom/DynamicNodeList.cpp:
497         (WebCore::DynamicNodeList::length):
498         (WebCore::DynamicNodeList::item):
499         (WebCore::DynamicNodeList::rootNodeAttributeChanged): Move implementation 
500         into the .cpp file since virtual methods can't be inlined.
501         * dom/DynamicNodeList.h:
502         * dom/NameNodeList.cpp:
503         * dom/NameNodeList.h:
504         * dom/Node.cpp:
505
506 2007-12-25  Alp Toker  <alp@atoker.com>
507
508         More complete GTK+/Qt/Wx/Win build fixes for breakage introduced in
509         r28981.
510
511         * WebCore.pro:
512         * WebCore.vcproj/WebCore.vcproj:
513         * WebCoreSources.bkl:
514
515 2007-12-25  Alp Toker  <alp@atoker.com>
516
517         Win build fix for breakage introduced in r28981.
518
519         * WebCore.vcproj/WebCore.vcproj:
520
521 2007-12-25  Alp Toker  <alp@atoker.com>
522
523         Wx build fix for breakage introduced in r28981.
524
525         * WebCoreSources.bkl:
526
527 2007-12-25  Alp Toker  <alp@atoker.com>
528
529         GTK+/Qt build fix for breakage introduced in r28981.
530
531         * WebCore.pro:
532
533 2007-12-25  David Smith  <catfish.man@gmail.com> and Sam Weinig  <sam@webkit.org>
534
535         Reviewed by Oliver.
536         
537         - http://bugs.webkit.org/show_bug.cgi?id=16587
538         Implement the most useful part of the W3C Selectors API.
539
540         * WebCore.xcodeproj/project.pbxproj:
541         * css/CSSStyleSelector.h: Make Node a friend of CSSStyleSelector so it can use checkSelector()
542         * dom/ChildNodeList.cpp:
543         (WebCore::ChildNodeList::ChildNodeList): Change to being a DynamicNodeList
544         * dom/ChildNodeList.h:
545         * dom/ClassNodeList.cpp:
546         (WebCore::ClassNodeList::ClassNodeList): Change to being a DynamicNodeList
547         * dom/ClassNodeList.h:
548         * dom/Document.idl: Add the new functions
549         * dom/DynamicNodeList.cpp: Copied from WebCore/dom/NodeList.cpp.
550         (WebCore::DynamicNodeList::DynamicNodeList): Rename NodeList to DynamicNodeList, to differentiate it from the new StaticNodeList
551         (WebCore::DynamicNodeList::~DynamicNodeList):
552         (WebCore::DynamicNodeList::recursiveLength):
553         (WebCore::DynamicNodeList::itemForwardsFromCurrent):
554         (WebCore::DynamicNodeList::itemBackwardsFromCurrent):
555         (WebCore::DynamicNodeList::recursiveItem):
556         (WebCore::DynamicNodeList::itemWithName):
557         (WebCore::DynamicNodeList::rootNodeChildrenChanged):
558         (WebCore::DynamicNodeList::Caches::Caches):
559         (WebCore::DynamicNodeList::Caches::reset):
560         * dom/DynamicNodeList.h: Copied from WebCore/dom/NodeList.h.
561         (WebCore::DynamicNodeList::rootNodeAttributeChanged):
562         * dom/Element.idl: Add the new functions
563         * dom/NameNodeList.cpp: Change to being a DynamicNodeList
564         (WebCore::NameNodeList::NameNodeList):
565         * dom/NameNodeList.h:
566         (WebCore::NameNodeList::rootNodeAttributeChanged):
567         * dom/Node.cpp:
568         (WebCore::TagNodeList::TagNodeList): Change to being a DynamicNodeList
569         (WebCore::Node::registerDynamicNodeList):
570         (WebCore::Node::unregisterDynamicNodeList):
571         (WebCore::Node::getElementsByName):
572         (WebCore::Node::getElementsByClassName):
573         (WebCore::Node::querySelector): new
574         (WebCore::Node::querySelectorAll): new
575         * dom/Node.h:
576         * dom/NodeList.cpp: Removed.
577         * dom/NodeList.h: This is now an abstract superclass of DynamicNodeList and StaticNodeList
578         (WebCore::NodeList::NodeList):
579         (WebCore::NodeList::~NodeList):
580         * dom/SelectorNodeList.cpp: Added.
581         (WebCore::SelectorNodeList::SelectorNodeList): New StaticNodeList subclass that filters elements by CSS selector
582         * dom/SelectorNodeList.h: Added.
583         * dom/StaticNodeList.cpp: Added.
584         (WebCore::StaticNodeList::length):
585         (WebCore::StaticNodeList::item):
586         (WebCore::StaticNodeList::itemWithName):
587         * dom/StaticNodeList.h: Added.
588         (WebCore::StaticNodeList::StaticNodeList):
589         (WebCore::StaticNodeList::~StaticNodeList):
590
591 2007-12-25  Mark Rowe  <mrowe@apple.com>
592
593         Reviewed by Sam Weinig.
594
595         Implement a lock-free ThreadSafeShared for i386, x86_64, ppc and ppc64.
596         http://bugs.webkit.org/show_bug.cgi?id=16596
597
598         This is a 1.7x as fast as the lock-based implementation on x86 for a single-threaded use
599         of ThreadSafeShared but is closer to 280x as fast when there is heavy concurrent multi-threaded
600         access to a single ThreadSafeShared object.
601
602         The atomic operations are based on those used by the Boost C++ library's shared_ptr implementation.
603
604         * platform/Threading.h:
605         (WebCore::atomicIncrement):
606         (WebCore::atomicDecrement):
607         (WebCore::ThreadSafeShared::ThreadSafeShared):
608         (WebCore::ThreadSafeShared::ref): Use lock-free operations if available.
609         (WebCore::ThreadSafeShared::deref): Ditto.
610         (WebCore::ThreadSafeShared::hasOneRef):
611         (WebCore::ThreadSafeShared::refCount):
612         (WebCore::ThreadSafeShared::isThreadSafe):
613
614 2007-12-24  Darin Adler  <darin@apple.com>
615
616         * platform/text/PlatformString.h: Removed now-incorrect comment.
617         Added a comment about copy().
618         * platform/text/StringImpl.h: Added a comment about copy().
619
620 2007-12-24  Darin Adler  <darin@apple.com>
621
622         Reviewed by Maciej.
623
624         - http://bugs.webkit.org/show_bug.cgi?id=16550
625           make StringImpl immutable
626
627         I tried to keep the changes to a minimum. In some cases there is
628         room for optimization -- I didn't try to add in the "single ref count"
629         optimizations and there might be a tiny bit more string copying than
630         we had before.
631
632         * WebCore.base.exp: Updated.
633
634         * dom/CharacterData.cpp:
635         (WebCore::CharacterData::appendData): Changed to use String since
636         StringImpl doesn't have mutating functions any more.
637         (WebCore::CharacterData::insertData): Ditto.
638         (WebCore::CharacterData::deleteData): Ditto.
639         (WebCore::CharacterData::replaceData): Ditto.
640         * dom/Text.cpp:
641         (WebCore::Text::splitText): Changed to use substring instead of
642         remove since StringImpl does't have mutating functions any more.
643         * editing/CompositeEditCommand.cpp:
644         (WebCore::CompositeEditCommand::deleteInsignificantText): Changed
645         to use String instead of StringImpl so we can use remove.
646
647         * platform/text/PlatformString.h: Removed newUninitialized.
648         Added append that takes a character pointer and length.
649
650         * platform/text/String.cpp:
651         (WebCore::String::insert): Added an implementation that does not
652         rely on an underlying StringImpl function.
653         (WebCore::String::append): Ditto.
654         (WebCore::String::truncate): Ditto.
655         (WebCore::String::remove): Ditto.
656         (WebCore::String::charactersWithNullTermination): Added an
657         implementation that uses the new StringImpl null termination feature,
658         which does not require modifying a string.
659
660         * platform/text/StringImpl.cpp:
661         (WebCore::isSpace): Fix comment.
662         (WebCore::StringImpl::StringImpl): Added a new constructor that makes
663         a string with a trailing null character.
664         (WebCore::StringImpl::substring): Marked const.
665         (WebCore::StringImpl::replace): Marked const; had to add quite a few
666         const_cast. Also rewrote one of these to work without modifying the
667         existing string.
668
669         * platform/text/StringImpl.h: Fixed a mistake where the empty string had
670         m_hasTerminatingNullCharacter uninitialized. Added a type and constructor
671         for creating strings that have a trailing null character. Added a
672         hasTerminatingNullCharacter function. Removed newUninitialized,
673         charactersWithNullTermination, append, insert, truncate, and remove.
674         Marked lots of other functions const.
675
676         * platform/text/TextCodecLatin1.cpp:
677         (WebCore::TextCodecLatin1::decode): Rewrote to use a Vector instead of
678         newUninitialized.
679         * platform/text/TextCodecUTF16.cpp:
680         (WebCore::TextCodecUTF16::decode): Ditto.
681         * platform/text/TextCodecUserDefined.cpp:
682         (WebCore::TextCodecUserDefined::decode): Ditto.
683
684         * rendering/RenderStyle.cpp:
685         (WebCore::RenderStyle::setContent): Changed to use String since
686         StringImpl doesn't have mutating functions any more.
687
688 2007-12-24  Alexey Proskuryakov  <ap@webkit.org>
689
690         Reviewed by Oliver.
691
692         Fix fast/events/arrow-keys-on-body.html, failing on Windows.
693
694         * platform/win/KeyEventWin.cpp:
695         (WebCore::isKeypadEvent):
696         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
697         Use HIWORD() macro instead of shifting the value explicitly (no change in behavior).
698
699 2007-12-23  Alexey Proskuryakov  <ap@webkit.org>
700
701         Fix Debug and Release QTMovieWin bulds.
702
703         * WebCore.vcproj/QTMovieWin.vcproj:
704         * WebCore.vcproj/debug.vsprops:
705         * WebCore.vcproj/debug_internal.vsprops:
706         * WebCore.vcproj/release.vsprops:
707         Use LibraryConfigSuffix instead of WebKitConfigSuffix for pthreadVC2.
708         Build release import lib into \lib, not \bin.
709
710 2007-12-23  Alp Toker  <alp@atoker.com>
711
712         Reviewed by Holger Freyther.
713
714         http://bugs.webkit.org/show_bug.cgi?id=15382
715         [CAIRO] Canvas pattern support
716
717         http://bugs.webkit.org/show_bug.cgi?id=16577
718         Merge Cairo enhancements from Apollo project
719
720         Add support for canvas patterns.
721
722         Make Image::nativeImageForCurrentFrame() public.
723
724         Fix some typos along the way.
725
726         The globalAlpha canvas fixes are not included in this patch as
727         they're slightly more intrusive and may conflict conceptually with
728         GraphicsContext::setAlpha().
729
730         * html/CanvasPattern.cpp:
731         (WebCore::CanvasPattern::CanvasPattern):
732         (WebCore::CanvasPattern::~CanvasPattern):
733         (WebCore::CanvasPattern::createPattern):
734         * html/CanvasPattern.h:
735         (WebCore::CanvasPattern::platformImage):
736         * html/CanvasRenderingContext2D.cpp:
737         (WebCore::CanvasRenderingContext2D::setShadow):
738         (WebCore::CanvasRenderingContext2D::applyShadow):
739         (WebCore::CanvasRenderingContext2D::drawImage):
740         (WebCore::CanvasRenderingContext2D::createPattern):
741         (WebCore::CanvasRenderingContext2D::applyStrokePattern):
742         (WebCore::CanvasRenderingContext2D::applyFillPattern):
743         * platform/graphics/Image.h:
744         (WebCore::Image::nativeImageForCurrentFrame):
745
746 2007-12-23  Kevin Ollivier  <kevino@theolliviers.com>
747
748         Reviewed by Eric Seidel.
749
750         Remove getWxBitmap as we have nativeImageForCurrentFrame now,
751         and don't draw a border in fillRect.
752
753         * platform/graphics/BitmapImage.h:
754         * platform/graphics/wx/GraphicsContextWx.cpp:
755         (WebCore::GraphicsContext::fillRect):
756         * platform/graphics/wx/ImageWx.cpp:
757
758 2007-12-23  Alp Toker  <alp@atoker.com>
759
760         Reviewed by Holger Freyther.
761
762         http://bugs.webkit.org/show_bug.cgi?id=16577
763         Merge Cairo enhancements from Apollo project
764
765         This patch is based on initial merging work by Brent Fulgham. Adobe's
766         code has been modified in a few places to better suit the existing
767         coding style.
768
769         Implement more clipping and drawing functions.
770
771         Save and restore the fill rule manually when clipping.
772
773         Avoid image surface creation when the image buffer has height zero.
774
775         * platform/graphics/cairo/GraphicsContextCairo.cpp:
776         (WebCore::GraphicsContext::clip):
777         (WebCore::GraphicsContext::addInnerRoundedRectClip):
778         (WebCore::GraphicsContext::addPath):
779         (WebCore::GraphicsContext::clipOut):
780         (WebCore::GraphicsContext::clipOutEllipseInRect):
781         (WebCore::GraphicsContext::fillRoundedRect):
782         * platform/graphics/cairo/ImageSourceCairo.cpp:
783         (WebCore::ImageSource::createFrameAtIndex):
784
785 2007-12-23  Nikolas Zimmermann  <zimmermann@kde.org>
786
787         Reviewed by Mark.
788
789         Fix wrong placed ifdef - wrapping SVGDefsElement, instead of SVGDefinitionSrcElement in SVG_FONTS block.
790
791         * bindings/objc/DOM.mm:
792         (WebCore::createElementClassMap):
793
794 2007-12-22  Alp Toker  <alp@atoker.com>
795
796         GTK+ build fix
797
798         GTK_TARGET_OTHER_APP is not available in older GTK+ versions. Pass
799         empty target flags for now.
800
801         Check GTK+, not GLib versions, since they are different.
802
803         * platform/gtk/PasteboardGtk.cpp:
804         (WebCore::Pasteboard::documentFragment):
805
806 2007-12-22  Luca Bruno  <lethalman88@gmail.com>
807
808         Reviewed by Alp Toker.
809
810         http://bugs.webkit.org/show_bug.cgi?id=16311
811         [Gtk] Copy rich text to clipboard as text/plain and text/html.
812
813         Hook into the WebView to get the correct clipboard object on the
814         appropriate display. This is necessary because GTK+ does not have
815         global clipboards.
816
817         * WebCore.pro:
818         * platform/Pasteboard.h:
819         (WebCore::Pasteboard::setHelper): added for GTK
820         (WebCore::Pasteboard::m_helper): private added for GTK
821         * platform/gtk/PasteboardGtk.cpp:
822         (WebCore::PasteboardSelectionData): added to support GTK selection data callback
823         (WebCore::clipboard_get_contents_cb): added
824         (WebCore::clipboard_clear_contents_cb): added
825         (WebCore::Pasteboard::~Pasteboard):
826         (WebCore::Pasteboard::setHelper):
827         (WebCore::Pasteboard::writeSelection): copy rich text
828         (WebCore::Pasteboard::documentFragment): 
829         (WebCore::Pasteboard::plainText): 
830         * platform/gtk/PasteboardHelper.h: Added.
831
832 2007-12-22  Nikolas Zimmermann  <zimmermann@kde.org>
833
834         Reviewed by Oliver.
835
836         Fixes: http://bugs.webkit.org/show_bug.cgi?id=15966 (Crash in SVGRootInlineBox::walkTextChunks() on mouse hover)
837
838         Add new isSVGRootInlineBox() function to InlineBox to be able to differentiate between RootInlineBox/SVGRootInlineBox.
839         SVG assumed it's root inline box (for <text> elements) is always of type SVGRootInlineBox, which is not the case
840         for HTML text in <foreignObject>. Text selection doesn't work so far as line box offsets are wrong - which is visible
841         in Web Inspector.
842
843         * rendering/InlineBox.h:
844         (WebCore::InlineBox::isSVGRootInlineBox):
845         * rendering/SVGInlineTextBox.cpp:
846         (WebCore::SVGInlineTextBox::svgRootInlineBox):
847         (WebCore::SVGInlineTextBox::closestCharacterToPosition):
848         (WebCore::SVGInlineTextBox::selectionRect):
849         * rendering/SVGRenderTreeAsText.cpp:
850         (WebCore::writeSVGInlineTextBox):
851         * rendering/SVGRootInlineBox.h:
852         (WebCore::SVGRootInlineBox::isSVGRootInlineBox):
853
854 2007-12-22  Alp Toker  <alp@atoker.com>
855
856         LOW_BANDWIDTH_DISPLAY build fix
857
858         Track recent KURL DeprecatedString changes.
859
860         * loader/FrameLoader.cpp:
861         (WebCore::FrameLoader::switchOutLowBandwidthDisplayIfReady):
862
863 2007-12-22  Dan Bernstein  <mitz@apple.com>
864
865         - Windows build fix
866
867         * WebCore.vcproj/WebCore.vcproj:
868
869 2007-12-22  Xan Lopez  <xan@gnome.org>
870
871         Reviewed by Alp Toker.
872
873         Add missing return 0 to fix a compile warning.
874
875         * page/gtk/FrameGtk.cpp:
876         (WebCore::Frame::createScriptInstanceForWidget):
877
878 2007-12-21  Antti Koivisto  <antti@apple.com>
879
880         Reviewed by Darin, Adam and Steve.
881
882         Add media playback support for Windows.
883         
884         The implementation uses low level QuickTime API. DLL is
885         needed to work around CF use in both WebKit and QuickTime.
886         
887         This makes Windows build depend on the QuickTime SDK 
888         
889         http://developer.apple.com/quicktime/download/
890         
891         but not QuickTime itself.
892         
893         QTMovieWinTimer contains some copy code from SharedTimerWin. It
894         is used in the QuickTime access DLL which can't use WebCore
895         SharedTimer due to dependency problems.
896
897         * WebCore.vcproj/QTMovieWin.vcproj: Added.
898         * WebCore.vcproj/WebCore.vcproj:
899         * WebCore.vcproj/build-generated-files.sh:
900         * html/HTMLMediaElement.cpp:
901         (WebCore::HTMLMediaElement::setSrc):
902         * platform/graphics/MediaPlayer.cpp:
903         * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp: Added.
904         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
905         (WebCore::MediaPlayerPrivate::~MediaPlayerPrivate):
906         (WebCore::MediaPlayerPrivate::load):
907         (WebCore::MediaPlayerPrivate::play):
908         (WebCore::MediaPlayerPrivate::pause):
909         (WebCore::MediaPlayerPrivate::duration):
910         (WebCore::MediaPlayerPrivate::currentTime):
911         (WebCore::MediaPlayerPrivate::seek):
912         (WebCore::MediaPlayerPrivate::doSeek):
913         (WebCore::MediaPlayerPrivate::cancelSeek):
914         (WebCore::MediaPlayerPrivate::seekTimerFired):
915         (WebCore::MediaPlayerPrivate::setEndTime):
916         (WebCore::MediaPlayerPrivate::startEndPointTimerIfNeeded):
917         (WebCore::MediaPlayerPrivate::endPointTimerFired):
918         (WebCore::MediaPlayerPrivate::paused):
919         (WebCore::MediaPlayerPrivate::seeking):
920         (WebCore::MediaPlayerPrivate::naturalSize):
921         (WebCore::MediaPlayerPrivate::hasVideo):
922         (WebCore::MediaPlayerPrivate::setVolume):
923         (WebCore::MediaPlayerPrivate::setMuted):
924         (WebCore::MediaPlayerPrivate::setRate):
925         (WebCore::MediaPlayerPrivate::dataRate):
926         (WebCore::MediaPlayerPrivate::maxTimeBuffered):
927         (WebCore::MediaPlayerPrivate::maxTimeSeekable):
928         (WebCore::MediaPlayerPrivate::maxTimeLoaded):
929         (WebCore::MediaPlayerPrivate::bytesLoaded):
930         (WebCore::MediaPlayerPrivate::totalBytesKnown):
931         (WebCore::MediaPlayerPrivate::totalBytes):
932         (WebCore::MediaPlayerPrivate::cancelLoad):
933         (WebCore::MediaPlayerPrivate::updateStates):
934         (WebCore::MediaPlayerPrivate::didEnd):
935         (WebCore::MediaPlayerPrivate::setRect):
936         (WebCore::MediaPlayerPrivate::setVisible):
937         (WebCore::MediaPlayerPrivate::paint):
938         (WebCore::MediaPlayerPrivate::getSupportedTypes):
939         (WebCore::MediaPlayerPrivate::movieEnded):
940         (WebCore::MediaPlayerPrivate::movieLoadStateChanged):
941         (WebCore::MediaPlayerPrivate::movieTimeChanged):
942         (WebCore::MediaPlayerPrivate::movieNewImageAvailable):
943         * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.h: Added.
944         (WebCore::MediaPlayerPrivate::networkState):
945         (WebCore::MediaPlayerPrivate::readyState):
946         * platform/graphics/win/QTMovieWin.cpp: Added.
947         (updateTaskTimer):
948         (QTMovieWinPrivate::QTMovieWinPrivate):
949         (QTMovieWinPrivate::~QTMovieWinPrivate):
950         (taskTimerFired):
951         (QTMovieWinPrivate::startTask):
952         (QTMovieWinPrivate::endTask):
953         (QTMovieWinPrivate::task):
954         (QTMovieWinPrivate::registerDrawingCallback):
955         (QTMovieWinPrivate::drawingComplete):
956         (QTMovieWinPrivate::createGWorld):
957         (QTMovieWinPrivate::setSize):
958         (QTMovieWinPrivate::deleteGWorld):
959         (QTMovieWin::QTMovieWin):
960         (QTMovieWin::~QTMovieWin):
961         (QTMovieWin::play):
962         (QTMovieWin::pause):
963         (QTMovieWin::rate):
964         (QTMovieWin::setRate):
965         (QTMovieWin::duration):
966         (QTMovieWin::currentTime):
967         (QTMovieWin::setCurrentTime):
968         (QTMovieWin::setVolume):
969         (QTMovieWin::setMuted):
970         (QTMovieWin::dataSize):
971         (QTMovieWin::maxTimeLoaded):
972         (QTMovieWin::loadState):
973         (QTMovieWin::getNaturalSize):
974         (QTMovieWin::setSize):
975         (QTMovieWin::setVisible):
976         (QTMovieWin::paint):
977         (QTMovieWin::load):
978         (movieDrawingCompleteProc):
979         (initializeSupportedTypes):
980         (QTMovieWin::countSupportedTypes):
981         (QTMovieWin::getSupportedType):
982         (QTMovieWin::initializeQuickTime):
983         (DllMain):
984         * platform/graphics/win/QTMovieWin.h: Added.
985         * platform/graphics/win/QTMovieWinTimer.cpp: Added.
986         (TimerWindowWndProc):
987         (initializeOffScreenTimerWindow):
988         (setSharedTimerFiredFunction):
989         (timerFired):
990         (setSharedTimerFireDelay):
991         (stopSharedTimer):
992         (setSharedTimerInstanceHandle):
993         (systemTime):
994         * platform/graphics/win/QTMovieWinTimer.h: Added.
995         * rendering/RenderMedia.cpp:
996         (WebCore::MediaControlPlayButtonElement::update):
997
998 2007-12-21  Brent Fulgham  <bfulgham@gmail.com>
999
1000         Reviewed by Alp Toker.
1001
1002         http://bugs.webkit.org/show_bug.cgi?id=16558
1003         Cairo WebCore Rendering Fails on arc drawing
1004
1005         Fix for bug reported (and patched) by Apollo team in which
1006         arcs were draw in reverse (resulting in inverted images).
1007         Review of the source found that the 'clockwise' term was
1008         actually meant to mean 'anticlockwise' so the IDL and
1009         supporting classes have been changed to match this. 
1010
1011         * html/CanvasRenderingContext2D.cpp:
1012         (WebCore::CanvasRenderingContext2D::arc):
1013         * html/CanvasRenderingContext2D.idl:
1014         * platform/graphics/cairo/PathCairo.cpp:
1015         (WebCore::Path::addArc):
1016         (WebCore::Path::addEllipse):
1017         * platform/graphics/Path.h:
1018
1019 2007-12-21  Alexey Proskuryakov  <ap@webkit.org>
1020
1021         Reviewed by Oliver.
1022
1023         <rdar://problem/5629995> Incorrect display of Danish characters on web site.
1024
1025         Test: http/tests/xmlhttprequest/response-encoding.html
1026
1027         * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::didReceiveData):
1028         Default to UTF-8 for HTML, too. It's unfortunate that we have to use different
1029         rules for main content and XHR responses, but this matches both IE and Firefox.
1030
1031 2007-12-20  Jon Honeycutt  <jhoneycutt@apple.com>
1032
1033         Reviewed by Kevin Decker.
1034
1035         <rdar://problem/5655797> REGRESSION(304-306A10) Safari does not find
1036         shockwave plugin on freshly installed OS
1037
1038         Look for Director plugin in its native directory.
1039
1040         * plugins/win/PluginDatabaseWin.cpp:
1041         (WebCore::PluginDatabaseWin::getPluginsInPaths): The Director plugin
1042         doesn't start with "np," so special case its filename.
1043         (WebCore::addMacromediaPluginPaths): Add Flash and "Shockwave 10"
1044         directories to the plugin paths.
1045         (WebCore::PluginDatabaseWin::defaultPluginPaths):
1046
1047 2007-12-20  Peter Kasting  <zerodpx@gmail.com>
1048
1049         Reviewed by Alp Toker.
1050
1051         http://bugs.webkit.org/show_bug.cgi?id=16508
1052         Fix regression in GIFImageDecoder.cpp: "Haeberli hack" led to wrongly
1053         decoded transparent areas.
1054
1055         * platform/image-decoders/gif/GIFImageDecoder.cpp:
1056         (WebCore::GIFImageDecoder::haveDecodedRow):
1057         * platform/image-decoders/gif/GIFImageDecoder.h:
1058         * platform/image-decoders/gif/GIFImageReader.cpp:
1059         (GIFImageReader::output_row):
1060
1061 2007-12-20  Justin Garcia  <justin.garcia@apple.com>
1062
1063         Reviewed by Oliver Hunt.
1064
1065         <rdar://problem/5543472> GoogleDocs: Safari hangs when creating a list from a particular selection
1066         
1067         Still need to fix similar issues with the other operations that iterate 
1068         over selected paragraphs, like FormatBlock, Indent and Outdent (<rdar://problem/5658933>).
1069
1070         * editing/IndentOutdentCommand.cpp:
1071         (WebCore::IndentOutdentCommand::indentRegion): Added a FIXME.
1072         * editing/IndentOutdentCommand.h: Removed an unused function.
1073         * editing/InsertListCommand.cpp:
1074         (WebCore::InsertListCommand::modifyRange): 
1075         Renamed visibleStart to startOfSelection and visibleEnd to endOfSelection.
1076         Call the new selectionForParagraphIteration, which a) prevents operations like this
1077         one from being performed on a table that isn't fully selected (where the selection
1078         starts just before the table and ends inside it), and b) helps prevent paragraph
1079         iteration from going past the end of the selection.
1080         Call the new startOfNextParagraph, instead of using endOfParagraph(v).next(),
1081         since when v is in the last paragraph of the last cell of a table, that expression 
1082         will return the position after the table, not the start of the next paragraph.
1083         * editing/htmlediting.cpp:
1084         (WebCore::enclosingListChild): Don't go above a table cell, so that list operations
1085         take effect inside the table cell where they are performed.
1086         (WebCore::selectionForParagraphIteration): Added, see above.
1087         (WebCore::indexForVisiblePosition): Moved from IndentOutdentCommand.cpp.
1088         * editing/htmlediting.h:
1089         * editing/visible_units.cpp:
1090         (WebCore::startOfNextParagraph): Added, see above.
1091         * editing/visible_units.h:
1092         * editing/TextIterator.h:
1093         (WebCore::TextIterator::exitNode): Added a FIXME.
1094
1095 2007-12-20  Alp Toker  <alp@atoker.com>
1096
1097         Rubber-stamped by Maciej.
1098
1099         http://bugs.webkit.org/show_bug.cgi?id=16542
1100         [GTK] Text is missing with old Pango version
1101
1102         Back out commits r28880, r28876, r28865, r28864 which added Pango font
1103         selection support. These changes caused a regression where no text was
1104         displayed with older Pango versions.
1105
1106         * platform/graphics/gtk/FontCacheGtk.cpp:
1107         (WebCore::FontCache::fontExists):
1108         * platform/graphics/gtk/FontDataGtk.cpp:
1109         (WebCore::FontData::platformDestroy):
1110         (WebCore::FontData::containsCharacters):
1111         * platform/graphics/gtk/FontPlatformData.h:
1112         (WebCore::FontPlatformData::FontPlatformData):
1113         (WebCore::FontPlatformData::hash):
1114         * platform/graphics/gtk/FontPlatformDataGtk.cpp:
1115         (WebCore::FontPlatformData::FontPlatformData):
1116         (WebCore::FontPlatformData::init):
1117         (WebCore::FontPlatformData::~FontPlatformData):
1118         (WebCore::FontPlatformData::isFixedPitch):
1119         (WebCore::FontPlatformData::operator==):
1120         * platform/graphics/gtk/GlyphPageTreeNodeGtk.cpp:
1121         (WebCore::GlyphPage::fill):
1122
1123 2007-12-20  Timothy Hatcher  <timothy@apple.com>
1124
1125         Reviewed by Sam Weinig.
1126
1127         <rdar://problem/5604897> Double-clicking on JavaScript console error
1128         won't show the line where it occurred
1129
1130         Make the URLs clickable in the console, since double clicking is used for
1131         word text selection. Makes the word "line" localizable. Messages that don't
1132         have a URL will no longer print "undefined". Messages that have a line number
1133         less than or equal to 0 will no longer be printed.
1134
1135         * English.lproj/InspectorLocalizedStrings.js: Add "%s (line %d)".
1136         * page/inspector/ConsolePanel.js: Tweak how the DOM nodes are created
1137           and change the click handler to look for a link with the
1138           "console-message-url" class name.
1139         * page/inspector/SourcePanel.js: Call setupSourceFrameIfNeeded() if a
1140           line row is needed. 
1141         * page/inspector/inspector.css: Update the look of the URL in the console.
1142
1143 2007-12-20  Adam Barth  <hk9565@gmail.com>
1144
1145         Reviewed and landed by Sam Weinig.
1146
1147         http://bugs.webkit.org/show_bug.cgi?id=15313
1148         <rdar://problem/5514516>
1149
1150         The same-origin check was incorrect in two cases (both fixed in this
1151         patch):
1152
1153         A) If both the source and the target have set their document.domain
1154            to the same value, the protocol must also match in order for
1155            access to be allowed.  Without this requirement, the browser is
1156            vulnerable to the following attack:
1157
1158            1) Suppose there is an HTTPS site (www.example.com) that sets
1159               document.domain = "example.com".
1160            2) A network attacker redirects the browser to http://www.example.com/
1161               a) injects script to set document.domain = "example.com", and
1162               b) opens a window to https://www.example.com/
1163            3) Now the network attacker can inject script into the HTTPS page,
1164               stealing cookies and issuing banking transactions.
1165
1166         B) If only one of the source and target has set document.domain, then
1167            access should be denied.  With this behavior, the browser is
1168            vulnerable to the following attack:
1169
1170            1) Suppose http://foo.example.com/ opens an iframe to
1171               http://foo.example.com/frame.html that
1172               a) sets document.domain = "example.com", and
1173               b) opens an iframe to http://bar.example.com/
1174               This is a common usage of document.domain for cross-domain
1175               communication, see for example:
1176                 http://www.collinjackson.com/research/papers/fp801-jackson.pdf
1177            2) The inner-most iframe, which is from bar.example.com, sets
1178               document.domain = "example.com".
1179            3) Now the inner-most iframe can inject script into the middle
1180               iframe (say via document.write).  This bar.example.com script
1181               now has access to the outer-most frame (from foo.example.com).
1182
1183         Both these changes cause WebKit to match the behavior of Firefox 2 and
1184         IE6 in these cases.  This patch includes regression tests for both
1185         issues.
1186
1187         Internet Explorer 7 and Opera 9 are more strict in that they require
1188         the port numbers to match when both pages have document.domain set.
1189         Opera 9 allows access when only one page has set document.domain, but
1190         this is a security vulnerability.
1191
1192         Tests: http/tests/security/cross-frame-access-child-explicit-domain.html
1193                http/tests/security/cross-frame-access-parent-explicit-domain.html
1194
1195         * bindings/js/kjs_window.cpp:
1196         (KJS::createWindow):
1197         (KJS::Window::allowsAccessFrom):
1198         * dom/Document.cpp:
1199         (WebCore::Document::domain):
1200         (WebCore::Document::setDomain):
1201         (WebCore::Document::initSecurityOrigin):
1202         * dom/Document.h:
1203         (WebCore::Document::securityOrigin):
1204         * loader/FrameLoader.cpp:
1205         (WebCore::FrameLoader::begin):
1206         (WebCore::FrameLoader::checkCallImplicitClose):
1207         (WebCore::FrameLoader::shouldAllowNavigation):
1208         * platform/SecurityOrigin.cpp:
1209         (WebCore::SecurityOrigin::setForURL):
1210         (WebCore::SecurityOrigin::createForFrame):
1211         (WebCore::SecurityOrigin::canAccess):
1212         * platform/SecurityOrigin.h:
1213         (WebCore::SecurityOrigin::domain):
1214         * storage/Database.cpp:
1215         (WebCore::Database::openDatabase):
1216         (WebCore::Database::Database):
1217         (WebCore::Database::securityOriginData):
1218         * storage/Database.h:
1219         (WebCore::Database::databaseDebugName):
1220         * storage/DatabaseTracker.cpp:
1221         (WebCore::DatabaseTracker::canEstablishDatabase):
1222         * storage/SQLTransaction.cpp:
1223         (WebCore::SQLTransaction::postflightAndCommit):
1224         (WebCore::SQLTransaction::cleanupAfterTransactionErrorCallback):
1225
1226 2007-12-20  Rodney Dawes  <dobey@wayofthemonkey.com>
1227
1228         Reviewed by Darin Adler.
1229
1230         Define XP_UNIX when building with plugins on X11.
1231         Use new npruntime_internal.h instead of npruntime.h.
1232         http://bugs.webkit.org/show_bug.cgi?id=15669
1233
1234         * ForwardingHeaders/bindings/npruntime_internal.h
1235         * WebCore.pro:
1236         * html/HTMLPlugInElement.h:
1237
1238 2007-12-19  johnnyding.webkit  <johnnyding.webkit@gmail.com>
1239
1240         Reviewed by Alexey. Landed by Stephanie.
1241
1242         - fix http://bugs.webkit.org/show_bug.cgi?id=16179 | <rdar://problem/5619399>
1243           Any attribute name start with a unicode which like #xx00(x could be any hex number[0-9a-f]) will cause HTMLTokenizer parse error
1244           Actually any unicode characters which great than 255 in attribute name will cause Webkit parse the attribute name wrong. So after comparing 
1245           the same scenario in IE 6/7, FireFox 2/3, Opera, we should treat those characters as part of attribute name.
1246
1247
1248         * html/HTMLTokenizer.cpp:
1249         (WebCore::HTMLTokenizer::parseEntity): Handle Unicode Entity Name by using ASCII version of findEntity.
1250         (WebCore::HTMLTokenizer::parseTag): Let type of ptr match type of cBuffer.
1251         * html/HTMLTokenizer.h: Change type of cBuffer from char to UChar.
1252
1253 2007-12-20  Eric Seidel  <eric@webkit.org>
1254
1255         Reviewed by Nikolas Zimmermann.
1256
1257         WebKit claims to support SVG feature strings it shouldn't
1258         http://bugs.webkit.org/show_bug.cgi?id=15480
1259
1260         * dom/DOMImplementation.cpp:
1261         (WebCore::isSVG10Feature):
1262         (WebCore::isSVG11Feature):
1263
1264 2007-12-20  John Sullivan  <sullivan@apple.com>
1265
1266         Reviewed by Oliver and Geoff
1267         
1268         - fix <rdar://problem/5536858> Yellow highlight for find results is sometimes shorter 
1269           than white "hole" behind it
1270
1271         * rendering/RenderText.cpp:
1272         (WebCore::RenderText::addLineBoxRects):
1273         respect useSelectionHeight in all cases; we were only respecting it in one of the two cases
1274
1275 2007-12-20  Dan Bernstein  <mitz@apple.com>
1276
1277         Reviewed by Darin Adler.
1278
1279         - fix <rdar://problem/5656368> REGRESSION(3.0.4-ToT): Acid2 test fails to render anything
1280
1281         * platform/win/ScrollViewWin.cpp:
1282         (WebCore::ScrollView::maximumScroll): Changed back to return the maximum
1283         scroll offsets even if scrolling is not allowed, because navigation and
1284         scrollTo should still work.
1285         (WebCore::ScrollView::wheelEvent): Added early return if scrolling is
1286         not allowed.
1287
1288 2007-12-17  Tony Chang  <idealisms@gmail.com>
1289
1290         Reviewed by Darin.
1291
1292         - Fix for http://bugs.webkit.org/show_bug.cgi?id=16479
1293           text selection does not always begin at mouse down point
1294           Reset the m_dragSrc object on mouse down on all platforms.
1295
1296         Test: fast/text/reset-drag-on-mouse-down.html
1297
1298         * page/EventHandler.cpp:
1299         (WebCore::EventHandler::handleMousePressEvent):
1300         * page/mac/EventHandlerMac.mm:
1301         (WebCore::EventHandler::mouseDown):
1302
1303 2007-12-19  Geoffrey Garen  <ggaren@apple.com>
1304
1305         Reviewed by Oliver Hunt.
1306
1307         Build support:
1308         * ForwardingHeaders/kjs/SymbolTable.h: Added.
1309         * ForwardingHeaders/wtf/VectorTraits.h: Added.
1310
1311         * bindings/js/JSDOMWindowCustom.cpp:
1312         (WebCore::JSDOMWindow::customGetOwnPropertySlot): Replaced use of
1313         getDirectLocation with getOwnPropertySlot. getDirectLocation is no
1314         longer valid, since global declarations are not stored in the property
1315         map.
1316
1317         (WebCore::JSDOMWindow::customPut): Replaced use of JSObject::put with
1318         JSGlobalObject::put. JSObject::put is no longer valid, since global
1319         declarations are not stored in the property map.
1320
1321         * bindings/js/kjs_window.cpp: Replaced JSObject:: calls with Base::
1322         calls, since JSObject is not our base class. This was always a bug, but
1323         the bug is even more apparent after some of my changes.
1324
1325         (KJS::Window::clear): Removed call to clearProperties because
1326         JSGlobalObject::reset takes care of that now.
1327
1328         * history/CachedPage.cpp:
1329         * history/CachedPage.h: Added support for saving a symbol table and
1330         localStorage to the page cache, and restoring it.
1331
1332 2007-12-19  Dan Bernstein  <mitz@apple.com>
1333
1334         Reviewed by Darin Adler and Dave Hyatt.
1335
1336         - Substitute the user's preferred standard font for an unknown primary
1337           font before falling back on the platform's last resort font
1338
1339         Cannot be tested in DumpRenderTree because it sets the standard font to
1340         Times, which is also the hard-coded last resort font on Mac.
1341
1342         * css/CSSFontSelector.cpp:
1343         (WebCore::CSSFontSelector::getFontData): Changed the early bail out
1344         condition to allow getting generic font families from settings even if
1345         there are not @font-face rules. Fixed a typo that mapped fantasy to
1346         cursive. Added a mapping from -webkit-standard to the standard family.
1347         * css/CSSStyleSelector.cpp:
1348         (WebCore::CSSStyleSelector::CSSStyleSelector): Changed to always create
1349         a font selector.
1350         (WebCore::CSSRuleSet::addRulesFromSheet):
1351         (WebCore::CSSStyleSelector::applyProperty): Changed to always use the
1352         font selector.
1353         * css/CSSStyleSelector.h:
1354         (WebCore::CSSStyleSelector::fontSelector):
1355         * platform/graphics/FontCache.cpp:
1356         (WebCore::FontCache::getFontData): Try the user's preferred standard
1357         font before the platform's last resort font.
1358
1359 2007-12-19  Sven Herzberg  <sven@imendio.com>
1360
1361         Reviewed by Alp Toker.
1362
1363         Scaled font destruction takes place in FontData::platformDestroy(). No
1364         need to do it in FontPlatformData::~FontPlatformData().
1365
1366         Destroying platform data in platformDestroy() is a convention we
1367         borrow from the Mac and Win ports.
1368
1369         * platform/graphics/gtk/FontPlatformDataGtk.cpp:
1370
1371 2007-12-19  Alice Liu  <alice.liu@apple.com>
1372
1373         build fix (Windows)
1374
1375         Changed uint to unsigned int.  uint caused Windows build breakage
1376
1377         * page/Page.cpp:
1378         (WebCore::Page::markAllMatchesForText):
1379         * page/Page.h:
1380
1381 2007-12-19  Christian Dywan  <christian@twotoasts.de> 
1382
1383         Reviewed by Alp Toker.
1384
1385         http://bugs.webkit.org/show_bug.cgi?id=16222
1386         [GTK] Implement inline search and highlighting of matching strings.
1387
1388         Implement search and highlighting logic directly in WebCore.
1389
1390         * page/Page.cpp:
1391         (WebCore::incrementFrame):
1392         (WebCore::Page::findString):
1393         (WebCore::Page::markAllMatchesForText):
1394         (WebCore::Page::unmarkAllTextMatches):
1395         * page/Page.h:
1396
1397 2007-12-19  Geoffrey Garen  <ggaren@apple.com>
1398
1399         Reviewed by Sam Weinig, Dan Bernstein.
1400
1401         Tiger build fix: restored some graphics code still needed on Tiger.
1402
1403         * platform/graphics/GraphicsTypes.h:
1404         * platform/graphics/cg/GraphicsContextCG.cpp:
1405         * platform/graphics/mac/GraphicsContextMac.mm:
1406         (WebCore::GraphicsContext::setCompositeOperation):
1407
1408 2007-12-19  Alp Toker  <alp@atoker.com>
1409
1410         Build fix for Pango < 1.18.0 breakage introduced in r28864. Use Fc and
1411         the Pango backend API in these cases.
1412
1413         * platform/graphics/gtk/FontPlatformDataGtk.cpp:
1414         (WebCore::FontPlatformData::FontPlatformData):
1415         (WebCore::FontPlatformData::~FontPlatformData):
1416
1417 2007-12-19  Alice Liu  <alice.liu@apple.com>
1418
1419         Reviewed by Darin.
1420
1421         Fixed <rdar://problem/5592485> Safari crashed trying to get a motorcycle insurance quote
1422         on Geico.com WebCore::Document::inPageCache()
1423
1424         Calling Node::willRemove on the focusedNode would immediately tell the document to remove
1425         the focused node, and trigger JS events.  This means that the document is mutated while
1426         the engine is trying to tell all child nodes that it's about to removed.  To avoid
1427         crashing, we need to hold off on mutating the document until node traversal is finished.
1428
1429         * dom/ContainerNode.cpp:
1430         (WebCore::ContainerNode::removeChild):
1431         (WebCore::ContainerNode::removeChildren):
1432         * dom/Node.cpp:
1433         * dom/Node.h:
1434         (WebCore::Node::willRemove):
1435         * loader/FrameLoader.cpp:
1436         (WebCore::FrameLoader::clear):
1437
1438 2007-12-19  Andre Boule  <aboule@apple.com>
1439
1440         Reviewed by Dan Bernstein.
1441
1442         Test: fast/canvas/canvas-composite.html
1443
1444         Fix for:
1445         <rdar://problem/5640059> GraphicsContext::setCompositeOperation should use CGContextSetBlendMode
1446
1447         This fix makes setCompositeOperation consistent across all platforms that use CG.
1448
1449         The following compositing modes don't pass however that is covered by another bug:
1450         source-in
1451         source-out
1452         destination-in
1453         destination-atop
1454         copy
1455         <rdar://problem/5651783> Some canvas tag compositing modes don't render correctly
1456
1457         * platform/graphics/GraphicsTypes.h:
1458         * platform/graphics/cg/GraphicsContextCG.cpp:
1459         (WebCore::GraphicsContext::setCompositeOperation):
1460         * platform/graphics/mac/GraphicsContextMac.mm:
1461         * platform/win/GraphicsContextWin.cpp:
1462
1463 2007-12-19  Dan Bernstein  <mitz@apple.com>
1464
1465         Reviewed by Dave Hyatt.
1466
1467         - fix <rdar://problem/5650045> REGRESSION: major layout problems in svn r28754 WebKit on Vox.com page
1468
1469         Test: fast/dynamic/subtree-boundary-percent-height.html
1470
1471         * rendering/RenderObject.cpp:
1472         (WebCore::objectIsRelayoutBoundary): Do not allow overflows with
1473         percent heights because sometimes they compute to 'auto'.
1474
1475 2007-12-19  Sam Weinig  <sam@webkit.org>
1476
1477         Reviewed by Maciej.
1478
1479         http://bugs.webkit.org/show_bug.cgi?id=16511
1480         Speed up ClassNodeList and NamedNodeList by using the caching mechanism employed by ChildNodeList.
1481         - This give a ~2.15x speedup on the native test @ http://ejohn.org/apps/classname/
1482
1483         * dom/ChildNodeList.cpp: Use the caching NodeList constructor to turn on caching.
1484         (WebCore::ChildNodeList::ChildNodeList):
1485         * dom/ClassNodeList.cpp:
1486         (WebCore::ClassNodeList::ClassNodeList):
1487         * dom/ClassNodeList.h:
1488
1489         Move getElementsByName and getElementsByClassName to Node so they
1490         can use easily employ the caching already used by ChildNodeLists.  In the case of 
1491         getElementsByClassName, this reduces code duplication in Element as well
1492         * dom/Document.cpp:
1493         * dom/Document.h:
1494
1495         Move getElementsByClassName to Node.
1496         * dom/Element.cpp:
1497         * dom/Element.h:
1498
1499         * dom/NameNodeList.cpp: Use the caching NodeList constructor to turn on caching.
1500         (WebCore::NameNodeList::NameNodeList):
1501         (WebCore::NameNodeList::item):
1502         * dom/NameNodeList.h:
1503
1504         Add maps of caches for ClassNodeLists and NameNodeList to NodeListsNodeData.
1505         * dom/Node.cpp:
1506         (WebCore::TagNodeList::TagNodeList):
1507         (WebCore::Node::Node):
1508         (WebCore::Node::~Node):
1509         (WebCore::Node::childNodes):
1510         (WebCore::Node::registerNodeList):
1511         (WebCore::Node::getElementsByName):
1512         (WebCore::Node::getElementsByClassName):
1513         * dom/Node.h: Make m_nodeLists an OwnPtr.  Moved getElementsByName and getElementsByClassName here
1514
1515         Allow subclasses to choose whether they want to receive the notifications using a new bit.
1516         * dom/NodeList.cpp:
1517         (WebCore::NodeList::NodeList):
1518         * dom/NodeList.h:
1519         (WebCore::NodeList::needsNotifications):
1520
1521 2007-12-19  Dave Hyatt  <hyatt@apple.com>
1522
1523         Add support for GDI text rendering to WebKit.
1524       
1525         Reviewed by mitz
1526         
1527         * css/CSSStyleSelector.cpp:
1528         (WebCore::CSSStyleSelector::applyProperty):
1529         * dom/Document.cpp:
1530         (WebCore::Document::recalcStyle):
1531         * page/Settings.cpp:
1532         (WebCore::Settings::setFontRenderingMode):
1533         (WebCore::Settings::fontRenderingMode):
1534         * page/Settings.h:
1535         * platform/graphics/Font.h:
1536         (WebCore::Font::renderingMode):
1537         * platform/graphics/FontCache.cpp:
1538         (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
1539         (WebCore::FontPlatformDataCacheKey::operator==):
1540         (WebCore::computeHash):
1541         (WebCore::FontCache::getCachedFontPlatformData):
1542         * platform/graphics/FontDescription.h:
1543         (WebCore::):
1544         (WebCore::FontDescription::FontDescription):
1545         (WebCore::FontDescription::renderingMode):
1546         (WebCore::FontDescription::setRenderingMode):
1547         (WebCore::FontDescription::operator==):
1548         * platform/graphics/GraphicsContext.h:
1549         * platform/graphics/win/FontCacheWin.cpp:
1550         (WebCore::FontCache::fontExists):
1551         (WebCore::FontCache::createFontPlatformData):
1552         * platform/graphics/win/FontDataWin.cpp:
1553         (WebCore::FontData::platformInit):
1554         (WebCore::FontData::smallCapsFontData):
1555         (WebCore::FontData::containsCharacters):
1556         (WebCore::FontData::determinePitch):
1557         (WebCore::FontData::platformWidthForGlyph):
1558         * platform/graphics/win/FontPlatformData.h:
1559         (WebCore::FontPlatformData::FontPlatformData):
1560         (WebCore::FontPlatformData::useGDI):
1561         (WebCore::FontPlatformData::operator==):
1562         * platform/graphics/win/FontPlatformDataWin.cpp:
1563         (WebCore::FontPlatformData::FontPlatformData):
1564         * platform/graphics/win/FontWin.cpp:
1565         (WebCore::Font::drawGlyphs):
1566         * platform/graphics/win/IconWin.cpp:
1567         (WebCore::Icon::paint):
1568         * platform/win/GraphicsContextWin.cpp:
1569         (WebCore::GraphicsContext::getWindowsContext):
1570         (WebCore::GraphicsContext::releaseWindowsContext):
1571         * platform/win/UniscribeController.cpp:
1572         (WebCore::UniscribeController::shapeAndPlaceItem):
1573         * platform/win/UniscribeController.h:
1574         * plugins/win/PluginViewWin.cpp:
1575         (WebCore::PluginViewWin::paint):
1576
1577 2007-12-19  Sven Herzberg  <sven@imendio.com>
1578
1579         Reviewed by Alp Toker.
1580
1581         Replace the fontconfig/freetype based font management with a pango
1582         based one. Fixes:
1583         http://bugs.webkit.org/show_bug.cgi?id=15229
1584
1585         * platform/gtk/FontDataGtk.cpp (FontData::platformDestroy()): updated
1586         the platform specific destroy code
1587         (FontData::containsCharacters()): implemented font coverage with pango
1588         * platform/gtk/FontPlatformData.h: replaced fontconfig specific
1589         members with pango-specific ones
1590         * platform/gtk/FontPlatformDataGtk.cpp: added static members for the
1591         FontPlatformData class
1592         (FontPlatformData::FontPlatformData()): implemented the font-matching
1593         with a PangoFontDescription instead of an FcPattern; initialize the
1594         scaled font by using the API for PangoCairoFont
1595         (FontPlatformData::init()): initialize the PangoFontMap and set up a
1596         hash table to translate the font family name into a font family
1597         (FontPlatformData::isFixedPitch()): implemented by querying the
1598         PangoFontFamily
1599         (FontPlatformData::operator==): compare the FontPlatformData by
1600         comparing the font pointers or the described fonts
1601         * platform/gtk/GlyphPageTreeNodeGtk.cpp (pango_font_get_glyph()):
1602         added a function to query a glyph from a PangoFont
1603         (GlyphPage::fill()): implemented the fill function with Pango instead
1604         of fontconfig/freetype
1605
1606 2007-12-19  Alp Toker  <alp@atoker.com>
1607
1608         Reviewed by Holger Freyther.
1609
1610         Improve graphics operator approximations
1611         
1612         These changes match Cairo's own CG approximations.
1613
1614         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1615         (WebCore::toCairoOperator):
1616
1617 2007-12-19  Alp Toker  <alp@atoker.com>
1618
1619         Reviewed by Holger Freyther.
1620
1621         Check the bounding box before doing a full hit test
1622
1623         * platform/graphics/cairo/PathCairo.cpp:
1624         (WebCore::Path::contains):
1625
1626 2007-12-18  Sam Weinig  <sam@webkit.org>
1627
1628         Reviewed by Geoff.
1629
1630         Fix for <rdar://problem/5646478>
1631         REGRESSION: fast/events/event-view-toString fails on Leopard
1632
1633         This fixes an issue where we were incorrectly setting the lastInPrototypeChain
1634         for the JSDOMWindow (the global object) before a call to setPrototype overwrote
1635         it. This fixes it by passing the prototype up the constructor chain so that it
1636         is set before any calls can be made.
1637
1638         * bindings/js/kjs_window.cpp:
1639         (KJS::Window::Window):
1640         * bindings/js/kjs_window.h:
1641         * bindings/scripts/CodeGeneratorJS.pm:
1642
1643 2007-12-18  Beth Dakin  <bdakin@apple.com>
1644
1645         Reviewed by Oliver.
1646
1647         Fix for <rdar://problem/5616982> SVGs with width and height 100% 
1648         fail to render when used as <img> or CSS image (16167)
1649
1650         This final part of the work fixes the <img> tag.
1651
1652         This is the real fix. 
1653         * rendering/RenderImage.cpp:
1654         (WebCore::RenderImage::calcReplacedWidth): Set the container size 
1655         on the image. Setting the container size only actually sticks if 
1656         the values are non-zero, so if the container size really was set, 
1657         use the imageSize that is calculated using the container size. If 
1658         it did not stick but the image does have relative width (meaning 
1659         that the container size is 0), set the width to 0 by hand. We want 
1660         to avoid setting the width before we have a container size or we 
1661         will end up incorrectly using the default size of 300x150.
1662         (WebCore::RenderImage::calcReplacedHeight): Same as above, but for 
1663         height.
1664
1665         A few more pieces of information have to be exposed through cached 
1666         image to make this happen.
1667         * loader/CachedImage.cpp:
1668         (WebCore::CachedImage::usesImageContainerSize): As mentioned above, 
1669         when setContainerSize() is called, the container size is only 
1670         actually set if the values are non-zero. This call tells you if it 
1671         was set.
1672         (WebCore::CachedImage::imageHasRelativeWidth):
1673         (WebCore::CachedImage::imageHasRelativeHeight):
1674         * loader/CachedImage.h:
1675         * platform/graphics/Image.h:
1676         (WebCore::Image::usesContainerSize):
1677         * svg/graphics/SVGImage.cpp:
1678         (WebCore::SVGImage::usesContainerSize):
1679         * svg/graphics/SVGImage.h:
1680
1681 2007-12-18  Mark Rowe  <mrowe@apple.com>
1682
1683         Rubber-stamped by Maciej Stachowiak.
1684
1685         Remove outdated and non-functioning project files for the Apollo port.
1686
1687         * WebCore.apolloproj: Removed.
1688
1689 2007-12-18  Steve Falkenburg  <sfalken@apple.com>
1690
1691         <rdar://problem/5649911> REGRESSION (304-306A9): Typing 'p' in popup menu for type-to-select brings up Safari Help
1692         
1693         Need to translate the char back into a key code for posting our WM_KEYDOWN.
1694         
1695         Reviewed by Ada.
1696
1697         * platform/win/PopupMenuWin.cpp:
1698         (WebCore::PopupWndProc):
1699
1700 2007-12-18  Steve Falkenburg  <sfalken@apple.com>
1701
1702         <rdar://problem/5651534> REGRESSION(r28764-r28765): GDI leak drawing text when no appropriate font is available
1703         
1704         Our captured metafile from Uniscribe may contain multiple calls to CreateFontIndirect.
1705         Only create a font with the last one.
1706         
1707         Reviewed by Mitz, Darin.
1708
1709         * platform/graphics/win/FontCacheWin.cpp:
1710         (WebCore::metaFileEnumProc):
1711         (WebCore::FontCache::getFontDataForCharacters):
1712
1713 2007-12-17  Brent Fulgham  <bfulgham@gmail.com>
1714
1715         Reviewed by Darin.
1716
1717         http://bugs.webkit.org/show_bug.cgi?id=16464
1718         Modify WebCore to use win32 thread primitives
1719
1720         Updates to support native windows threading primitives
1721         rather than pthreads emulation library.
1722
1723         * WebCore.vcproj/WebCore.vcproj:
1724         * config.h:
1725         * platform/Threading.h:
1726         * platform/win/MutexWin.cpp: Added.
1727         (WebCore::Mutex::Mutex):
1728         (WebCore::Mutex::~Mutex):
1729         (WebCore::Mutex::lock):
1730         (WebCore::Mutex::tryLock):
1731         (WebCore::Mutex::unlock):
1732         * platform/win/ThreadConditionWin.cpp: Added.
1733         (WebCore::ThreadCondition::ThreadCondition):
1734         (WebCore::ThreadCondition::~ThreadCondition):
1735         (WebCore::ThreadCondition::wait):
1736         (WebCore::ThreadCondition::signal):
1737         (WebCore::ThreadCondition::broadcast):
1738         * platform/win/ThreadingWin.cpp:
1739         (WebCore::threadMapMutex):
1740         (WebCore::threadMap):
1741         (WebCore::storeThreadHandleByIdentifier):
1742         (WebCore::identifierByThreadHandle):
1743         (WebCore::threadHandleForIdentifier):
1744         (WebCore::clearThreadHandleForIdentifier):
1745         (WebCore::createThread):
1746         (WebCore::waitForThreadCompletion):
1747         (WebCore::detachThread):
1748         (WebCore::currentThread):
1749
1750 2007-12-18  Rodney Dawes  <dobey@wayofthemonkey.com>
1751
1752         Reviewed by Darin Adler.
1753
1754         Handle EINTR when set by select() and try the select() again
1755         http://bugs.webkit.org/show_bug.cgi?id=16071
1756
1757         * platform/network/curl/ResourceHandleManager.cpp:
1758         (ResourceHandleManager::downloadTimerCallback):
1759
1760 2007-12-18  Dan Bernstein  <mitz@apple.com>
1761
1762         Reviewed by Dave Hyatt.
1763
1764         - avoid the simplified Chinese font linking code for characters that are
1765           not in any Windows code page
1766
1767         * platform/graphics/win/FontCacheWin.cpp:
1768         (WebCore::FontCache::getFontDataForCharacters):
1769
1770 2007-12-18  Brady Eidson <beidson@apple.com>
1771
1772         Reviewed by Adele
1773
1774         <rdar://problem/5525770> REGRESSION: HTTP Auth protected favicon request results in a password sheet
1775
1776         Some http-auth protected sites have the main resource(s) unprotected, but many subresources are
1777         protected by authentication.  Occasionally one can view the main page of a site but the favicon
1778         is behind the iron curtain - in these cases, we should *not* prompt for a username and password
1779         solely for the favicon.
1780
1781         * loader/ResourceLoader.h: Make didReceiveAuthenticationChallenge virtual
1782
1783         * loader/SubresourceLoader.cpp:
1784         (WebCore::SubresourceLoader::didReceiveAuthenticationChallenge): Now that this method
1785           is virtual from ResourceLoader, SubresourceLoader can override.  First call to the 
1786           SubresourceLoaderClient.  If they cancel the resource load, return early. Otherwise, let
1787           ResourceLoader work its magic (resulting in the auth sheet coming down)
1788         * loader/SubresourceLoader.h:
1789
1790         * loader/SubresourceLoaderClient.h:
1791         (WebCore::SubresourceLoaderClient::didReceiveAuthenticationChallenge):
1792
1793         * loader/icon/IconLoader.cpp:
1794         (WebCore::IconLoader::didReceiveAuthenticationChallenge): Cancel the resource load, since we should
1795           never prompt the user for credentials just for a favicon.
1796         * loader/icon/IconLoader.h:
1797
1798 2007-12-18  John Sullivan  <sullivan@apple.com>
1799
1800         Reviewed by Brady
1801         
1802         - fixed <rdar://problem/5652380> Initial prompt shows "" for databases with no user-visible name
1803
1804         * storage/DatabaseTracker.cpp:
1805         (WebCore::DatabaseTracker::canEstablishDatabase):
1806         pass "name" instead of "displayName" if there's no displayName
1807
1808 2007-12-17  Dan Bernstein  <mitz@apple.com>
1809
1810         Reviewed by Maciej Stachowiak.
1811
1812         - restore ButtonFace and ThreeDFace to their previous values for non-Mac
1813           platforms. The Mac port also uses the same values for now instead
1814           of NSColor-based ones.
1815
1816         * rendering/RenderTheme.cpp:
1817         (WebCore::RenderTheme::systemColor):
1818
1819 2007-12-17  Rodney Dawes  <dobey@wayofthemonkey.com>
1820
1821         Reviewed by Maciej Stachowiak.
1822
1823         Define WTF_USE_NPOBJECT and WTF_USE_JAVASCRIPTCORE_BINDINGS for GTK+
1824         Add required Frame::createScriptInstanceForWidget to FrameGtk
1825
1826         * config.h:
1827         * page/gtk/FrameGtk.cpp (Frame::createScriptInstanceForWidget):
1828
1829 2007-12-17  Alice Liu  <alice.liu@apple.com>
1830
1831         Reviewed by Adam.
1832
1833         Fixed <rdar://5566435> window with no scrollbars can be scrolled
1834
1835         * platform/win/ScrollViewWin.cpp:
1836         (WebCore::ScrollView::maximumScroll):
1837         corrected maximumScroll() to account for scrolling not allowed.
1838         (WebCore::ScrollView::wheelEvent):
1839
1840 2007-12-14  Juan A. Suarez Romero  <jasuarez@igalia.com>
1841
1842         Reviewed by Alp Toker.
1843
1844         http://bugs.webkit.org/show_bug.cgi?id=16042
1845         [GTK] Eliminate webkit_init()
1846
1847         Move webkit initialization to WebView class init.
1848
1849         * WebCore.pro:
1850
1851 2007-12-17  Jon Honeycutt  <jhoneycutt@apple.com>
1852
1853         Reviewed by Darin.
1854
1855         <rdar://problem/5651291> REGRESSION: Flash content doesn't display
1856         (www.adobe.com)
1857
1858         We were passing NPEvent** instead of NPEvent* to NPP_HandleEvent.
1859
1860         * plugins/win/PluginViewWin.cpp:
1861         (WebCore::PluginViewWin::dispatchNPEvent): Changed to take NPEvent&, not
1862         NPEvent*
1863         (WebCore::PluginViewWin::paint): Pass NPEvent, not NPEvent*
1864         (WebCore::PluginViewWin::handleKeyboardEvent): same
1865         (WebCore::PluginViewWin::handleMouseEvent): same
1866         * plugins/win/PluginViewWin.h:
1867
1868 2007-12-17  Alexey Proskuryakov  <ap@webkit.org>
1869
1870         Reviewed by Darin.
1871
1872         Live to the promise of never making AppKit special character codes visible via DOM.
1873
1874         Test: fast/events/arrow-keys-on-body.html
1875
1876         * page/EventHandler.cpp:
1877         (WebCore::EventHandler::keyEvent): Check for empty keypress characters after disambiguation,
1878         to let quirks-aware code strip special charactrers.
1879         * platform/mac/KeyEventMac.mm:
1880         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): If not in keyboard event quirks
1881         mode, remove the text if it's a special character.
1882
1883 2007-12-17  Mark Rowe  <mrowe@apple.com>
1884
1885         Reviewed by Darin Adler.
1886
1887         Fix incorrect array size and incorrect array index in convertNSColorToColor.
1888
1889         * rendering/RenderThemeMac.mm:
1890         (WebCore::convertNSColorToColor):
1891
1892 2007-12-17  Darin Adler  <darin@apple.com>
1893
1894         Reviewed by Mark Rowe.
1895
1896         - fix http://bugs.webkit.org/show_bug.cgi?id=16468
1897           REGRESSION(r28781): Crash running storage/transaction_callback_exception_crash.html
1898
1899         * storage/DatabaseThread.cpp:
1900         (WebCore::DatabaseThread::dispatchNextTaskIdentifier): Use a RefPtr for the database
1901         because there's no guarantee it won't lose its last reference otherwise.
1902
1903 2007-12-17  Dan Bernstein  <mitz@apple.com>
1904
1905         Reviewed by Maciej Stachowiak.
1906
1907         - fix <rdar://problem/5333260> Some Chinese characters in Text Encoding menu are bold, others are not
1908           and <rdar://problem/5280188> Chinese text looks worse on Safari for Windows cf. Safari for Mac
1909
1910         * platform/graphics/win/FontCacheWin.cpp:
1911         (WebCore::FontCache::getFontDataForCharacters): To ensure that font
1912         linking gives consistent results for characters that are exclusive to
1913         the simplified Chinese code page and characters that belong to that
1914         code page and other code pages, always ask to map to simplified Chinese
1915         alone first.
1916
1917 2007-12-17  Christian Dywan  <christian@twotoasts.de>
1918
1919         Reviewed by Alp Toker.
1920
1921         http://bugs.webkit.org/show_bug.cgi?id=16378
1922         Implement Icon for Gtk
1923
1924         Icon provides a GdkPixbuf containing a themed icon.
1925         The icon theme is probed for an icon name according to the
1926         Icon Naming Specification or conventional Gnome icon names respectively.
1927
1928         See http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
1929
1930         * platform/graphics/Icon.h:
1931         * platform/graphics/gtk/IconGtk.cpp:
1932         (WebCore::Icon::~Icon):
1933         (WebCore::lookupIconName):
1934         (WebCore::Icon::newIconForFile):
1935         (WebCore::Icon::paint):
1936
1937 2007-12-16  Sam Weinig  <sam@webkit.org>
1938
1939         Reviewed by Mitz.
1940
1941         Fix for http://bugs.webkit.org/show_bug.cgi?id=16466
1942         Move the JS Location object to its own file
1943
1944         - Move Location into its own file and rename it JSLocation.
1945
1946         * DerivedSources.make:
1947         * WebCore.pro:
1948         * WebCore.vcproj/WebCore.vcproj:
1949         * WebCore.xcodeproj/project.pbxproj:
1950         * WebCoreSources.bkl:
1951         * bindings/js/JSDocumentCustom.cpp:
1952         * bindings/js/JSLocation.cpp: Copied from WebCore/bindings/js/kjs_window.cpp.
1953         (WebCore::):
1954         (WebCore::JSLocation::JSLocation):
1955         (WebCore::JSLocation::getValueProperty):
1956         (WebCore::JSLocation::getOwnPropertySlot):
1957         (WebCore::JSLocation::put):
1958         (WebCore::JSLocationProtoFuncReplace::callAsFunction):
1959         (WebCore::JSLocationProtoFuncReload::callAsFunction):
1960         (WebCore::JSLocationProtoFuncAssign::callAsFunction):
1961         (WebCore::JSLocationProtoFuncToString::callAsFunction):
1962         * bindings/js/JSLocation.h: Copied from WebCore/bindings/js/kjs_window.h.
1963         (WebCore::JSLocation::):
1964         (WebCore::JSLocation::frame):
1965         (WebCore::JSLocation::classInfo):
1966         * bindings/js/kjs_window.cpp:
1967         (KJS::Window::location):
1968         * bindings/js/kjs_window.h:
1969         * history/CachedPage.cpp:
1970
1971 2007-12-16  Dan Bernstein  <mitz@apple.com>
1972
1973         Reviewed by Sam Weinig.
1974
1975         - make 'cursor: copy' and 'cursor: none' work.
1976
1977         Already covered by manual-tests/cursor.html
1978
1979         * rendering/RenderStyle.h: Increase the _cursor_style field to 6 bits,
1980         needed for the 33rd and 34th cursor values.
1981
1982 2007-12-16  Mark Rowe  <mrowe@apple.com>
1983
1984         Reviewed by Maciej Stachowiak.
1985
1986         Refactor Mac plugin stream code to use the shared NetscapePlugInStreamLoader implementation.
1987
1988         * WebCore.base.exp:
1989         * WebCore.xcodeproj/project.pbxproj:
1990         * loader/NetscapePlugInStreamLoader.h:
1991         * loader/mac/NetscapePlugInStreamLoaderMac.mm: Removed.
1992         * loader/mac/WebPlugInStreamLoaderDelegate.h: Moved to WebKit.
1993
1994 2007-12-16  Sam Weinig  <sam@webkit.org>
1995
1996         Reviewed by Maciej.
1997
1998         Yet more of http://bugs.webkit.org/show_bug.cgi?id=16385
1999         Cleanup kjs_window
2000
2001         - Move ScheduledAction into its own file and put it in the WebCore namespace.
2002
2003         * WebCore.pro:
2004         * WebCore.vcproj/WebCore.vcproj:
2005         * WebCore.xcodeproj/project.pbxproj:
2006         * WebCoreSources.bkl:
2007         * bindings/js/PausedTimeouts.cpp:
2008         * bindings/js/PausedTimeouts.h:
2009         * bindings/js/ScheduledAction.cpp: Copied from bindings/js/kjs_window.cpp.
2010         (WebCore::ScheduledAction::ScheduledAction):
2011         (WebCore::ScheduledAction::execute):
2012         * bindings/js/ScheduledAction.h: Copied from bindings/js/kjs_window.h.
2013         (WebCore::ScheduledAction::ScheduledAction):
2014         * bindings/js/kjs_window.cpp:
2015         (KJS::DOMWindowTimer::DOMWindowTimer):
2016         (KJS::DOMWindowTimer::action):
2017         (KJS::DOMWindowTimer::takeAction):
2018         (KJS::Window::installTimeout):
2019         (KJS::Window::timerFired):
2020         * bindings/js/kjs_window.h:
2021
2022 2007-12-16  Alp Toker  <alp@atoker.com>
2023
2024         Reviewed by Maciej.
2025
2026         http://bugs.webkit.org/show_bug.cgi?id=16356
2027         [GTK] Integrate GStreamer video with the graphics backend
2028
2029         Integrate the GStreamer media backend with the Cairo graphics backend.
2030         There are still some issues: Data is copied more often than necessary,
2031         and repaint() is not called, causing transformed video not to update
2032         sometimes.
2033
2034         * WebCore.pro:
2035         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
2036         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
2037         (WebCore::MediaPlayerPrivate::~MediaPlayerPrivate):
2038         (WebCore::MediaPlayerPrivate::currentTime):
2039         (WebCore::MediaPlayerPrivate::setEndTime):
2040         (WebCore::MediaPlayerPrivate::seeking):
2041         (WebCore::MediaPlayerPrivate::naturalSize):
2042         (WebCore::MediaPlayerPrivate::setMuted):
2043         (WebCore::MediaPlayerPrivate::setRect):
2044         (WebCore::MediaPlayerPrivate::setVisible):
2045         (WebCore::MediaPlayerPrivate::repaint):
2046         (WebCore::MediaPlayerPrivate::paint):
2047         (WebCore::MediaPlayerPrivate::createGSTPlayBin):
2048         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.h:
2049         * platform/graphics/gtk/VideoSinkGStreamer.cpp: Added.
2050         (webkit_video_sink_base_init):
2051         (webkit_video_sink_init):
2052         (webkit_video_sink_idle_func):
2053         (webkit_video_sink_render):
2054         (webkit_video_sink_set_caps):
2055         (webkit_video_sink_dispose):
2056         (webkit_video_sink_finalize):
2057         (webkit_video_sink_set_property):
2058         (webkit_video_sink_get_property):
2059         (webkit_video_sink_stop):
2060         (webkit_video_sink_class_init):
2061         (webkit_video_sink_new):
2062         (webkit_video_sink_set_surface):
2063         (plugin_init):
2064         * platform/graphics/gtk/VideoSinkGStreamer.h: Added.
2065
2066 2007-12-16  Mark Rowe  <mrowe@apple.com>
2067
2068         Mac build fix.
2069
2070         * WebCore.xcodeproj/project.pbxproj: Remove NetscapePlugInStreamLoader.cpp from the WebCore target.
2071         Mac currently has its own implementation in NetscapePlugInStreamLoaderMac.mm which conflicts with the
2072         new shared implementation.
2073
2074 2007-12-16  Rodney Dawes  <dobey@wayofthemonkey.com>
2075
2076         Reviewed by Maciej Stachowiak.
2077
2078         http://bugs.webkit.org/show_bug.cgi?id=16389
2079         Bug 16389: Common Implementation of NetscapePlugInStreamLoader
2080
2081         * WebCore.vcproj/WebCore.vcproj: Remove NetscapePlugInStreamLoaderWin.cpp.
2082         * loader/NetscapePlugInStreamLoader.cpp: Copy method implementations from NetscapePlugInStreamLoaderWin.cpp.
2083         * loader/win/NetscapePlugInStreamLoaderWin.cpp: Removed.
2084
2085 2007-12-16  Grace Kloba  <klobag@gmail.com>
2086
2087         Reviewed by Darin Adler.
2088
2089         Fix http://bugs.webkit.org/show_bug.cgi?id=16433.
2090         Bug 16433: LOW_BANDWIDTH_DISPLAY build is broken
2091
2092         * dom/Document.cpp:
2093         (WebCore::Document::Document):
2094         * loader/FrameLoader.cpp:
2095         (WebCore::FrameLoader::addLowBandwidthDisplayRequest):
2096         (WebCore::FrameLoader::switchOutLowBandwidthDisplayIfReady):
2097
2098 2007-12-16  Darin Adler  <darin@apple.com>
2099
2100         Reviewed by Maciej.
2101
2102         - fix <rdar://problem/5636065> First form of SQLTransaction.executeSql() fails with TYPE_ERROR dom exception
2103
2104         Test: storage/execute-sql-args.html
2105
2106         * bindings/js/JSSQLTransactionCustom.cpp:
2107         (WebCore::JSSQLTransaction::executeSql): Added exception handling code so that once an
2108         exception happens, we won't try to do any more argument processing. Changed processing
2109         of the second argument so that we allow an undefined value or null, and simply omit the
2110         array. Changed processing of the second argument so that we don't require an actual
2111         JavaScript array. Instead, as with the JavaScript array operations themselves, we use
2112         the length property and corresponding numeric properties of the object, allowing other
2113         objects to act as arrays. Changed processing of the third and fourth arguments to
2114         allow the undefined value as well as null; we check the value of the argument rather
2115         than looking at the size of the passed-in arguments list.
2116
2117 2007-12-16  Sam Weinig  <sam@webkit.org>
2118
2119         Reviewed by Darin.
2120
2121         More of http://bugs.webkit.org/show_bug.cgi?id=16385
2122         Cleanup kjs_window
2123
2124         - Move PausedTimeouts into its own file and put it in the WebCore namespace.
2125
2126         * WebCore.pro:
2127         * WebCore.vcproj/WebCore.vcproj:
2128         * WebCore.xcodeproj/project.pbxproj:
2129         * WebCoreSources.bkl:
2130         * bindings/js/PausedTimeouts.cpp: Copied from bindings/js/kjs_window.cpp.
2131         * bindings/js/PausedTimeouts.h: Copied from bindings/js/kjs_window.h.
2132         * bindings/js/kjs_window.cpp:
2133         (KJS::Window::pauseTimeouts):
2134         * bindings/js/kjs_window.h:
2135         * history/CachedPage.cpp:
2136         * history/CachedPage.h:
2137         * page/Chrome.cpp:
2138
2139 2007-12-16  Beth Dakin  <bdakin@apple.com>
2140
2141         Reviewed by Geoff.
2142
2143         Make relative-size SVGs work in border-image.
2144
2145         * rendering/RenderBox.cpp:
2146         (WebCore::RenderBox::calculateBackgroundSize):
2147         * rendering/RenderObject.cpp:
2148         (WebCore::RenderObject::paintBorderImage):
2149
2150 2007-12-16  Darin Adler  <darin@apple.com>
2151
2152         - fix Tiger build (my fault it was broken)
2153
2154         * rendering/RenderThemeMac.mm: Define NSUInteger if on Tiger.
2155
2156 2007-12-16  Andrew Wellington  <proton@wiretapped.net>
2157
2158         Reviewed by Darin.
2159         
2160         http://bugs.webkit.org/show_bug.cgi?id=6129
2161         Incomplete implementation of CSS 2.1 system colors
2162
2163         Test: fast/css/css2-system-color.html
2164         
2165         Based on original patch by Rob Buis.
2166         
2167         System colors are retrieved from NSColor as appropriate. If the color is a pattern color
2168         (and therefore NSColor won't let us retrieve a color from it) we draw a 1x1 image of the
2169         color and sample that to get a solid color.
2170
2171         * css/CSSStyleSelector.cpp:
2172         (WebCore::):
2173         (WebCore::colorForCSSValue):
2174         * rendering/RenderTheme.cpp:
2175         (WebCore::RenderTheme::systemColor):
2176         * rendering/RenderTheme.h:
2177         * rendering/RenderThemeMac.h:
2178         * rendering/RenderThemeMac.mm:
2179         (WebCore::getSystemColor):
2180         (WebCore::RenderThemeMac::platformColorsDidChange):
2181         (WebCore::RenderThemeMac::systemColor):
2182
2183 2007-12-16  Dan Bernstein  <mitz@apple.com>
2184
2185         Reviewed by Darin Adler.
2186
2187         - fix http://bugs.webkit.org/show_bug.cgi?id=16426
2188           Divs with overflow:auto: scrollbars not correctly updated when contents change
2189
2190         Test: fast/overflow/scrollbar-position-update.html
2191
2192         * platform/mac/PlatformScrollBarMac.mm:
2193         (WebCore::PlatformScrollbar::updateThumbProportion): Update the
2194         NSScroller's value for the new proportions.
2195         * rendering/RenderLayer.cpp:
2196         (WebCore::RenderLayer::updateScrollInfoAfterLayout): Removed unnecessary
2197         repaint(). Scrollbars repaint themselves as needed.
2198
2199 2007-12-16  Alexey Proskuryakov  <ap@webkit.org>
2200
2201         Reviewed by Darin.
2202
2203         http://bugs.webkit.org/show_bug.cgi?id=14140
2204         <rdar://problem/5270958> REGRESSION: Complex system KeyBindings don't work properly
2205
2206         * dom/KeyboardEvent.h:
2207         (WebCore::KeypressCommand::KeypressCommand):
2208         (WebCore::KeyboardEvent::keypressCommands):
2209         Change stored command class to preserve complete information about commands.
2210
2211         * editing/EditorCommand.cpp: (WebCore::CommandEntry::): Mark InsertText as a text insertion
2212         command, which it is. Previously, we couldn't do it because WebKit didn't really treat insertText:
2213         as a command.
2214
2215         * page/EventHandler.cpp: (WebCore::EventHandler::keyEvent): Copy commands saved while interpreting
2216         a keydown event into keypress, to avoid losing state when running interpretKeyEvents: again.
2217
2218 2007-12-16  Alexey Proskuryakov  <ap@webkit.org>
2219
2220         Reviewed by Darin.
2221
2222         http://bugs.webkit.org/show_bug.cgi?id=16462
2223         REGRESSION: access keys broken on Windows
2224
2225         * page/EventHandler.cpp:
2226         (WebCore::EventHandler::handleAccessKey):
2227         (WebCore::EventHandler::keyEvent):
2228         * page/EventHandler.h:
2229         Make handleAccessKey a class method; rely on WebKit to call it on Windows and wxWidgets.
2230
2231 2007-12-16  Xan Lopez  <xan@gnome.org>
2232
2233         Reviewed by Alexey Proskuryakov.
2234
2235         http://bugs.webkit.org/show_bug.cgi?id=16454
2236         [GTK] Text input doesn't work consistently on PPC
2237
2238         * platform/gtk/KeyEventGtk.cpp:
2239         (WebCore::singleCharacterString):
2240
2241         UChar is 2 bytes (UTF-16), so transform accordingly from
2242         gunichar (UCS-4). Fixes keyboard input on big endian systems.
2243
2244 2007-12-15  Darin Adler  <darin@apple.com>
2245
2246         Reviewed by Mark Rowe.
2247
2248         - better build fix for the problem affecting GTK and some other platforms
2249           "this time for sure"
2250
2251         * WebCore.xcodeproj/project.pbxproj:
2252         * bindings/js/JSEventTargetBase.cpp: Move the include of the .lut.h file here.
2253         * bindings/js/JSEventTargetBase.h: Instead of including the .lut.h file in the header,
2254         which won't work, declare the tables that are in the .lut.h file in the header.
2255
2256 2007-12-12  Kevin Watters  <kevin@dotsyntax.com>
2257
2258         Reviewed by Darin Adler.
2259
2260         Fixed the Wx port's FontPlatformData for use in HashTable.
2261         - FontPlatformData(Deleted) made unequal to FontPlatformData()
2262
2263         * platform/graphics/wx/FontPlatformData
2264
2265 2007-12-15  Dan Bernstein  <mitz@apple.com>
2266
2267         Reviewed by Darin Adler.
2268
2269         - fix <rdar://problem/5636090> Text in Georgia, Armenian, Inuktitut, Cree, or Cherokee (KA, HY, IU, CR, CHR) draws as all missing glyphs
2270
2271         * platform/graphics/win/FontCacheWin.cpp:
2272         (WebCore::metaFileEnumProc): Added. Called during metafile record
2273         enumeration and extracts the font from the create font record.
2274         (WebCore::FontCache::getFontDataForCharacters): If font linking fails,
2275         let Uniscribe draw the characters and see what font it chooses.
2276
2277 2007-12-15  Darin Adler  <darin@apple.com>
2278
2279         * WebCore.pro: Roll my last change out. Was wrong and didn't fix the build.
2280
2281 2007-12-15  Darin Adler  <darin@apple.com>
2282
2283         Another try at a GTK build fix.
2284
2285         * WebCore.pro: Add JSEventTargetBase.cpp to LUT_TABLE_FILES instead of LUT_FILES.
2286
2287 2007-12-15  Sam Weinig  <sam@webkit.org>
2288
2289         Force windows to regenerate COM DOM bindings.
2290
2291         * WebCore.vcproj/build-generated-files.sh: Add license. 
2292         * bindings/scripts/CodeGeneratorCOM.pm: Use shared WK_ucfirst.
2293
2294 2007-12-15  Sam Weinig  <sam@webkit.org>
2295
2296         Fix Windows and wx builds.
2297
2298         * WebCore.vcproj/WebCore.vcproj:
2299         * WebCoreSources.bkl:
2300
2301 2007-12-15  Mark Rowe  <mrowe@apple.com>
2302
2303         Gtk build fix.  Add JSEventTargetBase.cpp to SOURCES.
2304
2305         * WebCore.pro:
2306
2307 2007-12-15  Sam Weinig  <sam@webkit.org>
2308
2309         Fix wx build.
2310
2311         * WebCoreSources.bkl:
2312
2313 2007-12-15  Nikolas Zimmermann  <zimmermann@kde.org>
2314
2315         Not reviewed. Build fix for Qt/Gtk.
2316
2317         * WebCore.pro: Include JSEventTargetBase.lut.h in generation
2318
2319 2007-12-15  Nikolas Zimmermann  <zimmermann@kde.org>
2320
2321         Reviewed by Eric.
2322
2323         Fixes: http://bugs.webkit.org/show_bug.cgi?id=16445 (Refactor EventTargetNode & JSEventTargetNode for an upcoming SVG patch)
2324
2325         Split up JSEventTargetNode in JSEventTargetNode & JSEventTargetBase - where most functionality has been moved down
2326         in the base class. Applied the same refactorization to EventTargetNode.
2327
2328         This makes it possible for the upcoming patch implementing the EventTarget interface for SVGElementInstance
2329         to share as much code as possible with the EventTargetNode classes.
2330
2331         * DerivedSources.make:
2332         * WebCore.xcodeproj/project.pbxproj:
2333         * bindings/js/JSEventTargetBase.cpp: Added.
2334         (WebCore::retrieveEventTargetAndCorrespondingNode):
2335         (WebCore::eventNameForPropertyToken):
2336         * bindings/js/JSEventTargetBase.h: Added.
2337         (WebCore::JSEventTargetProperties::):
2338         (WebCore::JSEventTargetPrototypeFunctionBase::JSEventTargetPrototypeFunctionBase):
2339         (WebCore::JSEventTargetPrototypeFunction::JSEventTargetPrototypeFunction):
2340         (WebCore::):
2341         (WebCore::::create):
2342         (WebCore::JSEventTargetBase::JSEventTargetBase):
2343         (WebCore::JSEventTargetBase::getValueProperty):
2344         (WebCore::JSEventTargetBase::putValueProperty):
2345         (WebCore::JSEventTargetBase::getOwnPropertySlot):
2346         (WebCore::JSEventTargetBase::put):
2347         (WebCore::JSEventTargetPrototype::JSEventTargetPrototype):
2348         (WebCore::JSEventTargetPrototype::self):
2349         (WebCore::JSEventTargetPrototype::getOwnPropertySlot):
2350         (WebCore::JSEventTargetPrototype::classInfo):
2351         * bindings/js/JSEventTargetNode.cpp:
2352         (WebCore::JSEventTargetNode::getOwnPropertySlot):
2353         (WebCore::JSEventTargetNode::getValueProperty):
2354         (WebCore::JSEventTargetNode::put):
2355         (WebCore::JSEventTargetNode::putValueProperty):
2356         (WebCore::JSEventTargetNode::setListener):
2357         (WebCore::toEventTargetNode):
2358         * bindings/js/JSEventTargetNode.h:
2359         (WebCore::JSEventTargetPrototypeInformation::prototypeClassName):
2360         (WebCore::JSEventTargetPrototypeInformation::prototypeIdentifier):
2361         * dom/EventTarget.cpp:
2362         (WebCore::EventTarget::addEventListener):
2363         (WebCore::EventTarget::removeEventListener):
2364         (WebCore::EventTarget::dispatchGenericEvent):
2365         (WebCore::EventTarget::removeAllEventListeners):
2366         (WebCore::EventTarget::insertedIntoDocument):
2367         (WebCore::EventTarget::removedFromDocument):
2368         (WebCore::EventTarget::handleLocalEvents):
2369         (WebCore::EventTarget::applySVGEventTargetRules):
2370         (WebCore::forbidEventDispatch):
2371         (WebCore::allowEventDispatch):
2372         (WebCore::eventDispatchForbidden):
2373         * dom/EventTarget.h:
2374         (WebCore::EventTarget::preDispatchEventHandler):
2375         (WebCore::EventTarget::postDispatchEventHandler):
2376         (WebCore::forbidEventDispatch):
2377         (WebCore::allowEventDispatch):
2378         * dom/EventTargetNode.cpp:
2379         (WebCore::EventTargetNode::~EventTargetNode):
2380         (WebCore::EventTargetNode::insertedIntoDocument):
2381         (WebCore::EventTargetNode::removedFromDocument):
2382         (WebCore::EventTargetNode::addEventListener):
2383         (WebCore::EventTargetNode::removeEventListener):
2384         (WebCore::EventTargetNode::removeAllEventListeners):
2385         (WebCore::EventTargetNode::handleLocalEvents):
2386         (WebCore::EventTargetNode::dispatchEvent):
2387         (WebCore::EventTargetNode::dispatchWindowEvent):
2388         * dom/EventTargetNode.h:
2389         (WebCore::EventTargetNode::localEventListeners):
2390         * svg/SVGElement.cpp:
2391         (WebCore::SVGElement::sendSVGLoadEventIfPossible):
2392         (WebCore::SVGElement::dispatchEvent):
2393
2394 2007-12-15  Eric Seidel  <eric@webkit.org>
2395
2396         Reviewed by Oliver.
2397         
2398         Width of SVG elements not applied to container elements
2399         http://bugs.webkit.org/show_bug.cgi?id=16305
2400         Added calcPrefWidths for RenderSVGRoot (copied from RenderReplaced)
2401         This is caused by poor factoring in the render tree.  RenderContainer probably should be a template.
2402
2403         svg/css/css-box-min-width.html
2404
2405         * rendering/RenderSVGRoot.cpp:
2406         (WebCore::RenderSVGRoot::calcPrefWidths): Added.
2407         * rendering/RenderSVGRoot.h:
2408         * css/SVGCSSStyleSelector::applySVGProperty: fixed ASSERT in debug builds
2409
2410 2007-12-15  David Kilzer  <ddkilzer@apple.com>
2411
2412         Fix comment after isSafeScript() was renamed to allowsAccessFrom().
2413
2414         * bindings/js/kjs_window.cpp:
2415         (KJS::createWindow):
2416
2417 2007-12-15  Alp Toker  <alp@atoker.com>
2418
2419         Reviewed by Mark Rowe.
2420
2421         http://bugs.webkit.org/show_bug.cgi?id=16449
2422         cairo_arc() functions hang or crash when passed inf as radius or start/end angle
2423
2424         Add checks. This matches a similar workaround for a CG bug in the CG
2425         graphics backend: <rdar://problem/5189233>
2426
2427         Fixes:
2428           fast/canvas/arc-crash.html
2429           fast/canvas/canvas-with-incorrect-args.html
2430
2431         * platform/graphics/cairo/PathCairo.cpp:
2432         (WebCore::Path::addArc):
2433
2434 2007-12-15  Alexey Proskuryakov  <ap@webkit.org>
2435
2436         Reviewed by Darin.
2437
2438         http://bugs.webkit.org/show_bug.cgi?id=16078
2439         Google Maps zooming via the scroll wheel (almost) always zooms IN only.
2440
2441         * dom/WheelEvent.cpp: (WebCore::WheelEvent::WheelEvent):
2442         Ensure that delta is never rounded down to zero - we are getting values less than 1 from 
2443         many mice on OS X, and Google Maps code assumes scrolling up if event.wheelDelta is zero.
2444
2445 2007-12-14  Dan Bernstein  <mitz@apple.com>
2446
2447         - Windows build fix
2448
2449         * WebCore.vcproj/WebCore.vcproj:
2450
2451 2007-12-14  Alp Toker  <alp@atoker.com>
2452
2453         GTK+/Qt build fix. Track added files in r28722.
2454
2455         * WebCore.pro:
2456
2457 2007-12-14  Sam Weinig  <sam@webkit.org>
2458
2459         Reviewed by Geoff.
2460
2461         Speed up getElementByClassName.
2462         - This makes getElementByClassName 33% faster on the stress test
2463           linked to at http://bugs.webkit.org/show_bug.cgi?id=15760.
2464
2465         * platform/text/StringImpl.cpp:
2466         (WebCore::StringImpl::foldCase): Optimize the case when all the characters are ASCII.
2467
2468 2007-12-14  Alp Toker  <alp@atoker.com>
2469
2470         Reviewed by Maciej.
2471
2472         http://bugs.webkit.org/show_bug.cgi?id=16432
2473         [GTK] Update license headers
2474
2475         Consent has been given by the authors of these files to change license
2476         to the LGPL as outlined in the bug report.
2477
2478         * platform/gtk/ClipboardGtk.cpp:
2479         * platform/gtk/ContextMenuGtk.cpp:
2480         * platform/gtk/ContextMenuItemGtk.cpp:
2481         * platform/gtk/CookieJarGtk.cpp:
2482         * platform/gtk/CursorGtk.cpp:
2483         * platform/gtk/DragDataGtk.cpp:
2484         * platform/gtk/DragImageGtk.cpp:
2485         * platform/gtk/PasteboardGtk.cpp:
2486         * platform/gtk/PlatformScreenGtk.cpp:
2487         * platform/gtk/PlatformScrollBarGtk.cpp:
2488         * platform/gtk/SearchPopupMenuGtk.cpp:
2489         * platform/gtk/WidgetGtk.cpp:
2490
2491 2007-12-14  Darin Adler  <darin@apple.com>
2492
2493         Reviewed by Adele.
2494
2495         - fix http://bugs.webkit.org/show_bug.cgi?id=16442
2496           navigation policy delegate gets called twice for each load
2497
2498         * loader/MainResourceLoader.cpp:
2499         (WebCore::MainResourceLoader::willSendRequest): Removed call to checkNavigationPolicy.
2500         That's handled by FrameLoader.
2501
2502         * loader/MainResourceLoader.h: Removed callContinueAfterNavigationPolicy
2503         and continueAfterNavigationPolicy.
2504
2505 2007-12-14  Anders Carlsson  <andersca@apple.com>
2506
2507         Reviewed by Brady.
2508
2509         Make document.open count as committing a document load, so that -[WebFrame dataSource:] won't
2510         return nil in that case.
2511         
2512         * loader/FrameLoader.cpp:
2513         (WebCore::FrameLoader::didExplicitOpen):
2514
2515 2007-12-14  David Smith  <catfish.man@gmail.com>
2516
2517         Reviewed by Mitz.
2518
2519         - fix http://bugs.webkit.org/show_bug.cgi?id=14955
2520           Implement getElementsByClassName.
2521
2522         This patch also renames AtomicStringList to ClassNames to better reflect its actual use,
2523         and takes advantage of admitting that it's class-specific to encapsulate class attribute 
2524         parsing so it can be shared.  It also changes the class to use a Vector, rather than a linked
2525         list to store the class names.
2526
2527         Tests: fast/dom/getElementsByClassName/001.html
2528                fast/dom/getElementsByClassName/002.html
2529                fast/dom/getElementsByClassName/003.html
2530                fast/dom/getElementsByClassName/004.html
2531                fast/dom/getElementsByClassName/005.html
2532                fast/dom/getElementsByClassName/006.html
2533                fast/dom/getElementsByClassName/007.html
2534                fast/dom/getElementsByClassName/008.html
2535                fast/dom/getElementsByClassName/009.html
2536                fast/dom/getElementsByClassName/010.xml
2537                fast/dom/getElementsByClassName/011.xml
2538                fast/dom/getElementsByClassName/012.html
2539                fast/dom/getElementsByClassName/013.html
2540                fast/dom/getElementsByClassName/014.html
2541                fast/dom/getElementsByClassName/array/001.html
2542                fast/dom/getElementsByClassName/array/002.html
2543                fast/dom/getElementsByClassName/array/003.html
2544                fast/dom/getElementsByClassName/array/004.html
2545                fast/dom/getElementsByClassName/dumpNodeList.html
2546
2547         * WebCore.xcodeproj/project.pbxproj:
2548         * css/CSSStyleSelector.cpp:
2549         (WebCore::CSSStyleSelector::matchRules):
2550         (WebCore::CSSStyleSelector::checkOneSelector):
2551         * dom/AtomicStringList.h: Removed.
2552         * dom/ClassNames.cpp: Added.
2553         (WebCore::ClassNames::contains):
2554         (WebCore::ClassNames::parseClassAttribute):
2555         * dom/ClassNames.h: Copied from WebCore/dom/AtomicStringList.h.
2556         (WebCore::ClassNames::ClassNames):
2557         (WebCore::ClassNames::size):
2558         (WebCore::ClassNames::clear):
2559         (WebCore::ClassNames::operator[]):
2560         (WebCore::isClassWhitespace):
2561         * dom/ClassNodeList.cpp: Added.
2562         (WebCore::ClassNodeList::ClassNodeList):
2563         (WebCore::ClassNodeList::length):
2564         (WebCore::ClassNodeList::item):
2565         (WebCore::ClassNodeList::nodeMatches):
2566         * dom/ClassNodeList.h: Added.
2567         * dom/Document.cpp:
2568         (WebCore::Document::getElementsByName):
2569         (WebCore::Document::getElementsByClassName):
2570         * dom/Document.h:
2571         * dom/Document.idl:
2572         * dom/Element.cpp:
2573         (WebCore::Element::getClassNames):
2574         (WebCore::Element::getElementsByClassName):
2575         * dom/Element.h:
2576         * dom/Element.idl:
2577         * dom/NameNodeList.cpp:
2578         (WebCore::NameNodeList::NameNodeList):
2579         (WebCore::NameNodeList::item):
2580         (WebCore::NameNodeList::nodeMatches):
2581         * dom/NameNodeList.h:
2582         * dom/NamedMappedAttrMap.cpp:
2583         (WebCore::NamedMappedAttrMap::clearAttributes):
2584         (WebCore::NamedMappedAttrMap::parseClassAttribute):
2585         * dom/NamedMappedAttrMap.h:
2586         (WebCore::NamedMappedAttrMap::getClassNames):
2587         * dom/StyledElement.cpp:
2588         (WebCore::StyledElement::getClassNames):
2589         * dom/StyledElement.h:
2590
2591 2007-12-14  Darin Adler  <darin@apple.com>
2592
2593         Reviewed by Sam.
2594
2595         - fix http://bugs.webkit.org/show_bug.cgi?id=16351
2596           FontFallbackList.h doesn't include wtf/PassRefPtr.h
2597           
2598         * platform/graphics/FontFallbackList.h: Added include of <wtf/Forward.h>
2599         * platform/graphics/GlyphPageTreeNode.h: Removed an unneeded include.
2600
2601 2007-12-14  Darin Adler  <darin@apple.com>
2602
2603         Reviewed by Alexey.
2604
2605         - http://bugs.webkit.org/show_bug.cgi?id=16420
2606           change regression tests to use document.execCommand instead of textInputController.doCommand
2607
2608         Add a few more operations to document.execCommand.
2609
2610         Finished up the transition to the new Editor::Command, including removing
2611         the Editor::execCommand function.
2612
2613         * WebCore.base.exp: Added Editor::Command::isSupported.
2614         * editing/Editor.h: Removed execCommand.
2615         * editing/EditorCommand.cpp:
2616         (WebCore::expandSelectionToGranularity): Added.
2617         (WebCore::verticalScrollDistance): Added; replaces canScroll.
2618         (WebCore::executeDeleteBackward): Added. Moved code here from WebHTMLView.
2619         (WebCore::executeDeleteBackwardByDecomposingPreviousCharacter): Ditto.
2620         (WebCore::executeDeleteForward): Ditto.
2621         (WebCore::executeDeleteToBeginningOfLine): Ditto.
2622         (WebCore::executeDeleteToBeginningOfParagraph): Ditto.
2623         (WebCore::executeDeleteToEndOfLine): Ditto.
2624         (WebCore::executeDeleteToEndOfParagraph): Ditto.
2625         (WebCore::executeMovePageDown): Renamed this command to be consistent with all the other
2626         Move commands. They all modify the caret. Reimplemented to match the Mac OS X version by
2627         removing the explicit scrolling, and letting it be done automatically by code that makes
2628         the caret visible. In some cases the old code would scroll twice which was harmless but
2629         unnecessary.
2630         (WebCore::executeMovePageDownAndModifySelection): Added. Moved code here from WebHTMLView.
2631         (WebCore::executeMovePageUp): See MovePageDown above.
2632         (WebCore::executeMovePageUpAndModifySelection): Added. Moved code here from WebHTMLView.
2633         (WebCore::executeSelectLine): Ditto.
2634         (WebCore::executeSelectParagraph): Ditto.
2635         (WebCore::executeSelectSentence): Ditto.
2636         (WebCore::executeSelectWord): Ditto.
2637         (WebCore::executeSwapWithMark): Some small tweaks.
2638
2639         * page/ContextMenuController.cpp:
2640         (WebCore::ContextMenuController::contextMenuItemSelected): Changed to use Editor::command()
2641         instead of Editor::execCommand(). This code could be changed to use Editor::Command quite a
2642         bit more, but I didn't do that this time.
2643
2644         - Removed some obsolete unused code.
2645
2646         * page/mac/EventHandlerMac.mm:
2647         (WebCore::EventHandler::passMouseDownEventToWidget): Removed the special case code for
2648         NSTextView. This was left over from when we used NSTextField and NSTextView for form
2649         elements and is no longer used at all.
2650
2651         * page/mac/WebCoreFrameBridge.h: Removed 20 unused methods that were still on one side
2652         of the bridge or another. We really need to find a time to tear down the rest of the
2653         bridge, but that's not this patch.
2654
2655         * page/mac/WebCoreFrameBridge.mm:
2656         (-[WebCoreFrameBridge addData:]): Changed to get at the _shouldCreateRenderers field directly
2657         instead of using a method.
2658         (-[WebCoreFrameBridge rangeByAlteringCurrentSelection:SelectionController::direction:SelectionController::granularity:]):
2659         Took out obsolete comment about matching enums (we use a single enum now and have for some
2660         time).
2661         (-[WebCoreFrameBridge selectionGranularity]): Ditto.
2662
2663 2007-12-14  Justin Garcia  <justin.garcia@apple.com>
2664
2665         Reviewed by Darin Adler.
2666
2667         <rdar://problem/5575101> GoogleDocs: Hang in SplitElementCommand::doApply when outdenting a list item in a particular list
2668
2669         * editing/CompositeEditCommand.cpp:
2670         (WebCore::CompositeEditCommand::splitTreeToNode): Moved here.
2671         * editing/CompositeEditCommand.h:
2672         * editing/IndentOutdentCommand.cpp: Moved splitTreeToNode.
2673         * editing/IndentOutdentCommand.h: Ditto, and removed unimplemented splitTreeTo.
2674         * editing/InsertListCommand.cpp:
2675         (WebCore::InsertListCommand::doApply): Split ancestors of listChildNode between
2676         it and listNode, if they exists, so that moving listChildNode doesn't put it out
2677         of order.  Added a test case to cover each change.
2678         * editing/SplitElementCommand.cpp:
2679         (WebCore::SplitElementCommand::doApply): Added an ASSERT to catch code that
2680         tries to split a container at a bogus child, and an early return to avoid a
2681         hang in that case.
2682
2683 2007-12-14  Anders Carlsson  <andersca@apple.com>
2684
2685         Reviewed by Darin and Geoff.
2686
2687         <rdar://problem/5619295> 
2688         REGRESSION: 303-304: Embedded YouTube video fails to render- JS errors (16150) (Flash 9)
2689
2690         _NPN_CreateScriptObject doesn't take an origin root object anymore.
2691         
2692         * html/HTMLPlugInElement.cpp:
2693         (WebCore::HTMLPlugInElement::createNPObject):
2694         * page/Frame.cpp:
2695         (WebCore::Frame::windowScriptNPObject):
2696
2697 2007-12-14  Dan Bernstein  <mitz@apple.com>
2698
2699         Reviewed by Darin Adler.
2700
2701         - fix <rdar://problem/5643663> text-shadow and box-shadow offsets 1px smaller than specified
2702           which is the root cause of:
2703           http://bugs.webkit.org/show_bug.cgi?id=12943
2704           box-shadow: small values don't affect shadow position
2705           http://bugs.webkit.org/show_bug.cgi?id=14736
2706           Safari implementation of text-shadow off by 1px
2707
2708         * platform/graphics/cg/GraphicsContextCG.cpp:
2709         (WebCore::GraphicsContext::setShadow): Slightly increase the magnitude
2710         of the offsets passed to CGContextSetShadow* to ensure that the end
2711         result after truncation is the desired integer offsets.
2712
2713 2007-12-13  Alp Toker  <alp@atoker.com>
2714
2715         curl backend build fix for breakage introduced in r28709.
2716
2717         * platform/network/ResourceHandleInternal.h:
2718         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
2719
2720 2007-12-13  Justin Garcia  <justin.garcia@apple.com>
2721
2722         Reviewed by Oliver Hunt.
2723
2724         <rdar://problem/5607069> In Mail, a crash occurs at WebCore::AppendNodeCommand() after dragging image into a <FORM> element
2725
2726         * editing/InsertLineBreakCommand.cpp:
2727         (WebCore::InsertLineBreakCommand::shouldUseBreakElement): Equip this function to
2728         handle editing positions, like [input, 0];
2729         * editing/InsertParagraphSeparatorCommand.cpp:
2730         (WebCore::InsertParagraphSeparatorCommand::doApply): Pass enclosingBlock a node peeled
2731         off of a non-editing position, to fix a bug where the enclosing block of [input, 0] was
2732         the input element itself.
2733         Insert a <br> when a <form> element is the enclosing block instead of splitting/cloning or
2734         nesting a <div>.
2735
2736 2007-12-13  Alp Toker  <alp@atoker.com>
2737
2738         Reviewed by Oliver Hunt.
2739
2740         http://bugs.webkit.org/show_bug.cgi?id=16365
2741         [cURL] Acid2 test segmentation fault
2742
2743         This patch makes the Acid2 test pass.
2744
2745         Defer the cleanup of cancelled jobs and halt further transfer as early
2746         as possible.
2747
2748         Bug found by and initial patch provided by Luca Bruno.
2749
2750         * platform/network/curl/ResourceHandleManager.cpp:
2751         (WebCore::writeCallback):
2752         (WebCore::headerCallback):
2753         (WebCore::ResourceHandleManager::downloadTimerCallback):
2754         (WebCore::ResourceHandleManager::cancel):
2755
2756 2007-12-13  Sam Weinig  <sam@webkit.org>
2757
2758         Reviewed by Mark Rowe.
2759
2760         Fix typos and rename InspectorController::moveByUnrestricted to InspectorController::moveWindowBy.
2761
2762         * page/InspectorController.cpp:
2763         (WebCore::moveByUnrestricted):
2764         (WebCore::InspectorController::windowScriptObjectAvailable):
2765         (WebCore::InspectorController::moveWindowBy):
2766         * page/InspectorController.h:
2767         * page/inspector/inspector.js:
2768
2769 2007-12-13  Dan Bernstein  <mitz@apple.com>
2770
2771         Reviewed by Dave Hyatt.
2772
2773         - fix <rdar://problem/5642426> explicit cubic-bezier curves all treated as "default" for transition-timing-function
2774
2775         Test: fast/css/transition-timing-function.html
2776
2777         * css/CSSStyleSelector.cpp: Changed the HANDLE_MULTILAYER_VALUE macro to
2778         not reject non-primitive non-list values, and instead made sure that the
2779         mapping functions rejected them if necessary. This allows non-primitive
2780         timing functions to be mapped.
2781         (WebCore::CSSStyleSelector::mapBackgroundAttachment):
2782         (WebCore::CSSStyleSelector::mapBackgroundClip):
2783         (WebCore::CSSStyleSelector::mapBackgroundComposite):
2784         (WebCore::CSSStyleSelector::mapBackgroundOrigin):
2785         (WebCore::CSSStyleSelector::mapBackgroundImage):
2786         (WebCore::CSSStyleSelector::mapBackgroundRepeat):
2787         (WebCore::CSSStyleSelector::mapBackgroundXPosition):
2788         (WebCore::CSSStyleSelector::mapBackgroundYPosition):
2789         (WebCore::CSSStyleSelector::mapTransitionDuration):
2790         (WebCore::CSSStyleSelector::mapTransitionRepeatCount):
2791         (WebCore::CSSStyleSelector::mapTransitionTimingFunction):
2792         (WebCore::CSSStyleSelector::mapTransitionProperty):
2793         * css/CSSTimingFunctionValue.cpp:
2794         (WebCore::CSSTimingFunctionValue::cssText): Implemented for use in the
2795         regression test.
2796         * css/CSSTimingFunctionValue.h:
2797         (WebCore::CSSTimingFunctionValue::isTransitionTimingFunctionValue):
2798         Added. Returns true.
2799         * css/CSSValue.h:
2800         (WebCore::CSSValue::isTransitionTimingFunctionValue): Added. Returns
2801         false.
2802
2803 2007-12-13  Steve Falkenburg  <sfalken@apple.com>
2804
2805         Move source file generation into its own vcproj to fix build dependencies.
2806
2807         Reviewed by Adam.
2808
2809         * WebCore.vcproj/WebCore.make:
2810         * WebCore.vcproj/WebCore.sln:
2811         * WebCore.vcproj/WebCore.submit.sln:
2812         * WebCore.vcproj/WebCore.vcproj:
2813         * WebCore.vcproj/WebCoreGenerated.vcproj: Added.
2814
2815 2007-12-13  Justin Garcia  <justin.garcia@apple.com>
2816
2817         Reviewed by Oliver Hunt.
2818         
2819         <rdar://problem/4145786> Undoing a color change of text in a compose window always changes it back to black
2820         
2821         Some of the operations performed in removeHTMLFontStyle were non-undoable.
2822         
2823         I'm having trouble writing a layout test for this because I can't get DRT to
2824         perform editing operations in separate Undo steps without adding unacceptably long
2825         wait times between operations.  I filed:
2826         
2827         <rdar://problem/5646779> Can't get DRT to perform editing operations in separate Undo steps
2828
2829         * editing/ApplyStyleCommand.cpp:
2830         (WebCore::ApplyStyleCommand::removeHTMLFontStyle):
2831
2832 2007-12-13  Sam Weinig  <sam@webkit.org>
2833
2834         Reviewed by Anders.
2835
2836         Fix for http://bugs.webkit.org/show_bug.cgi?id=16352
2837         Toolbar dragged inspector cannot be moved beyond screen edges
2838
2839         * page/InspectorController.cpp:
2840         (WebCore::moveByUnrestricted):
2841         (WebCore::InspectorController::windowScriptObjectAvailable):
2842         (WebCore::InspectorController::moveByUnrestricted):
2843         * page/InspectorController.h:
2844         * page/inspector/inspector.js:
2845
2846 2007-12-13  Adam Roben  <aroben@apple.com>
2847
2848         Fix <rdar://5517707> Crash on wptv.wp.pl when "make bigger" button is clicked
2849
2850         Windows Media Player has a modal message loop that will deliver
2851         messages to us at inappropriate times and we will crash if we handle
2852         them when they are delivered. In PluginViewWin, we add a quirk for
2853         Media Player to set a flag whenever we give the plugin a chance to
2854         execute code, and in SharedTimerWin we check if the plugin is
2855         executing code and repost messages if so.
2856
2857         Reviewed by Anders.
2858
2859         * platform/win/SharedTimerWin.cpp:
2860         (WebCore::TimerWindowWndProc): Repost messages if we're calling a
2861         plugin.
2862         * plugins/win/PluginViewWin.cpp: Surround all calls to the plugin with
2863         setCallingPlugin(true/false).
2864         (WebCore::PluginViewWin::updateWindow):
2865         (WebCore::PluginViewWin::dispatchNPEvent):
2866         (WebCore::PluginViewWin::setNPWindowRect):
2867         (WebCore::PluginViewWin::start):
2868         (WebCore::PluginViewWin::stop):
2869         (WebCore::PluginViewWin::performRequest):
2870         (WebCore::PluginViewWin::bindingInstance):
2871         (WebCore::PluginViewWin::determineQuirks):
2872         (WebCore::PluginViewWin::setCallingPlugin): Added.
2873         (WebCore::PluginViewWin::isCallingPlugin): Added.
2874         * plugins/win/PluginViewWin.h: Added a new quirk.
2875
2876 2007-12-13  Alp Toker  <alp@atoker.com>
2877
2878         Add a missing DEPENDPATH. Fixes non-clean builds following networking
2879         header changes.
2880
2881         * WebCore.pro:
2882
2883 2007-12-13  Dan Bernstein  <mitz@apple.com>
2884
2885         Reviewed by Anders Carlsson.
2886
2887         - fix regression in fast/text/international/bidi-override on Tiger
2888
2889         * platform/graphics/GlyphPageTreeNode.cpp:
2890         (WebCore::GlyphPageTreeNode::initializePage): Add bidi overrides here
2891         too. I forgot to add them when I added them to treatAsZeroWidthSpace in
2892         an earlier patch.
2893
2894 2007-12-13  Justin Garcia  <justin.garcia@apple.com>
2895
2896         Reviewed by Darin Adler.
2897
2898         <rdar://problem/5601583> GMail Editor: Copied link doesn't paste as a link, just colored text
2899         
2900         The code that checks the selected Range to see if it's inside an anchor
2901         checks ancestors of the Range's commonAncestor() but not the
2902         commonAncestor() itself, and so we'd fail to add markup for the enclosing
2903         anchor to the pasteboard.
2904         
2905         Some enclosing element getters check the node passed to the getter and some
2906         don't.  There were a few places where we incorrectly assumed that enclosing 
2907         element getters check the node passed to the getter, but this is the only 
2908         case that I'm able to write a test case for at the moment.
2909         
2910         In this patch I've:
2911         Changed enclosingNodeWithType and enclosingNodeWithTag to take in positions,
2912         like the newer enclosing element getters.  This is important because we must
2913         soon add code to the getters so that they understand that some editing positions
2914         inside nodes don't actually refer to positions inside those nodes but positions
2915         before and after them.  Like [table, 0].
2916         Changed enclosingNodeWithType and enclosingNodeWithTag to check nodes starting with
2917         n where [n, o] is the position passed to the getter, instead of starting the the parent
2918         of n.  This makes all but a few of the enclosing element getters behave consistently.
2919         Changed enclosingNodeWithType and enclosingNodeWithTag to not return non-editable 
2920         nodes if the input position was editable.  This fixes a bug that that the above change
2921         exposed.
2922         Changed enclosingTableCell to simply call enclosingNodeWithType.  We should do
2923         this for the rest of the getters, or simply remove them in favor of enclosingNodeWithType
2924         unless doing so would affect readability, like it would in the case of enclosingTableCell.
2925         Ditto for enclosingBlock.
2926
2927         * editing/AppendNodeCommand.cpp:
2928         (WebCore::AppendNodeCommand::doApply):
2929         * editing/DeleteButtonController.cpp:
2930         (WebCore::enclosingDeletableElement):
2931         * editing/DeleteSelectionCommand.cpp:
2932         (WebCore::DeleteSelectionCommand::initializePositionData):
2933         (WebCore::DeleteSelectionCommand::saveFullySelectedAnchor):
2934         * editing/Editor.cpp:
2935         (WebCore::Editor::selectionUnorderedListState):
2936         (WebCore::Editor::selectionOrderedListState):
2937         * editing/IndentOutdentCommand.cpp:
2938         (WebCore::IndentOutdentCommand::prepareBlockquoteLevelForInsertion):
2939         (WebCore::IndentOutdentCommand::outdentParagraph):
2940         * editing/InsertNodeBeforeCommand.cpp:
2941         (WebCore::InsertNodeBeforeCommand::doApply):
2942         * editing/InsertParagraphSeparatorCommand.cpp:
2943         (WebCore::InsertParagraphSeparatorCommand::doApply):
2944         * editing/ReplaceSelectionCommand.cpp:
2945         (WebCore::ReplaceSelectionCommand::shouldMerge):
2946         (WebCore::ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds):
2947         (WebCore::ReplaceSelectionCommand::positionAtEndOfInsertedContent):
2948         * editing/TextIterator.cpp:
2949         * editing/htmlediting.cpp:
2950         (WebCore::enclosingBlock):
2951         (WebCore::enclosingNodeWithTag):
2952         (WebCore::enclosingNodeOfType):
2953         (WebCore::enclosingTableCell):
2954         (WebCore::isTableCell):
2955         * editing/htmlediting.h:
2956         * editing/markup.cpp:
2957         (WebCore::appendStartMarkup):
2958         (WebCore::createMarkup):
2959
2960 2007-12-13  Alexey Proskuryakov  <ap@webkit.org>
2961
2962         Reviewed by Darin.
2963
2964         Turn on keyboard event processing quirks for feed views and old applications on Mac OS X.
2965
2966         * WebCore.base.exp:
2967         * dom/KeyboardEvent.cpp:
2968         (WebCore::KeyboardEvent::charCode):
2969         * page/EventHandler.cpp:
2970         (WebCore::EventHandler::needsKeyboardEventDisambiguationQuirks):
2971         (WebCore::EventHandler::keyEvent):
2972         * page/EventHandler.h:
2973         * page/Settings.cpp:
2974         (WebCore::Settings::Settings):
2975         (WebCore::Settings::setNeedsKeyboardEventDisambiguationQuirks):
2976         * page/Settings.h:
2977         (WebCore::Settings::needsKeyboardEventDisambiguationQuirks):
2978         * page/mac/EventHandlerMac.mm:
2979         (WebCore::EventHandler::needsKeyboardEventDisambiguationQuirks):
2980         * platform/PlatformKeyboardEvent.h:
2981         * platform/mac/KeyEventMac.mm:
2982         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
2983         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
2984
2985 2007-12-13  Dan Bernstein  <mitz@apple.com>
2986
2987         - build fix
2988
2989         * platform/network/cf/ResourceErrorCF.cpp:
2990
2991 2007-12-13  Antti Koivisto  <antti@apple.com>
2992
2993         Reviewed by Tim Hatcher.
2994
2995         Fix <rdar://problem/5605674> 
2996         Make <video> display WebKit context menu instead of the QTKit one.
2997     
2998         It doesn't really matter where the QTMovieView is.
2999
3000         * ChangeLog:
3001         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3002         (WebCore::MediaPlayerPrivate::createQTMovieView):
3003         (WebCore::MediaPlayerPrivate::setRect):
3004
3005 2007-12-13  Dan Bernstein  <mitz@apple.com>
3006
3007         Reviewed by Adam Roben.
3008
3009         - ensure that Unicode bidi control characters are rendered as zero width
3010           spaces
3011
3012         Test: fast/text/international/bidi-control-chars-treated-as-ZWS.html
3013
3014         * platform/graphics/Font.h:
3015         (WebCore::Font::treatAsZeroWidthSpace):
3016         * platform/graphics/GlyphPageTreeNode.cpp:
3017         (WebCore::GlyphPageTreeNode::initializePage):
3018         * platform/text/CharacterNames.h:
3019
3020 2007-12-13  Brady Eidson  <beidson@apple.com>
3021
3022         Build fix
3023
3024         * platform/wx/TemporaryLinkStubs.cpp:
3025
3026 2007-12-12  Brady Eidson  <beidson@apple.com>
3027
3028         Build fix
3029
3030         * platform/gtk/TemporaryLinkStubs.cpp:
3031
3032 2007-12-12  Brady Eidson  <beidson@apple.com>
3033
3034         Build fix
3035
3036         * WebCore.pro:
3037         * history/qt/CachedPageQt.cpp: Removed. Whole purpose for this method being platform-specific has been removed
3038
3039 2007-12-12  Brady Eidson  <beidson@apple.com>
3040
3041         Build fix
3042
3043         * platform/win/TemporaryLinkStubs.cpp:
3044
3045 2007-12-12  Brady Eidson  <beidson@apple.com>
3046
3047         Reviewed by Sam Weinig
3048
3049         Fix for <rdar://problem/4886844> and lay groundwork for <rdar://problem/4516170> (Back/Forward Cache on Windows)
3050
3051         All back/forward list and page cache related items used to be in WebKit.
3052         When they were pushed into WebCore, some sloppy compromises were made to keep the Back/Forward cache working on Mac.
3053         Namely, a WebCore::HistoryItem had to know how to keep a WebDocumentView alive.  We accomplished this via some #ifdefs
3054         in CachedPage and having the Mac-only CachedPageMac.mm
3055
3056         To get rid of that nastiness and pave the way for adding Back/Forward cache on other platforms, this patch adds the 
3057         concept of "CachedPagePlatformData" which can contain anything the platform API wants.  
3058
3059         I also took the opportunity to do other cleanup and renaming client methods to better fit their new purposes.
3060
3061         * WebCore.base.exp:
3062         * WebCore.xcodeproj/project.pbxproj:
3063
3064         * history/CachedPage.cpp:
3065         (WebCore::CachedPage::~CachedPage): Combined "close()" and "clear()" to just "clear()" - call it from here.
3066         (WebCore::CachedPage::clear): Call clear() on the CachedPagePlatformData if it exists.  Also delete the CachedPagePlatformData.
3067         (WebCore::CachedPage::setCachedPagePlatformData):
3068         (WebCore::CachedPage::cachedPagePlatformData):
3069         * history/CachedPage.h:
3070
3071         * history/CachedPagePlatformData.h: Added.
3072         (WebCore::CachedPagePlatformData::~CachedPagePlatformData): Virtual d'tor.
3073         (WebCore::CachedPagePlatformData::clear): Virtual method for platforms that need to do cleanup at the same time as CachedPage::clear().
3074
3075         * history/PageCache.cpp:
3076         (WebCore::PageCache::releaseAutoreleasedPagesNow): Call "clear()" instead of "close()"
3077
3078         * history/mac/CachedPageMac.mm: Removed. Functionality replaced with CachedPagePlatformData.
3079
3080         * loader/FrameLoader.cpp:
3081         (WebCore::FrameLoader::transitionToCommitted): Call the new client methods.  Make some work previously done by WebKitMac cross platform 
3082           (setting the cached DocumentLoader to the Frame).
3083         (WebCore::FrameLoader::cachePageForHistoryItem):  Renamed the client methods
3084
3085         * loader/FrameLoaderClient.h:  The very Mac-centric "makeDocumentView", "setDocumentViewFromCachedPage", and "saveDocumentViewToCachedPage"
3086           become "transitionToCommittedForNewPage", "transitionToCommittedFromCachedPage", and "savePlatformDataToCachedPage" accordingly
3087
3088         * svg/graphics/SVGImageEmptyClients.h:
3089         (WebCore::SVGEmptyFrameLoaderClient::savePlatformDataToCachedPage):
3090         (WebCore::SVGEmptyFrameLoaderClient::transitionToCommittedFromCachedPage):
3091         (WebCore::SVGEmptyFrameLoaderClient::transitionToCommittedForNewPage):
3092
3093 2007-12-12  Dan Bernstein  <mitz@apple.com>
3094
3095         Reviewed by Oliver Hunt.
3096
3097         - fix <rdar://problem/5074620> text with font:initial; fails to appear (causes fast/text/font-initial.html to fail)
3098
3099         * css/CSSStyleSelector.cpp:
3100         (WebCore::CSSStyleSelector::applyProperty): When the font property is
3101         set to 'initial', set the font size to its initial value, 'medium',
3102         and the font family to the standard family.
3103
3104 2007-12-12  Justin Garcia  <justin.garcia@apple.com>
3105
3106         Reviewed by Darin Adler.
3107
3108         <rdar://problem/5433862> Mail crashes at WebCore::highestAncestor() when deleting a particular selection
3109
3110         * editing/DeleteSelectionCommand.cpp:
3111         (WebCore::DeleteSelectionCommand::removePreviouslySelectedEmptyTableRows):
3112         Don't remove the table row that contained the end of the selection if it is where we are
3113         about to place the ending selection.
3114         Don't remove all empty rows after the row that contained the start of the selection,
3115         they might come after the row that contained the end of the selection.
3116
3117 2007-12-12  Sam Weinig  <sam@webkit.org>
3118
3119         Reviewed by Anders Carlsson.
3120
3121         Add button to clear the Web Inspector's console.
3122
3123         * English.lproj/InspectorLocalizedStrings.js:
3124         * page/inspector/ConsolePanel.js:
3125         * page/inspector/inspector.css:
3126
3127 2007-12-12  Anders Carlsson  <andersca@apple.com>
3128
3129         Reviewed by Adam and Jon.
3130
3131         <rdar://problem/5349282>
3132         popup blocking is not applied to plugins on Windows.
3133         
3134         Implement popup blocking. If the plug-in supports the new 
3135         NPN_PushPopupsEnabledState/NPN_PopPopupsEnabledState API we just use that
3136         to determine if a plug-in request can open new windows.
3137         
3138         If a plug-in does not support the new API, we assume that a plug-in can open new windows
3139         in response to either mouse click or key press events.
3140         
3141         * plugins/win/PluginViewWin.cpp:
3142         (WebCore::PluginRequestWin::PluginRequestWin):
3143         (WebCore::PluginRequestWin::shouldAllowPopups):
3144         Add new shouldAllowPopups member.
3145         
3146         (WebCore::PluginViewWin::popPopupsStateTimerFired):
3147         Reset the popup state.
3148         
3149         (WebCore::isWindowsMessageUserGesture):
3150         New function that given a windows message id returns whether it's a user gesture or not.
3151         
3152         (WebCore::PluginViewWin::wndProc):
3153         Allow popups if the window message is a user gesture.
3154         
3155         (WebCore::PluginViewWin::dispatchNPEvent):
3156         New method that dispatches an NPEvent, turning on popups if necessary.
3157         
3158         (WebCore::PluginViewWin::paint):
3159         (WebCore::PluginViewWin::handleKeyboardEvent):
3160         (WebCore::PluginViewWin::handleMouseEvent):
3161         Call dispatchNPEvent().
3162         
3163         (WebCore::PluginViewWin::performRequest):
3164         (WebCore::PluginViewWin::load):
3165         Add calls to shouldAllowPopups().
3166         
3167         (WebCore::PluginViewWin::pushPopupsEnabledState):
3168         (WebCore::PluginViewWin::popPopupsEnabledState):
3169         New methods that maintain the popup state stack.
3170         
3171         (WebCore::PluginViewWin::arePopupsAllowed):
3172         New method that returns whether popups are allowed.
3173         
3174         (WebCore::PluginViewWin::PluginViewWin):
3175         * plugins/win/PluginViewWin.h:
3176         Add new instance variables.
3177         
3178         * plugins/win/npapi.cpp:
3179         (NPN_PushPopupsEnabledState):
3180         (NPN_PopPopupsEnabledState):
3181         Implement these.
3182
3183 2007-12-12  Dan Bernstein  <mitz@apple.com>
3184
3185         Reviewed by John Sullivan.
3186
3187         - fix a bug in debug builds only where selecting an earlier item in
3188           a popup selects the first item
3189
3190         Test: fast/forms/menulist-selection-reset.html
3191
3192         * html/HTMLSelectElement.cpp:
3193         (WebCore::HTMLSelectElement::recalcListItems): Added an argument that
3194         tells that function whether it should update the selected state of
3195         option elements.
3196         (WebCore::HTMLSelectElement::checkListItems): Changed to pass false
3197         as the above argument.
3198         * html/HTMLSelectElement.h:
3199
3200 2007-12-12  Adele Peterson  <adele@apple.com>
3201
3202         Reviewed by Geoff.
3203
3204         Fix for <rdar://problem/5643054> Remove cue point implementation for media elements
3205
3206         When the specification for cue ranges is more final, we will implement those.
3207
3208         * html/HTMLMediaElement.cpp:
3209         (WebCore::HTMLMediaElement::~HTMLMediaElement):
3210         (WebCore::HTMLMediaElement::load):
3211         * html/HTMLMediaElement.h:
3212         * html/HTMLMediaElement.idl:
3213         * platform/graphics/MediaPlayer.cpp:
3214         * platform/graphics/MediaPlayer.h:
3215         (WebCore::MediaPlayerClient::mediaPlayerTimeChanged):
3216         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
3217         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3218         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
3219         (WebCore::MediaPlayerPrivate::load):
3220         (WebCore::MediaPlayerPrivate::play):
3221         (WebCore::MediaPlayerPrivate::pause):
3222         (WebCore::MediaPlayerPrivate::setEndTime):
3223         (WebCore::MediaPlayerPrivate::startEndPointTimerIfNeeded):
3224         (WebCore::MediaPlayerPrivate::endPointTimerFired):
3225         (WebCore::MediaPlayerPrivate::timeChanged):
3226         (WebCore::MediaPlayerPrivate::didEnd):
3227         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
3228         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
3229         (WebCore::MediaPlayerPrivate::startEndPointTimerIfNeeded):
3230         (WebCore::MediaPlayerPrivate::endPointTimerFired):
3231         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.h:
3232
3233 2007-12-12  MorganL  <morganl.webkit@yahoo.com>
3234
3235         Reviewed by Maciej.
3236
3237         Fixes:
3238         http://bugs.webkit.org/show_bug.cgi?id=16408
3239
3240         When navigating back/forward to a http:// link, we should prefer to
3241         load from cache if possible.
3242
3243         * loader/FrameLoader.cpp:
3244
3245 2007-12-12  Anders Carlsson  <andersca@apple.com>
3246
3247         Reviewed by Sam.
3248
3249         <rdar://problem/5132003>
3250         dumpResourceLoadCallbacks is not implemented in DRT on Windows.
3251         
3252         * platform/network/cf/ResourceErrorCF.cpp:
3253         (WebCore::ResourceError::unpackPlatformError):
3254         Handle kCFErrorDomainWinSock.
3255         
3256         * platform/network/cf/ResourceHandleCFNet.cpp:
3257         (WebCore::willSendRequest):
3258         Ignore willSendRequest calls where the redirect response is null, like we do in 
3259         the Mac version.
3260
3261 2007-12-12  Steve Falkenburg  <sfalken@apple.com>
3262
3263         <rdar://problem/5643785> Fix iBench regression caused by mis-placed nested timer check.
3264         
3265         Reviewed by Anders.
3266
3267         * platform/win/SharedTimerWin.cpp:
3268         (WebCore::TimerWindowWndProc): Don't set high-resolution timer flag inside non-high-resolution timer proc.
3269
3270 2007-12-12  Beth Dakin  <bdakin@apple.com>
3271
3272         Reviewed by Oliver.
3273
3274         Fix for <rdar://problem/5643770> REGRESSION: Free-standing SVGs 
3275         with width and height 100% clip to 300 x 150
3276
3277         Though it was correct in an earlier iteration of my patch, it is 
3278         not sufficient in the final, committed version to ask if the 
3279         relativeWidthValue() or relativeHeightValue() is greater than 0 
3280         just to determine if one has been set, for, they are now 
3281         initialized to 300 and 150 respectively! This patch instead adds a 
3282         bool to keep track of whether a container size has been set, and 
3283         only used the relative value if it has.
3284
3285         * rendering/RenderSVGRoot.cpp:
3286         (WebCore::RenderSVGRoot::calcViewport):
3287         * svg/SVGSVGElement.cpp:
3288         (WebCore::SVGSVGElement::SVGSVGElement):
3289         * svg/SVGSVGElement.h:
3290         (WebCore::SVGSVGElement::setContainerSize):
3291         (WebCore::SVGSVGElement::hasSetContainerSize):
3292
3293 2007-12-12  Brady Eidson  <beidson@apple.com>
3294
3295         Reviewed by Steve Falkenburg 
3296
3297         <rdar://problem/5012636> - WebURLProtectionSpace::realm returns the hostname rather than the authentication realm
3298
3299         * platform/network/ProtectionSpace.cpp:
3300         (WebCore::ProtectionSpace::ProtectionSpace): Assign the realm to m_realm, instead of the host
3301
3302 2007-12-12  Alp Toker  <alp@atoker.com>
3303
3304         Reviewed by Maciej.
3305
3306         http://bugs.webkit.org/show_bug.cgi?id=16388
3307         [GTK] Widget::setCursor() gets called frequently
3308
3309         Cache the current cursor to avoid calling gdk_window_set_cursor() when
3310         there's no change in cursor.
3311
3312         * platform/gtk/WidgetGtk.cpp:
3313         (WebCore::Widget::Widget):
3314         (WebCore::Widget::cursor):
3315         (WebCore::Widget::setCursor):
3316
3317 2007-12-12  Rodney Dawes  <dobey@wayofthemonkey.com>
3318
3319         Reviewed by Maciej.
3320
3321         http://bugs.webkit.org/show_bug.cgi?id=16342
3322         Build Warning and Error fixes in WebCore GTK+
3323
3324         Use C-style casts for casting function pointers to gpointer
3325         Use static_cast<int> to cast a float to int to fix a warning
3326
3327         * platform/gtk/PlatformScrollBarGtk.cpp:
3328         (PlatformScrollbar::PlatformScrollbar):
3329         (PlatformScrollbar::~PlatformScrollbar):
3330         (PlatformScrollbar::gtkValueChanged):
3331         * platform/gtk/ThreadingGtk.cpp:
3332         (callFunctionOnMainThread):
3333         (callOnMainThread):
3334
3335 2007-12-12  Dan Bernstein  <mitz@apple.com>
3336
3337         Reviewed by Darin Adler.
3338
3339         - better fix for a crash when pressing a key that is not associated
3340           with a command
3341
3342         * editing/EditorCommand.cpp:
3343         (WebCore::Editor::command): Return the empty command if the command name
3344         is empty.
3345
3346 2007-12-12  Alexey Proskuryakov  <ap@webkit.org>
3347
3348         Reviewed by Darin.
3349
3350         http://bugs.webkit.org/show_bug.cgi?id=16410
3351         Implement isKeypadEvent() on Windows
3352
3353         Test: platform/win/fast/events/keyLocation-numpad.html
3354
3355         * platform/win/KeyEventWin.cpp:
3356         (WebCore::isKeypadEvent): Added.
3357         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Also fixed a mistake with autorepeat.
3358
3359 2007-12-12  Oliver Hunt  <oliver@apple.com>
3360
3361         Reviewed by Maciej.
3362
3363         <rdar://problem/5071781> window.mouseout events are not sent 
3364         to window when mouse moves out of window 
3365
3366         Make PlatformMouseEvent recognise WM_MOUSELEAVE.
3367
3368         * platform/win/PlatformMouseEventWin.cpp:
3369         (WebCore::messageToEventType):
3370         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
3371
3372 2007-12-12  Sam Weinig  <sam@webkit.org>
3373
3374         Fix Mac release build.
3375
3376         * WebCore.base.exp:
3377
3378 2007-12-12  Sam Weinig  <sam@webkit.org>
3379
3380         Build fix for Qt, Gtk, and Wx.
3381
3382         * css/CSSParser.cpp:
3383         (WebCore::CSSParser::parseValue):
3384         * loader/win/FrameLoaderWin.cpp:
3385         (WebCore::FrameLoader::urlSelected):
3386         * platform/network/curl/ResourceHandleManager.cpp:
3387         (WebCore::parseDataUrl):
3388         (WebCore::ResourceHandleManager::startJob):
3389         * platform/network/win/CookieJarWin.cpp:
3390         (WebCore::setCookies):
3391         (WebCore::cookies):
3392         * platform/network/win/ResourceHandleWin.cpp:
3393         (WebCore::ResourceHandle::start):
3394         * platform/qt/PasteboardQt.cpp:
3395         (WebCore::Pasteboard::writeURL):
3396
3397 2007-12-11  Dan Bernstein  <mitz@apple.com>
3398
3399         Reviewed by Maciej Stachowiak.
3400
3401         - allow non-integer font sizes on Windows for small caps
3402
3403         * platform/graphics/win/FontDataWin.cpp:
3404         (WebCore::FontData::smallCapsFontData):
3405         * platform/graphics/win/FontPlatformData.h:
3406         (WebCore::FontPlatformData::size):
3407         (WebCore::FontPlatformData::setSize):
3408         * platform/graphics/win/FontPlatformDataWin.cpp:
3409         (WebCore::FontPlatformData::FontPlatformData):
3410
3411 2007-12-11  Sam Weinig  <sam@webkit.org>
3412
3413         Build fix for Qt, Gtk, and Wx.
3414
3415         * platform/gtk/CookieJarGtk.cpp:
3416         (WebCore::setCookies):
3417         (WebCore::cookies):
3418         * platform/qt/ClipboardQt.cpp:
3419         (WebCore::ClipboardQt::writeURL):
3420         * platform/qt/CookieJarQt.cpp:
3421         (WebCore::setCookies):
3422         (WebCore::cookies):
3423         * platform/wx/PasteboardWx.cpp:
3424         (WebCore::Pasteboard::writeURL):
3425
3426 2007-12-11  Sam Weinig  <sam@webkit.org>
3427
3428         Reviewed by Darin Adler.
3429
3430         Scrub URL out of the tree in preparation for renaming KURL to URL.
3431             - Renames Document::URL() -> Document::url()
3432             - Renames DocumentLoader::URL() -> DocumentLoader::url()
3433             - Renames KURL::url() to KURL::string() and KURL::deprecatedString()
3434             - Remove FrameLoader::URL()
3435             - Various variable renames.
3436
3437         The change from Document::URL() to Document::url() required changes
3438         to the bindings scripts as well, because URL() is the name of a DOM
3439         method.  The code generation scripts now have code to special case URL()
3440         to url().
3441
3442         * WebCore.base.exp:
3443         * bindings/js/kjs_events.cpp:
3444         (WebCore::JSLazyEventListener::parseCode):
3445         * bindings/js/kjs_navigator.cpp:
3446         (KJS::Navigator::getValueProperty):
3447         * bindings/js/kjs_proxy.cpp:
3448         (WebCore::KJSProxy::initScript):
3449         * bindings/js/kjs_window.cpp:
3450         (KJS::Window::put):
3451         (KJS::Window::allowsAccessFrom):
3452         (KJS::Location::put):
3453         (KJS::LocationProtoFuncReplace::callAsFunction):
3454         (KJS::LocationProtoFuncReload::callAsFunction):
3455         (KJS::LocationProtoFuncAssign::callAsFunction):
3456         * bindings/scripts/CodeGenerator.pm:
3457         * bindings/scripts/CodeGeneratorCOM.pm:
3458         * bindings/scripts/CodeGeneratorJS.pm:
3459         * bindings/scripts/CodeGeneratorObjC.pm:
3460         * css/CSSImportRule.cpp:
3461         (WebCore::CSSImportRule::insertedIntoParent):
3462         * css/CSSParser.cpp:
3463         (WebCore::CSSParser::parseValue):
3464         (WebCore::CSSParser::parseContent):
3465         (WebCore::CSSParser::parseBackgroundImage):
3466         (WebCore::CSSParser::parseFontFaceSrc):
3467         (WebCore::CSSParser::parseBorderImage):
3468         (WebCore::CSSParser::createImportRule):
3469         * css/CSSStyleSelector.cpp:
3470         (WebCore::CSSStyleSelector::setEncodedURL):
3471         * dom/Document.cpp:
3472         (WebCore::Document::processHttpEquiv):
3473         (WebCore::Document::cookie):
3474         (WebCore::Document::setCookie):
3475         (WebCore::Document::domain):
3476         (WebCore::Document::setDomain):
3477         (WebCore::Document::getImageMap):
3478         (WebCore::Document::completeURL):
3479         * dom/Document.h:
3480         (WebCore::Document::url):
3481         (WebCore::Document::baseURL):
3482         * dom/Element.cpp:
3483         (WebCore::Element::baseURI):
3484         * dom/ProcessingInstruction.h:
3485         * dom/StyledElement.cpp:
3486         (WebCore::StyledElement::addCSSImageProperty):
3487         * dom/StyledElement.h:
3488         * dom/XMLTokenizer.cpp:
3489         (WebCore::XMLTokenizer::endElementNs):
3490         (WebCore::XMLTokenizer::end):
3491         (WebCore::):
3492         * dom/XMLTokenizer.h:
3493         * editing/Editor.cpp:
3494         (WebCore::Editor::copy):
3495         * editing/markup.cpp:
3496         (WebCore::completeURLs):
3497         * history/CachedPage.h:
3498         (WebCore::CachedPage::url):
3499         * history/HistoryItem.cpp:
3500         (WebCore::HistoryItem::HistoryItem):
3501         (WebCore::HistoryItem::setURL):
3502         (WebCore::HistoryItem::isCurrentDocument):
3503         * html/HTMLBaseElement.cpp:
3504         (WebCore::HTMLBaseElement::process):
3505         * html/HTMLParser.cpp:
3506         (WebCore::HTMLParser::reportErrorToConsole):
3507         * html/HTMLScriptElement.cpp:
3508         (WebCore::HTMLScriptElement::childrenChanged):
3509         (WebCore::HTMLScriptElement::insertedIntoDocument):
3510         (WebCore::HTMLScriptElement::evaluateScript):
3511         * html/HTMLScriptElement.h:
3512         * html/HTMLTokenizer.cpp:
3513         (WebCore::HTMLTokenizer::scriptExecution):
3514         * loader/Cache.cpp:
3515         (WebCore::createResource):
3516         (WebCore::Cache::requestResource):
3517         * loader/CachedCSSStyleSheet.cpp:
3518         (WebCore::CachedCSSStyleSheet::checkNotify):
3519         * loader/CachedResource.cpp:
3520         (WebCore::CachedResource::CachedResource):
3521         * loader/CachedResource.h:
3522         (WebCore::CachedResource::):
3523         * loader/CachedScript.h:
3524         * loader/DocLoader.cpp:
3525         (WebCore::DocLoader::checkForReload):
3526         (WebCore::DocLoader::requestResource):
3527         * loader/DocumentLoader.cpp:
3528         (WebCore::DocumentLoader::url):
3529         (WebCore::DocumentLoader::replaceRequestURLForAnchorScroll):
3530         (WebCore::DocumentLoader::setRequest):
3531         (WebCore::DocumentLoader::startLoadingMainResource):
3532         * loader/DocumentLoader.h:
3533         * loader/FrameLoader.cpp:
3534         (WebCore::FormSubmission::FormSubmission):
3535         (WebCore::ScheduledRedirection::ScheduledRedirection):
3536         (WebCore::FrameLoader::changeLocation):
3537         (WebCore::FrameLoader::urlSelected):
3538         (WebCore::FrameLoader::requestFrame):
3539         (WebCore::FrameLoader::loadSubframe):
3540         (WebCore::FrameLoader::submitFormAgain):
3541         (WebCore::FrameLoader::submitForm):
3542         (WebCore::FrameLoader::didExplicitOpen):
3543         (WebCore::FrameLoader::replaceContentsWithScriptResult):
3544         (WebCore::FrameLoader::executeScript):
3545         (WebCore::FrameLoader::receivedFirstData):
3546         (WebCore::FrameLoader::begin):
3547         (WebCore::FrameLoader::startIconLoader):
3548         (WebCore::FrameLoader::commitIconURLToIconDatabase):
3549         (WebCore::FrameLoader::scheduleRefresh):
3550         (WebCore::FrameLoader::redirectionTimerFired):
3551         (WebCore::FrameLoader::loadPlugin):
3552         (WebCore::FrameLoader::didNotOpenURL):
3553         (WebCore::FrameLoader::updatePolicyBaseURL):
3554         (WebCore::FrameLoader::scrollToAnchor):
3555         (WebCore::FrameLoader::startRedirectionTimer):
3556         (WebCore::FrameLoader::load):
3557         (WebCore::FrameLoader::canLoad):
3558         (WebCore::FrameLoader::shouldHideReferrer):
3559         (WebCore::FrameLoader::shouldAllowNavigation):
3560         (WebCore::FrameLoader::commitProvisionalLoad):
3561         (WebCore::FrameLoader::clientRedirected):
3562         (WebCore::FrameLoader::open):
3563         (WebCore::FrameLoader::didTellBridgeAboutLoad):
3564         (WebCore::FrameLoader::haveToldBridgeAboutLoad):
3565         (WebCore::FrameLoader::post):
3566         (WebCore::FrameLoader::loadResourceSynchronously):
3567         (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy):
3568         (WebCore::FrameLoader::shouldTreatURLAsSameAsCurrent):
3569         (WebCore::FrameLoader::createHistoryItem):
3570         (WebCore::FrameLoader::addBackForwardItemClippedAtTarget):
3571         (WebCore::FrameLoader::loadItem):
3572         (WebCore::FrameLoader::urlsMatchItem):
3573         (WebCore::FrameLoader::recursiveGoToItem):
3574         (WebCore::FrameLoader::updateHistoryForStandardLoad):
3575         (WebCore::FrameLoader::updateHistoryForRedirectWithLockedHistory):
3576         * loader/FrameLoader.h:
3577         (WebCore::FrameLoader::url):
3578         * loader/ImageDocument.cpp:
3579         (WebCore::ImageDocument::createDocumentStructure):
3580         * loader/MainResourceLoader.cpp:
3581         (WebCore::shouldLoadAsEmptyDocument):
3582         (WebCore::MainResourceLoader::didFinishLoading):
3583         * loader/NavigationAction.cpp:
3584         (WebCore::NavigationAction::NavigationAction):
3585         * loader/NavigationAction.h:
3586         (WebCore::NavigationAction::url):
3587         * loader/PluginDocument.cpp:
3588         (WebCore::PluginTokenizer::createDocumentStructure):
3589         * loader/SubresourceLoader.cpp:
3590         (WebCore::SubresourceLoader::load):
3591         (WebCore::SubresourceLoader::create):
3592         * loader/icon/IconLoader.cpp:
3593         (WebCore::IconLoader::startLoading):
3594         (WebCore::IconLoader::finishLoading):
3595         * loader/loader.cpp:
3596         (WebCore::Loader::servePendingRequests):
3597         * loader/mac/LoaderNSURLExtras.m:
3598         (urlOriginalData):
3599         * page/Chrome.cpp:
3600         (WebCore::Chrome::setToolTip):
3601         * page/ContextMenuController.cpp:
3602         (WebCore::ContextMenuController::contextMenuItemSelected):
3603         * page/Frame.cpp:
3604         (WebCore::Frame::setUserStyleSheetLocation):
3605         * page/InspectorController.cpp:
3606         (WebCore::InspectorResource::type):
3607         (WebCore::addSourceToFrame):
3608         (WebCore::InspectorController::addScriptResource):
3609         (WebCore::InspectorController::updateScriptResourceRequest):
3610         (WebCore::InspectorController::didCommitLoad):
3611         * page/mac/WebCoreFrameBridge.mm:
3612         (-[WebCoreFrameBridge getData:andResponse:forURL:]):
3613         * platform/KURL.h:
3614         (WebCore::KURL::string):
3615         (WebCore::KURL::deprecatedString):
3616         * platform/mac/ClipboardMac.mm:
3617         (WebCore::ClipboardMac::getData):
3618         * platform/mac/CookieJar.mm:
3619         (WebCore::cookies):
3620         (WebCore::setCookies):
3621         * platform/mac/PasteboardMac.mm:
3622         (WebCore::Pasteboard::writeURL):
3623         (WebCore::fileWrapperForImage):
3624         (WebCore::Pasteboard::writeImage):
3625         (WebCore::Pasteboard::plainText):
3626         * platform/network/ResourceHandle.cpp:
3627         (WebCore::ResourceHandle::portAllowed):
3628         * platform/network/ResourceRequestBase.cpp:
3629         (WebCore::ResourceRequestBase::isNull):
3630         * platform/network/cf/ResourceHandleCFNet.cpp:
3631         (WebCore::willSendRequest):
3632         (WebCore::didReceiveResponse):
3633         (WebCore::didReceiveData):
3634         (WebCore::didFinishLoading):
3635         (WebCore::didFail):
3636         (WebCore::didReceiveChallenge):
3637         (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
3638         (WebCore::ResourceHandle::~ResourceHandle):
3639         (WebCore::ResourceHandle::start):
3640         * platform/win/ClipboardUtilitiesWin.cpp:
3641         (WebCore::createGlobalData):
3642         (WebCore::urlToMarkup):
3643         * platform/win/ClipboardWin.cpp:
3644         (WebCore::writeURL):
3645         (WebCore::writeImageToDataObject):
3646         (WebCore::ClipboardWin::writeURL):
3647         (WebCore::ClipboardWin::writeRange):
3648         * platform/win/PasteboardWin.cpp:
3649         (WebCore::Pasteboard::writeSelection):
3650         (WebCore::Pasteboard::writeURL):
3651         * plugins/win/PluginDatabaseWin.cpp:
3652         (WebCore::PluginDatabaseWin::findPlugin):
3653         * plugins/win/PluginStreamWin.cpp:
3654         (WebCore::PluginStreamWin::startStream):
3655         (WebCore::PluginStreamWin::destroyStream):
3656         * plugins/win/PluginViewWin.cpp:
3657         (WebCore::scriptStringIfJavaScriptURL):
3658         (WebCore::PluginViewWin::performRequest):
3659         * svg/SVGImageLoader.cpp:
3660         (WebCore::SVGImageLoader::updateFromElement):
3661         * xml/XMLHttpRequest.cpp:
3662         (WebCore::XMLHttpRequest::getResponseXML):
3663         (WebCore::XMLHttpRequest::urlMatchesDocumentDomain):
3664         * xml/XSLImportRule.cpp:
3665         (WebCore::XSLImportRule::loadSheet):
3666         * xml/XSLTProcessor.cpp:
3667         (WebCore::XSLTProcessor::createDocumentFromSource):
3668         (WebCore::xsltStylesheetPointer):
3669         (WebCore::xmlDocPtrFromNode):
3670
3671 2007-12-11  Beth Dakin  <bdakin@apple.com>
3672
3673         Reviewed by Darin.
3674
3675         Fix for <rdar://problem/5641255> SVGs with width and height 100% 
3676         fail to render when used as background images
3677
3678         CachedImage now has a setImageContainerSize function. It is only 
3679         needed for SVG right now.
3680         * loader/CachedImage.cpp:
3681         (WebCore::CachedImage::setImageContainerSize):
3682         * loader/CachedImage.h:
3683
3684         Relatively sized SVGs have no intrinsic size. Because this call is 
3685         low-level enough that we cannot pass in the container size and get 
3686         the real size of the SVG, we need to know if it has relative 
3687         dimensions, and if so, we need to get the size from scaledTileSize.
3688         * platform/graphics/Image.cpp:
3689         (WebCore::Image::drawTiled):
3690         * platform/graphics/Image.h:
3691         (WebCore::Image::setContainerSize):
3692         (WebCore::Image::hasRelativeWidth):
3693         (WebCore::Image::hasRelativeHeight):
3694
3695         Re-factored calculateBackgroundSize a bit so that it returns an 
3696         IntSize. Made it a member function so that it can send m_width and 
3697         m_height along to setImageContainerSize.
3698         * rendering/RenderBox.cpp:
3699         (WebCore::RenderBox::calculateBackgroundSize):
3700         (WebCore::RenderBox::calculateBackgroundImageGeometry):
3701         * rendering/RenderBox.h:
3702
3703         Need to account for relatively sized SVGs in calcViewport()
3704         * rendering/RenderSVGRoot.cpp:
3705         (WebCore::RenderSVGRoot::calcViewport):
3706         
3707         Added new member variables to store the size of the SVG container. 
3708         relativeWidthValue() and relativeHeightValue() use the stored SVG 
3709         container size to correctly calculate the width and height of a 
3710         relatively sized SVG.
3711         * svg/SVGSVGElement.cpp:
3712         (WebCore::SVGSVGElement::SVGSVGElement):
3713         (WebCore::SVGSVGElement::setContainerSize):
3714         (WebCore::SVGSVGElement::relativeWidthValue):
3715         (WebCore::SVGSVGElement::relativeHeightValue):
3716         * svg/SVGSVGElement.h:
3717         (WebCore::SVGSVGElement::containerSize):
3718         
3719         Re-factored size calculations to use the size of the container.
3720         * svg/graphics/SVGImage.cpp:
3721         (WebCore::SVGImage::setContainerSize):
3722         (WebCore::SVGImage::size):
3723         (WebCore::SVGImage::hasRelativeWidth):
3724         (WebCore::SVGImage::hasRelativeHeight):
3725         * svg/graphics/SVGImage.h:
3726
3727 2007-12-11  Darin Adler  <darin@apple.com>
3728
3729         * editing/Editor.cpp:
3730         (WebCore::Editor::yankFromKillRing): Try to fix non-Mac builds by adding
3731         a missing return statement.
3732
3733 2007-12-11  Darin Adler  <darin@apple.com>
3734
3735         Reviewed by Geoff.
3736
3737         - exposed many new commands to the DOM Document executeCommand function by
3738           merging the JSEditor and Editor executeCommand implementations
3739         - replaced the execCommand function with a EditorCommand class
3740         - replaced the WTF::StrHash<> class template with the WebCore::StringHash class
3741         - replaced the WTF::CaseInsensitiveHash<> class template with the
3742           WebCore::CaseFoldingHash class
3743
3744         * WebCore.base.exp: Updated.
3745         * WebCore.pro: Added EditorCommand.cpp, removed JSEditor.cpp.
3746         * WebCore.vcproj/WebCore.vcproj: Ditto.
3747         * WebCore.xcodeproj/project.pbxproj: Ditto.
3748         * WebCoreSources.bkl: Ditto.
3749
3750         * dom/Document.cpp:
3751         (WebCore::Document::Document): Removed code to set up m_jsEditor.
3752         (WebCore::Document::~Document): Removed code to delete m_jsEditor.
3753         (WebCore::command): Added. Helper function that gets an Editor::Command.
3754         (WebCore::Document::executeCommand): Changed to use Editor::Command instead of
3755         JSEditor.
3756         (WebCore::Document::queryCommandEnabled): Ditto.
3757         (WebCore::Document::queryCommandIndeterm):
3758         (WebCore::Document::queryCommandState): Ditto.
3759         (WebCore::Document::queryCommandSupported): Ditto.
3760         (WebCore::Document::queryCommandValue): Ditto.
3761
3762         * dom/Document.h: Removed JSEditor, jsEditor, m_jsEditor. Changed to
3763         use CaseFoldingHash.
3764
3765         * editing/Editor.cpp:
3766         (WebCore::Editor::selectionForCommand): Renamed from selectionForEvent and
3767         made into a member function so it is accessible from the new EditorCommand.cpp file.
3768         Also changed to get the selection from the passed-in frame instead of from the
3769         page, because this should work on the targeted frame unless the event overrides it.
3770         (WebCore::Editor::handleKeypress): Updated for selectionForCommand change.
3771         (WebCore::Editor::handleInputMethodKeypress): Ditto.
3772         (WebCore::imageElementFromImageDocument): Renamed and changed to return
3773         a HTMLImageElement instead of a Node*.
3774         (WebCore::Editor::canCopy): Updated for name change.
3775         (WebCore::Editor::selectionUnorderedListState): Updated for TriState change.
3776         (WebCore::Editor::selectionOrderedListState): Ditto.
3777         (WebCore::Editor::selectionStartHasStyle): Make type of local more specific.
3778         (WebCore::updateState): Moved here from Frame.
3779         (WebCore::Editor::selectionHasStyle): Ditto.
3780         (WebCore::Editor::Editor): Initialize m_shouldStartNewKillRingSequence.
3781         (WebCore::Editor::insertTextWithoutSendingTextEvent): Updated for
3782         selectionForCommand change.
3783         (WebCore::Editor::copy): Updated for imageElementFromImageDocument change.
3784         (WebCore::Editor::toggleBold): Call the ToggleBold command via the command
3785         machinery since it's no longer in this file as a local function.
3786         (WebCore::Editor::toggleUnderline): Call the ToggleUnderline command.
3787         (WebCore::Editor::setBaseWritingDirection): Change type of argument and of
3788         local variable.
3789         (WebCore::Editor::addToKillRing): Moved here from EditorMac. Not useful
3790         without a kill ring, but it's relatively straightforward to implement one.
3791         (WebCore::Editor::appendToKillRing): Put default implementation here for
3792         platforms other than Mac. We should probably put a simple kill ring
3793         implementation here -- doesn't need to be shared with the OS oh platforms
3794         other than Mac.
3795         (WebCore::Editor::prependToKillRing): Ditto.
3796         (WebCore::Editor::yankFromKillRing): Ditto.
3797         (WebCore::Editor::startNewKillRingSequence): Ditto.
3798         (WebCore::Editor::setKillRingToYankedState): Ditto.
3799
3800         * editing/Editor.h: Moved the TriState enum here instead of inside the
3801         Frame class. Added EditorCommandSource enum. Moved selectionHasStyle
3802         here from the Frame class. Added Editor::Command class with five functions
3803         for the various things you can do with a command (execute it, check if it
3804         can be used, and its state and value). Changed hte parameter of
3805         setBaseWritingDirection to be a const String& rather than a String.
3806         Got rid of the kill-ring-related operations, but added the kill ring
3807         functions themselves. Made selectedRange() public. Made the
3808         m_startNewKillRingSequence not Mac-specific and added "should" to its
3809         name.
3810
3811         * editing/EditorCommand.cpp: Copied from WebCore/editing/Editor.cpp.
3812         Retained only the editing commands.
3813         (WebCore::targetFrame): Moved to the top of the file.
3814         (WebCore::executeApplyStyle): Added. Helper function for commands
3815         that need to apply styles.
3816         (WebCore::executeToggleStyle): Added. Helper function for commands
3817         that need to toggle styles based on the style of the start of selection.
3818         (WebCore::executeApplyParagraphStyle): Added. Like executeApplyStyle, but
3819         for paragraph styles.
3820         (WebCore::executeInsertFragment): Added. Helper function for commands
3821         that need to insert a DOM fragment.
3822         (WebCore::executeInsertNode): Added. Helper function for commands that
3823         need to insert a tree rooted in a single DOM node.
3824         (WebCore::stateStyle): Added. Helper function for the state of commands
3825         that represent style.
3826         (WebCore::valueStyle): Added. Helper function for the value of commands
3827         that represent style.
3828         (WebCore::canScroll): Added. Helper functions for some move and scroll
3829         commands that need to determine if the renderer they are in can scroll.
3830         (WebCore::unionDOMRanges): Moved here from EditorMac.
3831         (WebCore::executeBackColor):
3832         (WebCore::executeBackwardDelete):
3833         (WebCore::executeCopy):
3834         (WebCore::executeCreateLink):
3835         (WebCore::executeCut):
3836         (WebCore::executeDelete):
3837         (WebCore::executeDeleteToMark):
3838         (WebCore::executeDeleteWordBackward):
3839         (WebCore::executeDeleteWordForward):
3840         (WebCore::executeFindString):
3841         (WebCore::executeFontName):
3842         (WebCore::executeFontSize):
3843         (WebCore::executeFontSizeDelta):
3844         (WebCore::executeForeColor):
3845         (WebCore::executeFormatBlock):
3846         (WebCore::executeForwardDelete):
3847         (WebCore::executeIndent):
3848         (WebCore::executeInsertBacktab):
3849         (WebCore::executeInsertHorizontalRule):
3850         (WebCore::executeInsertHTML):
3851         (WebCore::executeInsertImage):
3852         (WebCore::executeInsertLineBreak):
3853         (WebCore::executeInsertNewline):
3854         (WebCore::executeInsertNewlineInQuotedContent):
3855         (WebCore::executeInsertOrderedList):
3856         (WebCore::executeInsertParagraph):
3857         (WebCore::executeInsertTab):
3858         (WebCore::executeInsertText):
3859         (WebCore::executeInsertUnorderedList):
3860         (WebCore::executeJustifyCenter):
3861         (WebCore::executeJustifyFull):
3862         (WebCore::executeJustifyLeft):
3863         (WebCore::executeJustifyRight):
3864         (WebCore::executeMoveBackward):
3865         (WebCore::executeMoveBackwardAndModifySelection):
3866         (WebCore::executeMoveDown):
3867         (WebCore::executeMoveDownAndModifySelection):
3868         (WebCore::executeMoveDownByPageAndModifyCaret):
3869         (WebCore::executeMoveForward):
3870         (WebCore::executeMoveForwardAndModifySelection):
3871         (WebCore::executeMoveLeft):
3872         (WebCore::executeMoveLeftAndModifySelection):
3873         (WebCore::executeMoveRight):
3874         (WebCore::executeMoveRightAndModifySelection):
3875         (WebCore::executeMoveToBeginningOfDocument):
3876         (WebCore::executeMoveToBeginningOfDocumentAndModifySelection):
3877         (WebCore::executeMoveToBeginningOfLine):
3878         (WebCore::executeMoveToBeginningOfLineAndModifySelection):
3879         (WebCore::executeMoveToBeginningOfParagraph):
3880         (WebCore::executeMoveToBeginningOfParagraphAndModifySelection):
3881         (WebCore::executeMoveToBeginningOfSentence):
3882         (WebCore::executeMoveToBeginningOfSentenceAndModifySelection):
3883         (WebCore::executeMoveToEndOfDocument):
3884         (WebCore::executeMoveToEndOfDocumentAndModifySelection):
3885         (WebCore::executeMoveToEndOfSentence):
3886         (WebCore::executeMoveToEndOfSentenceAndModifySelection):
3887         (WebCore::executeMoveToEndOfLine):
3888         (WebCore::executeMoveToEndOfLineAndModifySelection):
3889         (WebCore::executeMoveToEndOfParagraph):
3890         (WebCore::executeMoveToEndOfParagraphAndModifySelection):
3891         (WebCore::executeMoveParagraphBackwardAndModifySelection):
3892         (WebCore::executeMoveParagraphForwardAndModifySelection):
3893         (WebCore::executeMoveUp):
3894         (WebCore::executeMoveUpAndModifySelection):
3895         (WebCore::executeMoveUpByPageAndModifyCaret):
3896         (WebCore::executeMoveWordBackward):
3897         (WebCore::executeMoveWordBackwardAndModifySelection):
3898         (WebCore::executeMoveWordForward):
3899         (WebCore::executeMoveWordForwardAndModifySelection):
3900         (WebCore::executeMoveWordLeft):
3901         (WebCore::executeMoveWordLeftAndModifySelection):
3902         (WebCore::executeMoveWordRight):
3903         (WebCore::executeMoveWordRightAndModifySelection):
3904         (WebCore::executeOutdent):
3905         (WebCore::executePaste):
3906         (WebCore::executePasteAndMatchStyle):
3907         (WebCore::executePrint):
3908         (WebCore::executeRedo):
3909         (WebCore::executeRemoveFormat):
3910         (WebCore::executeSelectAll):
3911         (WebCore::executeSelectToMark):
3912         (WebCore::executeSetMark):
3913         (WebCore::executeStrikethrough):
3914         (WebCore::executeSubscript):
3915         (WebCore::executeSuperscript):
3916         (WebCore::executeSwapWithMark):
3917         (WebCore::executeToggleBold):
3918         (WebCore::executeToggleItalic):
3919         (WebCore::executeTranspose):
3920         (WebCore::executeUnderline):
3921         (WebCore::executeUndo):
3922         (WebCore::executeUnlink):
3923         (WebCore::executeUnscript):
3924         (WebCore::executeUnselect):
3925         (WebCore::executeYank):
3926         (WebCore::executeYankAndSelect):
3927         (WebCore::supported):
3928         (WebCore::supportedPaste):
3929         (WebCore::enabled):
3930         (WebCore::enabledAnySelection):
3931         (WebCore::enabledAnySelectionAndMark):
3932         (WebCore::enableCaretInEditableText):
3933         (WebCore::enabledCopy):
3934         (WebCore::enabledCut):
3935         (WebCore::enabledInEditableText):
3936         (WebCore::enabledInRichlyEditableText):
3937         (WebCore::enabledPaste):
3938         (WebCore::enabledRangeInEditableText):
3939         (WebCore::enabledRangeInRichlyEditableText):
3940         (WebCore::enabledRedo):
3941         (WebCore::enabledUndo):
3942         (WebCore::stateNone):
3943         (WebCore::stateBold):
3944         (WebCore::stateItalic):
3945         (WebCore::stateOrderedList):
3946         (WebCore::stateStrikethrough):
3947         (WebCore::stateSubscript):
3948         (WebCore::stateSuperscript):
3949         (WebCore::stateUnderline):
3950         (WebCore::stateUnorderedList):
3951         (WebCore::valueNull):
3952         (WebCore::valueBackColor):
3953         (WebCore::valueFontName):
3954         (WebCore::valueFontSize):
3955         (WebCore::valueFontSizeDelta):
3956         (WebCore::valueForeColor):
3957         (WebCore::createCommandMap): Added lots of commands, including all the commands
3958         from JSEditor. A few commands needed different behavior based on whether they are
3959         invoked from the DOM or a keyboard binding.
3960         (WebCore::Editor::command): Added. Gets a command object given a name.
3961         (WebCore::Editor::Command::Command): Added.
3962         (WebCore::Editor::Command::execute): Added.
3963         (WebCore::Editor::Command::isSupported): Added.
3964         (WebCore::Editor::Command::isEnabled): Added.
3965         (WebCore::Editor::Command::state): Added.
3966         (WebCore::Editor::Command::value): Added.
3967         (WebCore::Editor::execCommand): Changed to call command().execute().
3968
3969         * editing/JSEditor.cpp: Removed.
3970         * editing/JSEditor.h: Removed.
3971
3972         * editing/mac/EditorMac.mm: Changed to provide kill ring primitives intead of
3973         kill ring commands, so the kill ring commands can be cross-platform.
3974         (WebCore::Editor::appendToKillRing): Added.
3975         (WebCore::Editor::prependToKillRing): Added.
3976         (WebCore::Editor::yankFromKillRing): Added.
3977         (WebCore::Editor::startNewKillRingSequence): Added.
3978         (WebCore::Editor::setKillRingToYankedState): Added.
3979
3980         * page/Frame.cpp: Removed selectionHasStyle, TriState, and updateState.
3981         * page/Frame.h: Ditto.
3982
3983         * page/mac/WebCoreFrameBridge.mm: Removed selectionHasStyle.
3984         * page/mac/WebCoreFrameBridge.h: Ditto.
3985
3986         * platform/ContextMenu.cpp:
3987         (WebCore::ContextMenu::checkOrEnableIfNeeded): Updated for TriState change.
3988
3989         * platform/text/StringHash.h:
3990         (WebCore::StringHash::hash): Merged the StrHash<> template classes into this.
3991         (WebCore::StringHash::equal): Ditto.
3992         (WebCore::CaseFoldingHash::hash): Merged the CaseInsensitiveHash<> template
3993         classes into this.
3994         (WebCore::CaseFoldingHash::equal): Ditto.
3995
3996         * platform/text/StringImpl.cpp:
3997         (WebCore::equal): Changed to invoke StringHash.
3998         (WebCore::equalIgnoringCase): Changed to invoke CaseFoldingHash.
3999
4000         * dom/DOMImplementation.cpp:
4001         (WebCore::addString): Updated to use StringHash and CaseFoldingHash.
4002         (WebCore::isSVG10Feature): Ditto.
4003         (WebCore::isSVG11Feature): Ditto.
4004         * loader/FrameLoader.cpp:
4005         (WebCore::localSchemes): Ditto.
4006         * platform/graphics/FontCache.cpp:
4007         (WebCore::computeHash): Ditto.
4008         * platform/network/HTTPHeaderMap.h: Ditto.
4009         * platform/text/PlatformString.h: Ditto.
4010         * platform/text/StringImpl.h: Ditto.
4011         * rendering/RenderPartObject.cpp:
4012         (WebCore::RenderPartObject::updateWidget): Ditto.
4013         * xml/XMLHttpRequest.cpp:
4014         (WebCore::canSetRequestHeader): Ditto.
4015
4016         * rendering/RenderTreeAsText.cpp: Removed stray include of JSEditor.h.
4017
4018 2007-12-11  Darin Adler  <darin@apple.com>
4019
4020         * platform/wx/KeyboardEventWx.cpp:
4021         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Another try at fixing the
4022         WX build. Changes the code around a little bit.
4023
4024 2007-12-11  Darin Adler  <darin@apple.com>
4025
4026         * platform/wx/KeyboardEventWx.cpp:
4027         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Quick try at fixing build.
4028
4029 2007-12-11  Dan Bernstein  <mitz@apple.com>
4030
4031         Reviewed by Darin Adler.
4032
4033         - fix <rdar://problem/5631507> Text doesn't wrap properly at Tamil version of Wikipedia
4034
4035         Test: fast/text/international/complex-character-based-fallback.html
4036
4037         * platform/graphics/Font.cpp:
4038         (WebCore::Font::glyphDataForCharacter): Added a forceSmallCaps argument
4039         that forces this function to use the small caps font. It is used for
4040         combining marks that need to combine with a small cap.
4041         * platform/graphics/Font.h:
4042         * platform/win/UniscribeController.cpp:
4043         (WebCore::UniscribeController::advance): Changed to split the string
4044         into runs of characters that will be rendered using the same FontData.
4045         This is done by calling glyphDataForCharacter() for each cahracter to
4046         find the FontData it should be rendered with.
4047         (WebCore::UniscribeController::itemizeShapeAndPlace): Added a fontData
4048         argument that is passed on to shapeAndPlaceItem() instead of the
4049         smallCaps argument.
4050         (WebCore::UniscribeController::shapeAndPlaceItem): Added a fontData
4051         argument and removed the font fallback logic from this function, as
4052         it is now expected to be called with an item all of whose characters
4053         can be rendered with the given fontData.
4054         * platform/win/UniscribeController.h:
4055
4056 2007-12-07  Alexey Proskuryakov  <ap@webkit.org>
4057
4058         Reviewed by Darin.
4059
4060         <rdar://problem/5535636>
4061         Have to press 4 times instead of 2 times to get the expected result of ^^ with german keyboard.
4062
4063         http://bugs.webkit.org/show_bug.cgi?id=13916
4064         JavaScript detects Tab as a character input on a textfield validation
4065
4066         Test: platform/win/fast/events/double-dead-char.html
4067
4068         * platform/PlatformKeyboardEvent.h:
4069         (WebCore::PlatformKeyboardEvent::):
4070         (WebCore::PlatformKeyboardEvent::type):
4071         (WebCore::PlatformKeyboardEvent::windowsVirtualKeyCode):
4072         (WebCore::PlatformKeyboardEvent::setWindowsVirtualKeyCode):
4073         (WebCore::PlatformKeyboardEvent::keyIdentifier):
4074         (WebCore::PlatformKeyboardEvent::setIsAutoRepeat):
4075         Added an explicit type member to differentiate different kinds of events:
4076           RawKeyDown == keydown == WM_KEYDOWN
4077           KeyUp == keyup == WM_KEYUP
4078           Char == keypress == WM_CHAR
4079           KeyDown == e.g. NSKeyDown or NSFlagsChanged, used on platforms that have a different model for
4080           event processing, and needs to be converted to RawKeyDown (+ Char) for processing in DOM.
4081
4082         * platform/mac/KeyEventMac.mm:
4083         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Updated for changed data members.
4084         Fix Enter (numeric keypad) charCode to match Return, as we check for it from keypress default handlers.
4085         (WebCore::windowsKeyCodeForKeyEvent): 
4086         (WebCore::isKeyUpEvent): Made it do something closer to what it claims; added a FIXME explaining
4087         that it still fails.
4088         (WebCore::disambiguateKeyDownEvent): Downgrade from KeyDown to RawKeyDown or Char, removing information that
4089         should not be available in those (because it cannot be provided on Windows).
4090
4091         * platform/win/KeyEventWin.cpp:
4092         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Updated for changed data members.
4093         Used standard Windows constants for bit masks instead of our own ones.
4094         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): Should never be called on Windows.
4095
4096         * platform/gtk/KeyEventGtk.cpp:
4097         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
4098         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
4099         * platform/qt/PlatformKeyboardEventQt.cpp:
4100         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
4101         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
4102         * platform/wx/KeyboardEventWx.cpp:
4103         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
4104         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
4105         Updated for cross-platform changes as much as it was possible without appropriate build
4106         environments.
4107
4108         * WebCore.base.exp: Export PlatformKeyboardEvent::disambiguateKeyDownEvent(), used by platforms that need to
4109         convert their fancy key events to RawKeyDown/Char pairs. Export Editor::isTextInsertionCommand().
4110
4111         * bridge/EditorClient.h:
4112         Renamed handleKeypress() to handleKeyboardEvent(), as it gets both keydowns and keypresses.
4113         Renamed handleInputMethodKeypress() to handleInputMethodKeydown(), as IMs work with raw keydowns.
4114
4115         * dom/Document.h:
4116         * dom/Document.cpp:
4117         (WebCore::Document::defaultEventHandler): Moved accesskey processing to EventHandler.
4118
4119         * dom/KeyboardEvent.h: Added comments describing keyCode/charCode behavior.
4120
4121         * dom/KeyboardEvent.cpp:
4122         (WebCore::eventTypeForKeyboardEventType):
4123         (WebCore::KeyboardEvent::KeyboardEvent): Conversion between platform and DOM event types is
4124         now straightforward, so scary hacks such as using autorepeat to distinguish types are
4125         not needed.
4126         (WebCore::KeyboardEvent::keyCode): Added a comment describing other browsers' behavior.
4127         (WebCore::KeyboardEvent::charCode): Added a comment describing other browsers' behavior.
4128         Changed to a more compatible behavior: raw keydown/keyup events do not and can not have
4129         character codes.
4130
4131         * editing/Editor.h:
4132         * editing/Editor.cpp:
4133         (WebCore::Editor::isTextInsertionCommand): Is this command actually text input in disguise?
4134         (WebCore::Editor::handleKeyboardEvent): Updated for new function names.
4135         (WebCore::Editor::handleInputMethodKeydown): Ditto.
4136
4137         * html/HTMLButtonElement.cpp:
4138         (WebCore::HTMLButtonElement::defaultEventHandler): Perform the default action when handling an
4139         appropriate event. Enter is processed on keypress (and thus should be checked for via charCode,
4140         not keyIdentifier), Space is processed on keydown+keyup! We now match IE in that a button is
4141         highlighted when Space is pressed.
4142
4143         * html/HTMLInputElement.cpp:
4144         (WebCore::HTMLInputElement::defaultEventHandler):
4145         * html/HTMLSelectElement.cpp:
4146         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
4147         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
4148         Made a number of fixes to when default actions take place, similar to HTMLButtonElement ones
4149         described above.
4150
4151         * page/EventHandler.cpp:
4152         (WebCore::EventHandler::keyEvent): Unless we have a combined KeyDown, just forward the event
4153         to the target. Call accesskey handling directly, as it doesn't seem to be part of normal event
4154         handling in IE. Also streamlined the code in KeyDown case, thanks to handleInputMethodKeypress()
4155         now being handleInputMethodKeydown().
4156         (WebCore::EventHandler::handleTextInputEvent): Check that we were not called from keydown.
4157         (WebCore::EventHandler::defaultTextInputEventHandler): Removed a call to defaultTabEventHandler,
4158         as default tab handling happens when processing keydown.
4159         (WebCore::handleAccessKey): Moved from Document, as access keys are processed outside normal
4160         event handling. Fixed accesskey processing to use information that's available in a raw keydown
4161         event.
4162
4163         (WebCore::EventHandler::defaultKeyboardEventHandler): Do not ignore keydown; in particular,
4164         handle tabs during keydown processing.
4165
4166         * page/mac/EventHandlerMac.mm:
4167         (WebCore::EventHandler::currentKeyboardEvent): Disambiguate KeyDown as RawKeyDown, as this is
4168         what callers want.
4169
4170         * platform/text/PlatformString.h:
4171         * platform/text/String.cpp:
4172         (WebCore::String::characterStartingAt):
4173         * platform/text/StringImpl.cpp:
4174         (WebCore::StringImpl::characterStartingAt):
4175         * platform/text/StringImpl.h:
4176         Added a UChar32 accessor.
4177
4178         * svg/graphics/SVGImageEmptyClients.h:
4179         (WebCore::SVGEmptyEditorClient::handleKeyboardEvent):
4180         (WebCore::SVGEmptyEditorClient::handleInputMethodKeydown):
4181         Updated for new function names.
4182
4183 2007-12-11  John Sullivan  <sullivan@ap