Keep buildbot happy.
[WebKit-https.git] / WebCore / ChangeLog
1 2007-03-27  Antti Koivisto  <antti@apple.com>
2
3         Keep buildbot happy.
4
5         * platform/mac/PlatformScrollBarMac.mm:
6         (WebCore::PlatformScrollbar::scrollbarHit):
7
8 2007-03-26  Antti Koivisto  <antti@apple.com>
9
10         Reviewed by Darin.
11         
12         On Mac, support fine grained wheel events generated by trackpad and Mighty Mouse.
13         http://bugs.webkit.org/show_bug.cgi?id=13134
14         <rdar://problem/5076249?
15
16         * WebCore.exp:
17             Export _wkGetWheelEventDeltas
18         * page/EventHandler.cpp:
19         (WebCore::EventHandler::handleWheelEvent):
20             Remove (0, 0) scroll event hack, it is not needed anymore.
21             Do per-pixel scrolling for fine grained events.
22         * platform/PlatformWheelEvent.h:
23         (WebCore::PlatformWheelEvent::isContinuous):
24             Add new m_isContinuous boolean to indicate fine grained wheel events.
25         * platform/ScrollBar.cpp:
26         (WebCore::Scrollbar::Scrollbar):
27         (WebCore::Scrollbar::setValue):
28         (WebCore::Scrollbar::setSteps):
29         (WebCore::Scrollbar::scroll):
30         * platform/ScrollBar.h:
31         (WebCore::Scrollbar::value):
32             Use float to represent current position to support finer grained scrolling.
33             Add ScrollByPixel, remove ScrollByWheel (which was same as ScrollByLine anyway)
34         * platform/ScrollTypes.h:
35         (WebCore::):
36         * platform/gdk/WheelEventGdk.cpp:
37         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
38             Initalize m_isContinuous
39         * platform/mac/WebCoreSystemInterface.h:
40         * platform/mac/WebCoreSystemInterface.mm:
41             Add wkGetWheelEventDeltas for getting fine grained wheel events
42         * platform/mac/WheelEventMac.mm:
43         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
44             Get the wheel deltas using new wkGetWheelEventDeltas interface
45         * platform/qt/WheelEventQt.cpp:
46         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
47             Initalize m_isContinuous
48         * rendering/RenderListBox.cpp:
49         (WebCore::RenderListBox::calcHeight):
50             Pass item height to scrollbar
51
52 2007-03-26  Geoffrey Garen  <ggaren@apple.com>
53
54         Reviewed by Darin Adler.
55
56         Fixed <rdar://problem/5088234> REGRESSION: Crash occurs at WebCore::Node::
57         createRendererIfNeeded() when changing map views with MS Virtual Earth 
58         (http://www.ziprealty.com/)
59         
60         The cause of the crash was the insertion of a <script> element whose
61         script removed it from the document. The <script> element would then be 
62         garbage when the insertion routine went on to attach() it.
63         
64         The solution here is to check that an element is still your child before
65         trying to attach() it. This matches the style of checks we do elsewhere
66         in the node insertion and removal code.
67
68         * dom/ContainerNode.cpp:
69         (WebCore::ContainerNode::insertBefore):
70         (WebCore::ContainerNode::replaceChild):
71         (WebCore::ContainerNode::appendChild):
72
73 2007-03-26  David Carson  <dacarson@gmail.com>
74
75         Reviewed by Darin, landed by Anders.
76
77         Manual test case for: REGRESSION (r19559): Java applet crash
78         http://bugs.webkit.org/show_bug.cgi?id=13142
79         <rdar://problem/5080340>
80
81         * manual-tests/liveconnect-applet-get-boolean.html: Added.
82         * manual-tests/resources/CheckerApplet.class: Added.
83         * manual-tests/resources/CheckerApplet.java: Added.
84
85 2007-03-26  Mitz Pettel  <mitz@webkit.org>
86
87         Reviewed and landed by Darin.
88
89         - fix http://bugs.webkit.org/show_bug.cgi?id=13194
90           <rdar://problem/5087738>
91           REGRESSION: Selection rects are wrong for images in search results from images.google.com
92
93         Test: fast/replaced/selection-rect-in-table-cell.html
94
95         * rendering/RenderReplaced.cpp:
96         (WebCore::RenderReplaced::selectionRect):
97
98 2007-03-26  Geoffrey Garen  <ggaren@apple.com>
99
100         Removed now-stale #includes of <assert.h>.
101         
102         * WebCorePrefix.h:
103         * config.h:
104         * css/CSSGrammar.y:
105         * platform/Arena.cpp:
106         * platform/KURL.cpp:
107         * platform/SegmentedString.h:
108         * rendering/DataRef.h:
109         * rendering/RenderArena.cpp:
110
111 2007-03-26  Geoffrey Garen  <ggaren@apple.com>
112
113         Reviewed by Kevin McCulough.
114
115         Global replace of "assert(" with "ASSERT(" to assist debugging. Removed
116         one instance of commented-out code containing "assert(" instead of replacing it.
117
118 2007-03-25  Antti Koivisto  <antti@apple.com>
119
120         Reviewed by Adam.
121
122         Fix <rdar://problem/5049842>
123         Gmail Editor: Dragging message text in the message body results in a crash at WebCore::Frame::eventHandler()
124
125         Null check frame in m_dragTarget, it might be gone already.
126
127         * page/EventHandler.cpp:
128         (WebCore::EventHandler::updateDragAndDrop):
129         (WebCore::EventHandler::cancelDragAndDrop):
130         (WebCore::EventHandler::performDragAndDrop):
131
132 2007-03-25  Alexey Proskuryakov  <ap@webkit.org>
133
134         Reviewed by Darin.
135
136         A partial fix for http://bugs.webkit.org/show_bug.cgi?id=13021
137         XPath can be very slow
138
139         * xml/XPathExpression.cpp:
140         (WebCore::XPathExpression::evaluate): Reset a reference to the context node, as this may prevent the whole document
141         from being destroyed in time.
142
143         * dom/Attr.cpp:
144         (WebCore::Attr::createTextChild): Instead of calling appendChild(), just do the few operations it really needs to perform.
145         * dom/ContainerNode.h:
146         (WebCore::ContainerNode::fastSetFirstChild):
147         (WebCore::ContainerNode::fastSetLastChild):
148         Added operations that let Attr hack internal ContainerNode data (evil, but fast!).
149
150         * xml/XPathStep.cpp:
151         (WebCore::XPath::Step::evaluate):
152         (WebCore::XPath::Step::nodesInAxis):
153         (WebCore::XPath::Step::nodeMatches):
154         * xml/XPathStep.h:
155         Merged node testing into axis enumeration. This saves a lot of Vector resizing and passing, and is necessary for future 
156         optimizations (sometimes, we can just pick the single result node instead of enumerating and filtering the whole axis).
157
158 2007-03-24  Mitz Pettel  <mitz@webkit.org>
159
160         Reviewed by Darin.
161
162         - fix http://bugs.webkit.org/show_bug.cgi?id=13156
163           REGRESSION (r19621): Pasting breakable content where wrapped line is too long to fit in a textarea fails to draw a horizontal scrollbar
164
165         Test: fast/text/midword-break-after-breakable-char.html
166
167         Breaking in the middle of the word
168         is allowed only if no breaking opportunity between words has occurred yet. The
169         first position on the line should not be considered "between words" even if
170         it is a breaking opportunity.
171         
172         * rendering/bidi.cpp:
173         (WebCore::RenderBlock::findNextLineBreak): Changed according to the above. Also
174         cleaned up a couple of lines.
175
176 2007-03-24  David Hyatt  <hyatt@apple.com>
177
178         Fix for bugzilla bug 13187, place a hard limit on the amount of decoded data that WebCore will keep
179         around even on live pages (pages being displayed in tabs/windows or in the back/forward cache).
180         Images will decode to paint and once the decoded data exceeds the cache size, the decoded data will be
181         tossed.
182
183         Refine the flushing algorithm to apply the two-pass decode/evict model to each LRU-SP queue individually, rather
184         than to all the lists at once.  This allows the cache to evict large encoded resources before flushing small
185         or frequently accessed decoded onces.
186
187         Added information on live/decoded data to the cache statistics.
188
189         Reviewed by darin
190
191         * loader/Cache.cpp:
192         (WebCore::Cache::Cache):
193         (WebCore::Cache::pruneLiveResources):
194         (WebCore::Cache::pruneAllResources):
195         (WebCore::Cache::setMaximumSize):
196         (WebCore::Cache::remove):
197         (WebCore::Cache::lruListFor):
198         (WebCore::Cache::removeFromLRUList):
199         (WebCore::Cache::insertInLRUList):
200         (WebCore::Cache::liveLRUListFor):
201         (WebCore::Cache::removeFromLiveResourcesList):
202         (WebCore::Cache::insertInLiveResourcesList):
203         (WebCore::Cache::addToLiveResourcesSize):
204         (WebCore::Cache::removeFromLiveResourcesSize):
205         (WebCore::Cache::adjustSize):
206         (WebCore::Cache::getStatistics):
207         * loader/Cache.h:
208         (WebCore::Cache::TypeStatistic::TypeStatistic):
209         * loader/CachedImage.cpp:
210         (WebCore::CachedImage::decodedSizeWillChange):
211         (WebCore::CachedImage::decodedSizeChanged):
212         * loader/CachedImage.h:
213         * loader/CachedResource.cpp:
214         (WebCore::CachedResource::CachedResource):
215         (WebCore::CachedResource::ref):
216         (WebCore::CachedResource::deref):
217         (WebCore::CachedResource::setEncodedSize):
218         (WebCore::CachedResource::liveResourceAccessed):
219         * loader/CachedResource.h:
220         (WebCore::CachedResource::liveAccessCount):
221         (WebCore::CachedResource::resetLiveAccessCount):
222         (WebCore::CachedResource::increaseLiveAccessCount):
223         * platform/graphics/BitmapImage.cpp:
224         (WebCore::BitmapImage::destroyDecodedData):
225         (WebCore::BitmapImage::cacheFrame):
226         * platform/graphics/ImageObserver.h:
227         * rendering/RenderBox.cpp:
228         (WebCore::RenderBox::paintBackgroundExtended):
229         * rendering/RenderImage.cpp:
230         (WebCore::RenderImage::paint):
231         * rendering/RenderListMarker.cpp:
232         (WebCore::RenderListMarker::paint):
233         * rendering/RenderObject.cpp:
234         (WebCore::RenderObject::paintBorderImage):
235
236 2007-03-24  Darin Adler  <darin@apple.com>
237
238         Reviewed by Mitz.
239
240         - fix http://bugs.webkit.org/show_bug.cgi?id=13123
241           CSS selectors that use :lang, :not, and namespaces do not serialize correctly
242
243         Test: fast/css/css-selector-text.html
244
245         * css/CSSSelector.cpp: (WebCore::CSSSelector::selectorText): Add the namespace
246         prefix for tag or attribute names, the sub-selector for :not, and the argument
247         for :lang.
248
249 2007-03-24  Brady Eidson  <beidson@apple.com>
250
251         Reviewed by Adam
252
253         <rdar://problem/5086210> - Move RetainPtr to WTF
254
255         * ForwardingHeaders/wtf/RetainPtr.h: Added.
256         * WebCore.xcodeproj/project.pbxproj: Removed WebCore/RetainPtr.h
257         
258         * history/HistoryItem.h: Changed #include to <wtf/RetainPtr.h>
259         * history/PageCache.h: Ditto
260         * page/mac/WebCoreFrameBridge.mm: Ditto
261         * platform/ContextMenu.h: Ditto
262         * platform/ContextMenuItem.h: Ditto
263         * platform/DragImage.h: Ditto
264         * platform/FileChooser.h: Ditto
265         * platform/PlatformKeyboardEvent.h: Ditto
266         * platform/PopupMenu.h: Ditto
267         * platform/SharedBuffer.h: Ditto
268         * platform/cf/RetainPtr.h: Removed.
269         * platform/graphics/Icon.h: Changed #include
270         * platform/mac/ClipboardMac.h: Ditto
271         * platform/mac/PasteboardMac.mm: Ditto
272         * platform/mac/WidgetMac.mm: Ditto
273         * platform/network/AuthenticationChallenge.h: Ditto
274         * platform/network/ResourceError.h: Ditto
275         * platform/network/ResourceHandle.h: Ditto
276         * platform/network/ResourceRequest.h: Ditto
277         * platform/network/ResourceResponse.h: Ditto
278         * rendering/RenderThemeMac.mm: Ditto
279
280 2007-03-24  Mitz Pettel  <mitz@webkit.org>
281
282         Fix for <rdar://problem/5086797>, layoutPending is now reporting incorrect results, which will lead
283         to all sorts of layout issues.  This is in bugzilla as 13179.
284
285         Reviewed by hyatt
286
287         - fix http://bugs.webkit.org/show_bug.cgi?id=13179
288           REGRESSION (r20410): In debug builds, loading a certain page is suspended until redisplay is forced
289
290         Moved the root->needsLayout() check from layoutPending() to needsLayout()
291         to restore the behavior before r20324.
292
293         * page/FrameView.cpp:
294         (WebCore::FrameView::layoutPending):
295         (WebCore::FrameView::needsLayout):
296
297 2007-03-24  Mitz Pettel  <mitz@webkit.org>
298
299         Reviewed by Adele.
300
301         - fix http://bugs.webkit.org/show_bug.cgi?id=13180
302               <rdar://problem/5084478>
303           Another debug build crash from ASSERTION FAILED: !needsLayout()
304
305         No test possible because updateRendering() is always called after script
306         execution.
307
308         * page/FrameView.cpp:
309         (WebCore::FrameView::layout): Get the layout root after calling recalcStyle()
310         since a style recalc may result in needing to do start layout at the root.
311
312 2007-03-24  Nikolas Zimmermann  <zimmermann@kde.org>
313
314         Not reviewed. Build fix.
315
316         Fix FloatRect vs. IntRect confusion.
317
318         * rendering/RenderSVGImage.cpp:
319         (WebCore::RenderSVGImage::nodeAtPoint):
320
321 2007-03-25  Mark Rowe  <mrowe@apple.com>
322
323         Fix incorrect radar number.
324
325         * platform/network/mac/ResourceHandleMac.mm:
326         (-[WebCoreResourceHandleAsDelegate connection:willCacheResponse:]):
327
328 2007-03-23  Nikolas Zimmermann  <zimmermann@kde.org>
329
330         Reviewed by Oliver.
331
332         Fix all known RenderSVGImage problems.
333
334         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12126 (RenderSVGImage seems to suffer from integer overflow)
335         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12442 (raster images disappearing during script execution (SVG))
336         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12572 (WebKit does not properly invalidate image region after image load)
337
338         Added test: svg/custom/scrolling-embedded-svg-file-image-repaint-problem.html
339
340         In RenderSVGImage::paint, do not call shouldPaint() as this will never work properly for SVG renderers, as shouldPaint
341         doesn't take into account any special SVG transformation (localTransform/absoluteTransform). Just remove the call.
342
343         Fix hit detection on RenderSVGImage - it didn't work properly at all. No idea why I didn't notice before.
344         Thanks Andreas Neumann once again for writing excellent bug reports and pointing me to them :-)
345
346         The carto.net navigation tools work as expected now, and also the "dock like" image effect example.
347
348         * rendering/RenderSVGImage.cpp:
349         (WebCore::RenderSVGImage::paint):
350         (WebCore::RenderSVGImage::nodeAtPoint):
351
352 2007-03-24  Mitz Pettel  <mitz@webkit.org>
353
354         Reviewed by Dave Hyatt.
355
356         - http://bugs.webkit.org/show_bug.cgi?id=13177
357           Suppress control characters in the ATSUI code path
358
359         * platform/mac/FontMac.mm:
360         (WebCore::overrideLayoutOperation):
361         (WebCore::ATSULayoutParameters::initialize):
362
363 2007-03-24  David Hyatt  <hyatt@apple.com>
364
365         Fix for <rdar://problem/5086400>, images scrolled offscreen continue to animate.  Safari 2 would
366         halt animations when images were no longer visible.
367
368         Reviewed by mjs, olliej
369
370         * platform/graphics/BitmapImage.cpp:
371         (WebCore::BitmapImage::advanceAnimation):
372
373 2007-03-24  David Hyatt  <hyatt@apple.com>
374
375         Fix for <rdar://problem/508328>, sluggish text entry in search field.  Make sure
376         our size actually changed before we decide to do a full repaint because of background/border
377         complexities.
378
379         Reviewed by aroben
380
381         * rendering/RenderObject.cpp:
382         (WebCore::RenderObject::repaintAfterLayoutIfNeeded):
383
384 2007-03-23  Dave Hyatt  <hyatt@apple.com>
385
386         Fix for <rdar://problem/5048219>, spurious glyphs in gmail.   This is bugzilla bug 13136, which
387         will remain open to cover patching the complex text path.
388         
389         Reviewed by aroben
390
391         * platform/Font.cpp:
392         (WebCore::Font::glyphDataForCharacter):
393         * platform/Font.h:
394         (WebCore::Font::treatAsZeroWidthSpace):
395         * platform/GlyphPageTreeNode.cpp:
396         (WebCore::GlyphPageTreeNode::initializePage):
397
398 2007-03-23  Mitz Pettel  <mitz@webkit.org>
399
400         Reviewed by Adele.
401
402         - fix http://bugs.webkit.org/show_bug.cgi?id=13153
403           REGRESSION: Visual highlighting of pre-populated blank line in textarea is broken
404
405         - fix a bug where selecting across a soft line break did not highlight to
406           the end of the first line if it contained skipped whitespace
407
408         Test: fast/text/selection-hard-linebreak.html
409
410         * rendering/InlineTextBox.cpp:
411         (WebCore::InlineTextBox::selectionState): Changed to treat a selection that ends on the
412         end of a hard line break as if it ends after the line break. Fixed the case of a selection
413         that starts and ends in the same text object as the box but does not intersect it
414         to return SelectionNone instead of selectionBoth.
415
416 2007-03-23  Mitz Pettel  <mitz@webkit.org>
417
418         Reviewed by Adele.
419
420         - fix http://bugs.webkit.org/show_bug.cgi?id=13124
421           REGRESSION: Reproducible crash in Widget::getView
422
423         Test: fast/frames/hover-timer-crash.html
424
425         * page/Frame.cpp:
426         (WebCore::Frame::setView): Added a call to EventHandler::clear().
427
428 2007-03-23  Justin Garcia  <justin.garcia@apple.com>
429
430         Reviewed by adele
431
432         <rdar://problem/5078739> 
433         Crash in in ReplaceSelectionCommand if the fragment contains only a style span
434
435         * editing/ReplaceSelectionCommand.cpp:
436         (WebCore::ReplaceSelectionCommand::doApply): Check 
437         for an empty fragment after removing a redundant
438         style span instead of before.
439
440 2007-03-23  David Hyatt  <hyatt@apple.com>
441
442         <rdar://problem/5085063>
443
444         Fix non-looping animation on cuteoverload.com. Just always flush
445         decoded data for large animated images to avoid our cache getting
446         out of sync with the image source.
447
448         Reviewed by ggaren
449
450         * platform/graphics/BitmapImage.cpp:
451         (WebCore::BitmapImage::advanceAnimation):
452
453 2007-03-23  Adele Peterson  <adele@apple.com>
454
455         Reviewed by Darin.
456
457         Fix for <rdar://problem/5061024> REGRESSION: Returning false from onkeypress event on Input is ignored when key is Tab
458         http://bugs.webkit.org/show_bug.cgi?id= 13020
459
460         No known way to add a layout test for this.  We would need a way to know exactly how the event was consumed.
461
462         * page/EventHandler.cpp: (WebCore::EventHandler::defaultKeyboardEventHandler):
463           If the keypress event has its default behavior prevented, then we should consider the keydown event handled.
464
465 2007-03-23  Justin Garcia  <justin.garcia@apple.com>
466
467         Reviewed by darin
468
469         <rdar://problem/5080333> 
470         REGRESSION: Selection changes when changing the alignment of an image
471         
472         Regression occurred when we started using moveParagraphs
473         to move content in applyBlockStyle.  moveParagraphs 
474         moves by copying, deleting and reinserting content, and
475         so must be accompanied by selection preservation code.
476         That code uses rangeFromLocationAndLength and rangeLength,
477         which use TextIterators, which don't emit anything for images 
478         and other replaced elements, causing this bug.
479
480         * editing/ApplyStyleCommand.cpp:
481         (WebCore::ApplyStyleCommand::applyBlockStyle): Ask rangeLength 
482         and rangeFromLocationAndLength to request that their
483         TextIterators emit spaces for replaced elements.
484         Use rangeCompliantEquivalent()s when creating a Range from
485         VisiblePositions, since some VisiblePositions have illegal
486         deepEquivalent()s.
487         * editing/CompositeEditCommand.cpp:
488         (WebCore::CompositeEditCommand::moveParagraphs): Ditto.
489         * editing/TextIterator.cpp:
490         (WebCore::TextIterator::TextIterator):
491         (WebCore::TextIterator::handleReplacedElement): Emit
492         a space if requested.
493         (WebCore::TextIterator::representNodeOffsetZero): Emit
494         ranges before m_node, not around m_lastTextNode.  These
495         ranges should represent the part of the document associated
496         with the emitted character. 
497         (WebCore::TextIterator::rangeLength): Take in the new bool.
498         (WebCore::TextIterator::rangeFromLocationAndLength): Ditto.
499         Also, don't loop an extra time after finding the end of the
500         range when we're looking for zero length ranges.  This appeared
501         to be a workaround for the bugs fixed in representNodeOffsetZero
502         in this patch.
503         * editing/TextIterator.h:
504
505 2007-03-24  Mark Rowe  <mrowe@apple.com>
506
507         Rubber-stamped by Darin.
508
509         * Configurations/WebCore.xcconfig: Remove unnecessary INFOPLIST_PREPROCESS.
510
511 2007-03-23  Darin Adler  <darin@apple.com>
512
513         * html/HTMLBodyElement.cpp: Fix comment typo.
514
515 2007-03-23  George Staikos  <staikos@kde.org>
516
517         Reviewed and committed by George.
518
519         Patch from Adam Treat to make the Qt build work without SVG and XSLT.
520         XMLNames is required in any case.
521
522         * WebCore.pro:
523
524 2007-03-23  Darin Adler  <darin@apple.com>
525
526         Reviewed by Hyatt.
527
528         - <rdar://problem/5074439> handle margins on frame and iframe elements
529           without involving FrameView, FrameLoader, etc.
530
531         * html/HTMLBodyElement.cpp: (WebCore::HTMLBodyElement::insertedIntoDocument):
532         Grab the margin from the frame directly here. There was no real benefit
533         to doing this via FrameView. Later we can delete quite a bit of unneeded code
534         here and in WebKit that exists only to set up the margin values in FrameView,
535         which are now unused.
536
537 2007-03-23  Adele Peterson  <adele@apple.com>
538
539         Reviewed by Darin.
540
541         Fix for <rdar://problem/5080428> REGRESSION: getting value for hidden input element fails after the fix for Bug 11866
542         http://bugs.webkit.org/show_bug.cgi?id=13121
543
544         Rolled out the change for 11866 that made hidden input elements store the value separately from the value attribute.
545         Added an m_originalValue field that gets set when the element is done being parsed (in closeRenderer).  In reset,
546         use the m_originalValue for hidden input elements.
547
548         * html/HTMLInputElement.cpp:
549         (WebCore::HTMLInputElement::closeRenderer):
550         (WebCore::HTMLInputElement::reset):
551         (WebCore::HTMLInputElement::setValue):
552         (WebCore::HTMLInputElement::storesValueSeparateFromAttribute):
553         * html/HTMLInputElement.h:
554
555 2007-03-23  Mitz Pettel  <mitz@webkit.org>
556
557         Reviewed by Dave Hyatt.
558
559         - fix http://bugs.webkit.org/show_bug.cgi?id=13157
560               <rdar://problem/5083995>
561           List markers positioned incorrectly and don't repaint properly on Oxford homepage
562
563         Test: fast/lists/marker-image-error.html
564
565         * rendering/RenderListMarker.cpp:
566         (WebCore::RenderListMarker::imageChanged): Mark ourselves for relayout if
567         the image failed to load, since that means we will use a bullet instead.
568
569 2007-03-23  Zack Rusin  <zrusin@trolltech.com>
570
571         Fix the compile.
572
573         * platform/graphics/qt/ImageSourceQt.cpp:
574
575 2007-03-22  Dave Hyatt  <hyatt@apple.com>
576
577         Fix for <rdar://problem/5083072>.
578
579         * page/Frame.cpp:
580         (WebCore::Frame::setPrinting):
581         (WebCore::Frame::forceLayoutWithPageWidthRange):
582         * page/Frame.h:
583         * page/mac/WebCoreFrameBridge.mm:
584         (-[WebCoreFrameBridge forceLayoutWithMinimumPageWidth:maximumPageWidth:adjustingViewSize:]):
585
586 2007-03-22  Anders Carlsson  <acarlsson@apple.com>
587
588         Reviewed by Ada.
589
590         <rdar://problem/5074974>
591         CrashTracer: [USER] repro crash in Safari at com.apple.WebCore: WebCore::FrameLoader::activeDocumentLoader const + 6
592         
593         * loader/mac/NetscapePlugInStreamLoaderMac.mm:
594         (WebCore::NetscapePlugInStreamLoader::didReceiveResponse):
595         Don't use ResourceResponse:isHTTP here since that only looks at the protocol instead of if the response came from a 
596         HTTP server (and not a web archive).
597
598 2007-03-22  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
599
600         Not reviewed - gdk build fix.
601
602         * platform/graphics/cairo/ImageSourceCairo.cpp:
603
604 2007-03-22  Dave Hyatt  <hyatt@apple.com>
605
606         Fix for <rdar://problem/5083473>.  Make sure wheeling still forwards to the frame view even
607         when no node is hit.  Technically not ever hitting a node is a regression from the RenderView
608         size changes (making it be the size of the initial containing block according to CSS2.1), but
609         we should still handle this case gracefully in case it comes up again.
610        
611         Reviewed by olliej
612
613         * page/EventHandler.cpp:
614         (WebCore::EventHandler::handleWheelEvent):
615
616 2007-03-22  Justin Garcia  <justin.garcia@apple.com>
617
618         Reviewed by kevin
619
620         <rdar://problem/5081257> 
621         REGRESSION: New Mail signatures start out empty
622
623         * editing/VisiblePosition.cpp:
624         (WebCore::VisiblePosition::canonicalPosition): Allow
625         descent from positions inside the document into an 
626         editable body.
627
628 2007-03-22  Brady Eidson  <beidson@apple.com>
629
630         Reviewed by Adele and John
631
632         <rdar://5043528> - Prepare for new API
633         
634         * platform/network/ResourceHandle.cpp:
635         (WebCore::ResourceHandle::clearAuthentication): Clear CF type
636
637 2007-03-22  Beth Dakin  <bdakin@apple.com>
638
639         Patch by Hyatt, reviewed and committed by me.
640
641         Does not reproduce consistently, so a layout test does not seem 
642         possible.
643
644         Fix for <rdar://problem/5082421> Constantly hitting ASSERT(!
645         needsLayout()) in RenderView::paint()
646
647         * page/FrameView.cpp:
648         (WebCore::FrameView::layoutPending): It is not enough to ask if the 
649         layout timer is active. There may be times that we don't have a 
650         body yet so we cannot schedule layout yet, but the root still needs 
651         layout.  
652
653 2007-03-22  John Sullivan  <sullivan@apple.com>
654
655         Reviewed by Darin
656         
657         Followup for recent fix to 5079700, found by assertion added to Safari.
658
659         * page/mac/FrameMac.mm:
660         (WebCore::Frame::searchForLabelsBeforeElement):
661         Fixed another place in this method where an empty NSString was being returned instead of nil.
662         Cleaned up the style a little too.
663
664 2007-03-22  David Hyatt  <hyatt@apple.com>
665
666         Remove unnecessary destroyFrameAtIndex call.  Now that we throw away
667         the image source, it is no longer needed.
668
669         Reviewed by beth
670
671         * platform/graphics/BitmapImage.cpp:
672         (WebCore::BitmapImage::destroyDecodedData):
673
674 2007-03-22  David Harrison  <harrison@apple.com>
675
676         Reviewed by Geoff, Darin.
677
678         <rdar://problem/5077892> In RapidWeaver 3.5.1, a crash occurs when attempting to load Safari Bookmarks in iMedia Browser
679         
680         * platform/mac/ThreadCheck.mm:
681         (WebCore::_WebCoreThreadViolationCheck):
682         Change default on Tiger to NSLog rather than raise an exception.
683
684 2007-03-22  Darin Adler  <darin@apple.com>
685
686         Reviewed by Brady.
687
688         - use binary_search instead of hash table; slightly better performance and
689           less memory use
690
691         * platform/network/ResourceHandle.cpp: (WebCore::ResourceHandle::portAllowed):
692         Use binary_search.
693
694 2007-03-22  Darin Adler  <darin@apple.com>
695
696         Reviewed by Adele.
697
698         - fix <rdar://problem/5074630> detachChildren call should move from WebKit to WebCore
699
700         * loader/FrameLoader.cpp: (WebCore::FrameLoader::setDocumentLoader):
701         Add a call to detachChildren() after the call to prepareForDataSourceReplacement().
702         There was no reason for this crucial loading step to be left to the client.
703
704 2007-03-22  David Hyatt  <hyatt@apple.com>
705
706         Minor refactoring and cleanup of the bridge calls that want to control layout settings on the RenderView.
707         Have the bridge talk through the FrameView instead of just asking for the RenderView directly.
708
709         Add an assert to help catch situations where the RenderView needs layout at paint time, since this is a known
710         catastrophic scenario that will (much of the time) result in a crash in RenderTableSection::paint.
711
712         Reviewed by aroben
713
714         * page/FrameView.cpp:
715         (WebCore::FrameView::adjustViewSize):
716         (WebCore::FrameView::needsLayout):
717         (WebCore::FrameView::setNeedsLayout):
718         * page/FrameView.h:
719         * page/mac/WebCoreFrameBridge.mm:
720         (-[WebCoreFrameBridge needsLayout]):
721         (-[WebCoreFrameBridge setNeedsLayout]):
722         * rendering/RenderView.cpp:
723         (WebCore::RenderView::paint):
724
725 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
726
727         Reviewed by Beth Dakin.
728         
729         Re-worked the fix in r20375. 'M' and 'm' are not the only commands that
730         accept "extra" coordinates -- virtually all commands accept them.
731
732         * ksvg2/svg/SVGParserUtilities.cpp:
733         (WebCore::SVGPathParser::parseSVG):
734
735 2007-03-21  David Harrison  <harrison@apple.com>
736
737         Reviewed by hyatt.
738
739         <rdar://problem/5072460> CrashTracer: [USER] 1 crashes in Xcode at com.apple.ImageIO.framework: getBandProcPNG + 168
740
741         An NSData object was being alloc/init'd, then returned callers who cast the pointer as a
742         CFDataRef, including calling CFRelease on it. The problem is that under garbage collection, the NS
743         retain count is ignored (it's always 0), but the CFRetain and CFRelease are not ignored. This
744         caused the object to be over-released. The solution that works in both GC and non-GC is to "transfer"
745         the initial NS retain count to the CF retain count, using HardRetainWithNSRelease.
746         
747         The creator of the NSData was SharedBuffer::createNSData. The callers were PDFDocumentImage::dataChanged()
748         and ImageSource::setData(). This particular crash involved the ImageSource::setData() case.
749
750         * platform/SharedBuffer.h:
751         Declare createCFData().
752         
753         * platform/graphics/cg/ImageSourceCG.cpp:
754         (WebCore::ImageSource::setData):
755         Call createCFData instead of createNSData.
756         
757         * platform/graphics/cg/PDFDocumentImage.cpp:
758         (WebCore::PDFDocumentImage::dataChanged):
759         Call createCFData instead of createNSData.
760         
761        * platform/mac/SharedBufferMac.mm:
762         (WebCore::SharedBuffer::createCFData):
763         Implement createCFData(). Use HardRetainWithNSRelease for gc safety.
764         
765 2007-03-21  Mitz Pettel  <mitz@webkit.org>
766
767         Reviewed by Darin.
768
769         - fix http://bugs.webkit.org/show_bug.cgi?id=13145
770           Regression: Scrollbar not resizing after display none
771
772         Test: fast/dynamic/view-overflow.html
773
774         * rendering/RenderView.cpp:
775         (WebCore::RenderView::layout): Reset overflowHeight() and overflowWidth()
776         before calling docHeight() and docWidth(), since the former act as a lower
777         bound for the latter.
778
779 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
780
781         Reviewed by Beth Dakin.
782         
783         A little cleanup based work I've been doing on the SVG parsers.
784
785         * ksvg2/svg/SVGParserUtilities.h:
786         (WebCore::skipString):
787         * ksvg2/svg/SVGPreserveAspectRatio.cpp: Moved checkString into
788         SVGParserUtilities.h, so it could be with all its friends. Renamed 
789         "checkString" to "skipString" to match the rest of the code and to be 
790         clear about which functions move the buffer pointer.
791         (WebCore::SVGPreserveAspectRatio::parsePreserveAspectRatio):
792         * ksvg2/svg/SVGTransformable.cpp:
793         (WebCore::SVGTransformable::parseTransformAttribute): Changed gotos into 
794         returns. Removed unnecessary magic number.
795
796 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
797
798         Reviewed by Beth Dakin.
799         
800         Fixed <rdar://problem/5078471> SVG rgb color parser runs past end of 
801         buffer when running fuzzing test
802
803         * ksvg2/svg/SVGColor.cpp:
804         (WebCore::parseNumberOrPercent): Check for past the end condition.
805         (WebCore::SVGColor::colorFromRGBColorString): Reversed "read past end
806         of buffer, then check if you're past the end" logic.
807
808 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
809
810         Reviewed by Beth Dakin.
811         
812         Fixed <rdar://problem/5079410> SVG path parser hangs, exhausts memory when 
813         running fuzzer test
814
815         * ksvg2/svg/SVGParserUtilities.cpp:
816         (WebCore::SVGPathParser::parseSVG): Don't assume that extra digits are
817         always preceded by an 'M' or an 'm'.
818
819 2007-03-21  John Sullivan  <sullivan@apple.com>
820
821         Reviewed by Adam
822         
823         - fixed <rdar://problem/5079700> REGRESSION (r19702): Name/password aren't autofilled 
824           or saved for .Mac homepage login
825
826         * page/mac/FrameMac.mm:
827         (WebCore::Frame::searchForLabelsBeforeElement):
828         don't count empty strings as valid results
829
830 2007-03-21  Justin Garcia  <justin.garcia@apple.com>
831
832         Reviewed by darin
833
834         * editing/markup.cpp:
835         (WebCore::styleFromMatchedRulesAndInlineDecl): 
836         Release the RefPtr to avoid increasing/decreasing
837         the refcount unnecessarily.
838         (WebCore::propertyMissingOrEqualToNone): Added and used
839         instead of converting values to strings.
840         (WebCore::elementHasTextDecorationProperty): 
841         (WebCore::createMarkup):
842
843 2007-03-21  Justin Garcia  <justin.garcia@apple.com>
844
845         Reviewed by oliver
846
847         <rdar://problem/5075944> 
848         REGRESSION: Partially selected underlined content pastes as plain text
849         
850         We stopped adding markup for all the ancestors
851         of lastClosed up to the commonAncestorBlock
852         because it was adding a lot of unnecessary markup.
853         This caused us to lose underlining when copying a 
854         partially selected underlined element (even though 
855         we put all styles that the copied markup inherits 
856         into a style span, because the text-decoration 
857         isn't inheritable).
858
859         * editing/markup.cpp:
860         (WebCore::styleFromMatchedRulesAndInlineDecl): Moved
861         code here.
862         (WebCore::elementHasTextDecorationProperty): Added.
863         (WebCore::createMarkup): If the copied markup has a
864         text-decoration because some common ancestor has
865         a text-decoration property set, include that ancestor
866         and all its descendants in the copied markup.
867
868 2007-03-21  Oliver Hunt  <oliver@apple.com>
869
870         Reviewed by Antti.
871
872         Update a few SVG attribute parsers to be more defensive against
873         reading beyond the end of input. 
874
875         Fixes rdar://problem/5077218 -- SVG transform parser runs past
876         end of buffer when running fuzzing test
877
878         * ksvg2/svg/SVGParserUtilities.cpp:
879         (WebCore::SVGPathParser::parseSVG):
880         * ksvg2/svg/SVGParserUtilities.h:
881         (WebCore::skipOptionalSpacesOrDelimiter):
882         * ksvg2/svg/SVGTransformable.cpp:
883         (WebCore::parseTransformParamList):
884         (WebCore::SVGTransformable::parseTransformAttribute):
885
886 2007-03-21  Alexey Proskuryakov  <ap@webkit.org>
887
888         Reviewed by Mitz.
889
890         http://bugs.webkit.org/show_bug.cgi?id=13140
891         Crash after loading SVG fragment with XMLHttpRequest (Yosemite Map Geology Layer)
892
893         Test: svg/carto.net/frameless-svg-parse-error.html
894
895         * ksvg2/misc/SVGDocumentExtensions.cpp:
896         (WebCore::SVGDocumentExtensions::reportError): Added a null check.
897         (WebCore::SVGDocumentExtensions::reportWarning): Ditto.
898
899 2007-03-21  Beth Dakin  <bdakin@apple.com>
900
901         Reviewed by Geoff.
902
903         Fix for <rdar://problem/5072678> Crash in
904         RenderLayer::scrollRectToVisible with MallocScribble enabled
905
906         I tried to fix this earlier today but my fix caused a regression
907         scrolling through RSS pages. It turns out that sometimes scroll
908         events need to propagate immediately, and sometimes they must be
909         delayed or they risk deleting objects that are expected to be
910         around after the event has propagated. Mitz's original fix made
911         sheduleEvent() only delay events that happen during layout. This
912         fix marks two other places in addition to layout where events also
913         need to be delayed. These two places are places that were marked
914         with FIXMEs that Mitz removed in his original patch. (There was a
915         third FIXME in RenderLayer::updateScrollInfoAfterLayout() but that
916         case is only called through layout and is covered by Mitz's
917         original patch.)
918
919         * page/FrameView.cpp:
920         (WebCore::FrameView::~FrameView): Added assertion.
921         (WebCore::FrameView::layout): Call new functions to increment and 
922         decrement the queued events count.
923         (WebCore::FrameView::pauseScheduledEvents):
924         (WebCore::FrameView::resumeScheduledEvents): Decrement queued 
925         events count and dispatch events if the count has zeroed.
926         * page/FrameView.h:
927         * rendering/RenderLayer.cpp:
928         (WebCore::RenderLayer::scrollRectToVisible):
929         (WebCore::Marquee::start):
930
931 2007-03-21  Mitz Pettel  <mitz@webkit.org>
932
933         Reviewed by John Sullivan.
934
935         - fix http://bugs.webkit.org/show_bug.cgi?id=13130
936           REGRESSION: Sometimes a frame resizer keeps following the mouse after mouseup
937
938         * rendering/RenderFrameSet.cpp:
939         (WebCore::RenderFrameSet::userResize): Reordered the code to allow resizing
940         to be terminated by a mouseup event regardless of whether the frameset needs
941         layout.
942
943 2007-03-20  Anders Carlsson  <acarlsson@apple.com>
944
945         Reviewed by Oliver.
946
947         <rdar://problem/5077252> 
948         In NetNewsWire 2.1.1 and 3.0d62, a crash occurs after triple-clicking a link on the page
949         
950         * loader/FrameLoader.cpp:
951         (WebCore::FrameLoader::load):
952         Move the m_inStopAllLoaders check to the load function that's common for loading a request or substitute data.
953
954 2007-03-20  Brady Eidson  <beidson@apple.com>
955
956         Reviewed by Anders.
957
958         <rdar://problem/5073391> and http://bugs.webkit.org/show_bug.cgi?id=13137
959
960         Crash in IconDatabase when private browsing is enabled.
961
962         The problem was caused by http://trac.webkit.org/projects/webkit/changeset/20182 
963         which changed many uses of char[] and Vector<char> to SharedBuffer.  The patch
964         tended to literally replace a Vector<char> with RefPtr<SharedBuffers> but forgot
965         to enforce the concept that Vector<char>'s always exist, whereas RefPtr<SharedBuffers>
966         can be null.  This led to derefs.
967
968         I took the opportunity to rework the iconDB functions to live in a SharedBuffer 
969         world, as that didn't exist when they were originally written - now they just return
970         SharedBuffers instead of taking a Vector<char>& as a parameter
971
972         * loader/icon/IconDatabase.cpp:
973         (WebCore::IconDatabase::imageDataForIconURL): Return a SharedBuffer
974         (WebCore::IconDatabase::iconForPageURL): Null check the SharedBuffer before asking
975           it if it's empty
976         (WebCore::IconDatabase::imageDataForIconURLQuery): Return a new SharedBuffer
977
978         * loader/icon/IconDatabase.h: Return SharedBuffer's instead of taking Vector<char>&'s
979
980 2007-03-20  Adam Roben  <aroben@apple.com>
981
982         Rubberstamped by Adele.
983
984         Roll out r20348 because it was causing crashes.
985
986         * page/FrameView.cpp:
987         (WebCore::FrameViewPrivate::FrameViewPrivate):
988         (WebCore::FrameView::layout):
989         (WebCore::FrameView::scheduleEvent):
990
991 2007-03-20  Timothy Hatcher  <timothy@apple.com>
992
993         Reviewed by Kevin Decker.
994
995         Rolling out part of r19828 that caused a scrolling regression in Mail.
996
997         <rdar://problem/4820817> Message jumps around when trying to select text
998
999         * platform/mac/ScrollViewMac.mm:
1000         (WebCore::ScrollView::visibleContentRect):
1001         (WebCore::ScrollView::updateContents):
1002
1003 2007-03-20  Brady Eidson  <beidson@apple.com>
1004
1005         Reviewed by John
1006
1007         <rdar://5071341> - Crash in IconLoader::finishLoading()
1008         
1009         Though the reproducibility of the crash is still elusive, there's been a crasher likely uncovered 
1010         Hyatt's recent caching changings to the IconLoader.  This crash tends to hit on sites without favicons,
1011         that serve up complex 404 pages, often when the load is cancelled or redirected.  Occasionally, it *seems*
1012         the IconLoader is getting failed/cancelled twice.
1013         
1014         This patch adds some assertions and a "fail gracefully in a release build" check that will have to
1015         serve us until we know more about the cause.
1016
1017         * loader/icon/IconLoader.cpp:
1018         (WebCore::IconLoader::didFail): Add an assertion to catch this case
1019         (WebCore::IconLoader::finishLoading): Add an assertion to catch the case, and fail
1020           gracefully in debug builds.  Also add an efficiency check to not commit to the DB if there is no
1021           IconURL
1022
1023 2007-03-20  Antti Koivisto  <antti@apple.com>
1024
1025         Reviewed by Darin.
1026
1027         - fix http://bugs.webkit.org/show_bug.cgi?id=10747
1028         REGRESSION: Using two fingers on a trackpad to scroll inside a text area makes the whole page move
1029         <rdar://problem/5045710>
1030         
1031         Eat smooth scroll events in WebCore if pointer is over scrollable area. Not
1032         really a good fix, smooth scrolling should be supported properly. It should do for now.
1033
1034         * page/EventHandler.cpp:
1035         (WebCore::EventHandler::handleWheelEvent):
1036         * rendering/RenderListBox.cpp:
1037         (WebCore::RenderListBox::isScrollable):
1038         * rendering/RenderListBox.h:
1039         * rendering/RenderObject.cpp:
1040         (WebCore::RenderObject::isScrollable):
1041         * rendering/RenderObject.h:
1042         * rendering/RenderTextControl.cpp:
1043         (WebCore::RenderTextControl::isScrollable):
1044         * rendering/RenderTextControl.h:
1045
1046 2007-03-20  Beth Dakin  <bdakin@apple.com>
1047
1048         Reviewed by Geoff.
1049
1050         Covered by existing test case.
1051
1052         Fix for <rdar://problem/5072678> Crash in 
1053         RenderLayer::scrollRectToVisible with MallocScribble enabled
1054
1055         This removes some code that was added with http://bugs.webkit.org/
1056         show_bug.cgi?id=8360. This code was not needed to fix that bug, but 
1057         the idea behind it was that there are times when it is safe for 
1058         scheduleEvent() to propagate the event immediately. The 
1059         MallocScribble crash revealed that this assumption was a bit too 
1060         broad; the cause of the crash was that we were propagating events 
1061         immediately when it was not safe. Mitz and I discussed this online 
1062         and we agree that the safest solution is to revert to the old 
1063         behavior here, and always delay the propagation of the event. 
1064
1065         * page/FrameView.cpp:
1066         (WebCore::FrameViewPrivate::FrameViewPrivate):
1067         (WebCore::FrameView::layout):
1068         (WebCore::FrameView::scheduleEvent):
1069
1070 2007-03-20  Brady Eidson  <beidson@apple.com>
1071
1072         Reviewed by John Sullivan
1073
1074         Add some very helpful logging to the IconLoader's SubresourceLoaderClient impl.
1075
1076         * loader/icon/IconLoader.cpp:
1077         (WebCore::IconLoader::didReceiveResponse):
1078         (WebCore::IconLoader::didReceiveData):
1079         (WebCore::IconLoader::didFail):
1080         (WebCore::IconLoader::didFinishLoading):
1081
1082 2007-03-20  Justin Garcia  <justin.garcia@apple.com>
1083
1084         Reviewed by darin
1085
1086         <rdar://problem/5071074> 
1087         REGRESSION: Links are pasted as plain text at certain positions
1088         
1089         moveParagraphs calls createMarkup without annotation, which leaves
1090         out anchor elements that aren't fully selected.
1091
1092         * editing/CompositeEditCommand.cpp:
1093         (WebCore::CompositeEditCommand::moveParagraphs): We don't want 
1094         createMarkup to do full annotation here.  Doing so could include 
1095         special ancestor blocks, which would prevent the copied content 
1096         from appearing in the destination paragraph when it's re-inserted.  
1097         Annotation would also inline styles from style sheets,  which is 
1098         unnecessary because the content is being moved to the same 
1099         document it's being moved from.
1100         Added a new bool to createMarkup that when true allows markup for 
1101         special ancestors as long as they are inline when annotation is off.
1102         * editing/markup.cpp:
1103         (WebCore::createMarkup): Don't set specialCommonAncestor if annotation
1104         is off, unless it's inline and we've been told it's ok to include such
1105         elements.
1106         * editing/markup.h:
1107
1108 2007-03-20  Alexey Proskuryakov  <ap@webkit.org>
1109
1110         Reviewed by Darin.
1111
1112         http://bugs.webkit.org/show_bug.cgi?id=12497
1113         Implement XPath result ordering.
1114
1115         XPath::NodeVector typedef is replaced with a real XPath::NodeSet class that knows how 
1116         to sort itself, and can remember whether it has been already sorted.
1117
1118         * CMakeLists.txt:
1119         * WebCore.pro:
1120         * WebCore.xcodeproj/project.pbxproj:
1121         * WebCoreSources.bkl:
1122         Added XPathNodeSet files.
1123
1124         * xml/XPathExpression.cpp: Fixed includes.
1125
1126         * xml/XPathFunctions.cpp:
1127         (WebCore::XPath::FunId::evaluate): Mark the resulting node-set as unsorted.
1128         (WebCore::XPath::FunLocalName::evaluate): Replacing NodeVector with NodeSet.
1129         (WebCore::XPath::FunNamespaceURI::evaluate): Ditto.
1130         (WebCore::XPath::FunName::evaluate): Ditto.
1131         (WebCore::XPath::FunCount::evaluate): Ditto.
1132         (WebCore::XPath::FunSum::evaluate): Ditto.
1133
1134         * xml/XPathNodeSet.cpp: Added.
1135         (WebCore::XPath::parentWithDepth):
1136         (WebCore::XPath::sortBlock):
1137         (WebCore::XPath::NodeSet::sort): Sort the node-set in document order.
1138         (WebCore::XPath::NodeSet::reverse): Reverse the order (useful for making axes such as 
1139         parent or ancestor sorted).
1140         (WebCore::XPath::NodeSet::firstNode): Returns the first node in document order; currently
1141         implemented via fully sorting the node-set, but this can obviously be optimized.
1142         (WebCore::XPath::NodeSet::anyNode): Added for symmetry with firstNode().
1143         
1144         * xml/XPathNodeSet.h: Added.
1145         (WebCore::XPath::NodeSet::NodeSet):
1146         (WebCore::XPath::NodeSet::operator=):
1147         (WebCore::XPath::NodeSet::size):
1148         (WebCore::XPath::NodeSet::isEmpty):
1149         (WebCore::XPath::NodeSet::operator[]):
1150         (WebCore::XPath::NodeSet::reserveCapacity):
1151         (WebCore::XPath::NodeSet::clear):
1152         (WebCore::XPath::NodeSet::swap):
1153         (WebCore::XPath::NodeSet::append):
1154         (WebCore::XPath::NodeSet::markSorted):
1155         (WebCore::XPath::NodeSet::isSorted):
1156         Most of these methods just call Vector counterparts. 
1157
1158         * xml/XPathParser.cpp: Updated the copyright notice.
1159
1160         * xml/XPathPath.cpp:
1161         (WebCore::XPath::Filter::evaluate): Replacing NodeVector with NodeSet.
1162         (WebCore::XPath::Path::evaluate): Ditto.
1163         (WebCore::XPath::LocationPath::evaluate): Replacing NodeVector with NodeSet. This function
1164         always marks the result as unsorted, because it is hard to tell whether a step breaks node order.
1165         Identifying and implementing special cases when it is not necessary to do so is an important
1166         future optimization.
1167
1168         * xml/XPathPath.h: Replacing NodeVector with NodeSet.
1169         * xml/XPathPredicate.cpp:
1170         (WebCore::XPath::EqTestOp::compare): Replacing NodeVector with NodeSet.
1171         (WebCore::XPath::Union::evaluate): Replacing NodeVector with NodeSet. Currently, Union just
1172         marks the result as unordered; we can consider using merge sort to avoid this.
1173
1174         * xml/XPathResult.cpp:
1175         (WebCore::XPathResult::XPathResult): Replacing NodeVector with NodeSet.
1176         (WebCore::XPathResult::singleNodeValue): Ditto.
1177         (WebCore::XPathResult::snapshotLength): Ditto.
1178         (WebCore::XPathResult::iterateNext): Ditto.
1179         (WebCore::XPathResult::snapshotItem): Ditto.
1180         (WebCore::XPathResult::convertTo): Ditto. Sort the result when requested to.
1181
1182         * xml/XPathResult.h: Replacing NodeVector with NodeSet.
1183
1184         * xml/XPathStep.cpp:
1185         (WebCore::XPath::Step::evaluate): If the input is not sorted, mark the output as such, too.
1186         (WebCore::XPath::Step::nodesInAxis): Fixed a number of bugs when enumerating with an
1187         attribute context node.
1188         (WebCore::XPath::Step::nodeTestMatches): Replacing NodeVector with NodeSet.
1189         * xml/XPathStep.h: Ditto.
1190
1191         * xml/XPathUtil.cpp:
1192         (WebCore::XPath::isValidContextNode): XPath data model doesn't put attribute data into child
1193         nodes, so passing such node as a context could cause problems.
1194
1195         * xml/XPathUtil.h: Removed NodeVector typedef.
1196
1197         * xml/XPathValue.cpp:
1198         (WebCore::XPath::Value::Value):
1199         (WebCore::XPath::Value::toNodeSet):
1200         (WebCore::XPath::Value::toBoolean):
1201         (WebCore::XPath::Value::toNumber):
1202         (WebCore::XPath::Value::toString):
1203         * xml/XPathValue.h:
1204         (WebCore::XPath::Value::):
1205         (WebCore::XPath::Value::isNodeSet):
1206         Replacing NodeVector with NodeSet.
1207
1208 2007-03-21  Mark Rowe  <mrowe@apple.com>
1209
1210         Build fix.
1211
1212         * bindings/objc/WebScriptObject.mm:
1213         (-[WebScriptObject methodForSelector:]):
1214         (-[WebScriptObject respondsToSelector:]):
1215
1216 2007-03-21  Mark Rowe  <mrowe@apple.com>
1217
1218         Reviewed by Tim Hatcher.
1219
1220         Fix for http://bugs.webkit.org/show_bug.cgi?id=13129.
1221         Bug 13129: Democracy Player dies in NSException from WebScriptObject on startup.
1222
1223         Some cross-language scripting bridges use the presence of -(int)count to determine
1224         whether to treat objects as sequence-like.  All WebScriptObject's exposed this method
1225         which lead to non-collection WebScriptObject's being mishandled by PyObjC.  We now
1226         expose -count only when the object we wrap looks like a collection from a JavaScript
1227         point of view (eg, it has a length property).
1228
1229         * bindings/objc/WebScriptObject.mm:
1230         (-[WebScriptObject _shouldRespondToCount]):
1231         (-[WebScriptObject methodForSelector:]):
1232         (-[WebScriptObject respondsToSelector:]):
1233         (-[WebScriptObject _count]):
1234         * bindings/objc/WebScriptObjectPrivate.h:
1235
1236 2007-03-20  Darin Adler  <darin@apple.com>
1237
1238         * page/EventHandler.cpp: (WebCore::EventHandler::handleMouseMoveEvent):
1239         Fix obvious typo in the change from last night -- forgot to assign to the variable.
1240
1241 2007-03-20  Dave Hyatt  <hyatt@apple.com>
1242
1243         Refactor fonts a bit for portability.
1244        
1245         Reviewed by aroben
1246
1247         * platform/Font.cpp:
1248         (WebCore::Font::drawSimpleText):
1249         (WebCore::Font::drawGlyphBuffer):
1250         (WebCore::Font::floatWidthForSimpleText):
1251         * platform/Font.h:
1252         * platform/FontData.h:
1253         (WebCore::FontData::isSystemFont):
1254         (WebCore::FontData::scriptCache):
1255         * platform/GlyphBuffer.h:
1256         (WebCore::GlyphBuffer::add):
1257
1258 2007-03-20  Anders Carlsson  <acarlsson@apple.com>
1259
1260         Reviewed by Adam.
1261
1262         Stub out a couple of CFNetwork backend functions.
1263         
1264         * platform/network/ResourceHandle.h:
1265
1266 2007-03-19  Oliver Hunt  <oliver@apple.com>
1267
1268         Reviewed by Ada.
1269
1270         Protect against possibility of JS detaching a frame (and losing its view)
1271         midway through a mouse move.
1272
1273         * page/EventHandler.cpp:
1274         (WebCore::EventHandler::handleMouseMoveEvent):
1275
1276 2007-03-19  Alexey Proskuryakov  <ap@webkit.org>
1277
1278         Reviewed by Darin.
1279
1280         http://bugs.webkit.org/show_bug.cgi?id=13107
1281         XPath should raise an exception when trying to parse an unknown function
1282
1283         Test: fast/xpath/invalid-functions.html
1284
1285         * xml/XPathFunctions.cpp:
1286         (WebCore::XPath::createFunction): Return 0 if the function couldn't be created.
1287         * xml/XPathGrammar.y: Handle nulls returned from createFunction().
1288
1289 2007-03-19  Adele Peterson  <adele@apple.com>
1290
1291         Reviewed by Beth.
1292
1293         Fix for http://bugs.webkit.org/show_bug.cgi?id=13087
1294         <rdar://problem/5064316> REGRESSION: Allow setting the checked attribute in js and in markup for unnamed radio buttons (dominos.com)
1295
1296         Test: fast/forms/radio_checked_name.html
1297
1298         We were matching a WinIE quirk that does not allow a user to check and uncheck an unnamed radio button.  But they still
1299         allow the checked attribute to be set in html, and changed in javascript.  So this change matches that behavior.
1300
1301         * html/HTMLInputElement.cpp:
1302         (WebCore::HTMLInputElement::parseMappedAttribute): We no longer need a special call to setChecked when parsing the name
1303          attribute, since we setChecked will now work with unnamed radio buttons.
1304         (WebCore::HTMLInputElement::preDispatchEventHandler): Added comment.
1305         (WebCore::HTMLInputElement::setChecked): Don't check for the unnamed radio button case here.
1306         (WebCore::HTMLInputElement::postDispatchEventHandler): Don't call setChecked for unnamed radio buttons.
1307         (WebCore::HTMLInputElement::defaultEventHandler): ditto.
1308
1309 2007-03-19  Adam Roben  <aroben@apple.com>
1310
1311         Rubberstamped by Oliver.
1312
1313         * bridge/JavaScriptStatistics.cpp: Added missing header for
1314         correctness.
1315
1316 2007-03-19  Andrew Wellington  <proton@wiretapped.net>
1317
1318         Reviewed by Maciej.
1319
1320         Really set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html)
1321
1322         * WebCore.xcodeproj/project.pbxproj:
1323
1324 2007-03-19  Justin Garcia  <justin.garcia@apple.com>
1325
1326         Reviewed by darin
1327         
1328         <rdar://problem/5071074> 
1329         REGRESSION: Links that aren't fully selected copy and paste as only text
1330         
1331         We stopped adding markup for all commonAncestorBlocks
1332         and the ancestors of lastClosed up to them because it 
1333         was adding a lot of unnecessary markup.
1334
1335         * editing/markup.cpp:
1336         (WebCore::createMarkup): Also include markup for nodes
1337         up to an enclosing anchor.  Cleaned up the code for
1338         including special common ancestors a bit.
1339
1340 2007-03-19  Nikolas Zimmermann  <zimmermann@kde.org>
1341
1342         Reviewed by Lars Knoll.
1343
1344         Fix crash when opening a SVG document which contains SVG elements, but no <svg> root element.
1345         Moving the mouse was crashing WebKit. Fixes svg/hixie/dynamic/006.xml.
1346
1347         * rendering/RenderObject.cpp:
1348         (WebCore::RenderObject::updateHitTestResult):
1349
1350 2007-03-19  Mitz Pettel  <mitz@webkit.org>
1351
1352         Reviewed by Hyatt.
1353
1354         - fix http://bugs.webkit.org/show_bug.cgi?id=13117
1355         REGRESSION (r14658): Flickering text fields when updating via javascript
1356
1357         * page/Frame.cpp:
1358         (WebCore::Frame::forceLayout): Added a flag to allow partial relayout.
1359         * page/Frame.h:
1360         * page/mac/WebCoreFrameBridge.mm:
1361         (-[WebCoreFrameBridge forceLayoutAdjustingViewSize:]): Allow partial relayout
1362         if not adjusting view size.
1363         (-[WebCoreFrameBridge needsLayout]): Changed to check for pending subtree
1364         layout instead of just whether the root needs layout.
1365
1366 2007-03-18  Nikolas Zimmermann  <zimmermann@kde.org>
1367
1368         Reviewed by Maciej.
1369
1370         Make JS function calls on POD-types (ie. SVGLength) take effect.
1371         Calling ie. newValueInSpecifiedUnits on SVGLength works as expected.
1372
1373         This worked fine before we switched to SVGLength POD type, so this
1374         can be considered as P1 regression fix.
1375
1376         Partly fix svg/hixie/dynamic/005-broken.svg. We match Opera now though
1377         it's not yet completly fixed. Setting baseVal attribute on SVGAnimatedString
1378         doesn't work as expected - needs a seperated fix.
1379
1380         * bindings/scripts/CodeGeneratorJS.pm:
1381
1382 2007-03-19  Adele Peterson  <adele@apple.com>
1383
1384         Reviewed by Adam.
1385
1386         Adding comments and a little cleanup from my last checkin.
1387
1388         * html/HTMLSelectElement.cpp:
1389         (WebCore::HTMLSelectElement::setSelectedIndex): Removed commented out assert.  Added comment about how we use onChange.
1390         (WebCore::HTMLSelectElement::selectAll): Added comment about how we use saveLastSelection and onChange.
1391         (WebCore::HTMLSelectElement::dispatchFocusEvent): ditto.
1392         (WebCore::HTMLSelectElement::dispatchBlurEvent): ditto.
1393         (WebCore::HTMLSelectElement::menuListDefaultEventHandler): ditto.
1394         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler): ditto.
1395         (WebCore::HTMLSelectElement::menuListOnChange): Added assert that usesMenuList() is true.
1396         (WebCore::HTMLSelectElement::listBoxOnChange): Added assert that usesMenuList() is false.
1397         (WebCore::HTMLSelectElement::saveLastSelection): Added early return for menu lists.
1398
1399 2007-03-19  Mitz Pettel  <mitz@webkit.org>
1400
1401         Reviewed by Tim Hatcher.
1402
1403         - fix http://bugs.webkit.org/show_bug.cgi?id=13091
1404           REGRESSION (r20075): Wrong text style and pixel break in Apple Store Locator HUD
1405
1406         Test: fast/innerHTML/additional-inline-style.html
1407
1408         * editing/markup.cpp:
1409         (WebCore::startMarkup): Changed to add inline style based on CSS rules only
1410         in AnnotateForInterchange mode.
1411
1412 2007-03-19  Zack Rusin  <zrusin@trolltech.com>
1413
1414         Compile fix.
1415
1416         * platform/qt/ScrollViewQt.cpp:
1417         (WebCore::ScrollView::update):
1418
1419 2007-03-19  Adam Roben  <aroben@apple.com>
1420
1421         Reviewed by Hyatt and Maciej.
1422
1423         Renamed WebCoreJavaScript to JavaScriptStatistics and made it C++ as
1424         part of <rdar://problem/5071653>.
1425
1426         All layout tests pass.
1427
1428         * WebCore.exp: Updated.
1429         * WebCore.xcodeproj/project.pbxproj: Updated.
1430         * bridge/JavaScriptStatistics.cpp: Moved from
1431         bridge/mac/WebCoreJavaScript.mm, and converted to C++.
1432         (WebCore::collect):
1433         (WebCore::JavaScriptStatistics::objectCount):
1434         (WebCore::JavaScriptStatistics::interpreterCount):
1435         (WebCore::JavaScriptStatistics::protectedObjectCount):
1436         (WebCore::JavaScriptStatistics::rootObjectTypeCounts):
1437         (WebCore::JavaScriptStatistics::garbageCollect):
1438         (WebCore::JavaScriptStatistics::garbageCollectOnAlternateThread):
1439         (WebCore::JavaScriptStatistics::shouldPrintExceptions):
1440         (WebCore::JavaScriptStatistics::setShouldPrintExceptions):
1441         * bridge/JavaScriptStatistics.h: Added.
1442         * bridge/mac/WebCoreJavaScript.h: Removed.
1443         * bridge/mac/WebCoreJavaScript.mm: Removed.
1444
1445 2007-03-18  Maciej Stachowiak  <mjs@apple.com>
1446
1447         Reviewed by Mark.
1448
1449         - avoid static construction (and global variable access) in a smarter, more portable way,
1450         to later enable MUTLI_THREAD mode to work on other platforms and compilers.
1451         
1452         * bindings/js/JSCustomXPathNSResolver.cpp:
1453         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
1454         * bindings/js/JSHTMLInputElementBase.cpp:
1455         (WebCore::JSHTMLInputElementBaseFunction::JSHTMLInputElementBaseFunction):
1456         * bindings/js/JSHTMLOptionElementConstructor.cpp:
1457         (WebCore::JSHTMLOptionElementConstructor::JSHTMLOptionElementConstructor):
1458         * bindings/js/JSXMLHttpRequest.cpp:
1459         (KJS::JSXMLHttpRequestConstructorImp::JSXMLHttpRequestConstructorImp):
1460         * bindings/js/JSXSLTProcessor.cpp:
1461         (KJS::XSLTProcessorConstructorImp::XSLTProcessorConstructorImp):
1462         * bindings/js/kjs_dom.cpp:
1463         (KJS::DOMNamedNodeMap::getOwnPropertySlot):
1464         (KJS::DOMNamedNodesCollection::getOwnPropertySlot):
1465         * bindings/js/kjs_events.cpp:
1466         (KJS::JSAbstractEventListener::handleEvent):
1467         * bindings/js/kjs_html.cpp:
1468         (KJS::HTMLElementFunction::HTMLElementFunction):
1469         (KJS::JSHTMLCollection::getOwnPropertySlot):
1470         * bindings/js/kjs_window.cpp:
1471         (KJS::ScheduledAction::execute):
1472         * bindings/objc/WebScriptObject.mm:
1473         * bindings/scripts/CodeGeneratorJS.pm:
1474
1475 2007-03-18  Andrew Wellington  <proton@wiretapped.net>
1476
1477         Reviewed by Mark Rowe
1478
1479         Set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html)
1480
1481         * WebCore.xcodeproj/project.pbxproj:
1482
1483 2007-03-18  David Hyatt  <hyatt@apple.com>
1484
1485         Fix for REGRESSION bug 13108, frame borders being painted when they shouldn't be.  Rework both frame borders
1486         and resizing to be more like other browsers.
1487
1488         Reviewed by ggaren
1489
1490         fast/frames/no-frame-borders.html
1491
1492         * html/HTMLFrameElement.cpp:
1493         (WebCore::HTMLFrameElement::HTMLFrameElement):
1494         (WebCore::HTMLFrameElement::attach):
1495         (WebCore::HTMLFrameElement::parseMappedAttribute):
1496         * html/HTMLFrameElement.h:
1497         (WebCore::HTMLFrameElement::hasFrameBorder):
1498         * html/HTMLFrameElementBase.cpp:
1499         (WebCore::HTMLFrameElementBase::HTMLFrameElementBase):
1500         (WebCore::HTMLFrameElementBase::parseMappedAttribute):
1501         * html/HTMLFrameElementBase.h:
1502         * html/HTMLFrameSetElement.cpp:
1503         (WebCore::HTMLFrameSetElement::attach):
1504         * html/HTMLFrameSetElement.h:
1505         (WebCore::HTMLFrameSetElement::hasFrameBorder):
1506         * html/HTMLIFrameElement.cpp:
1507         (WebCore::HTMLIFrameElement::HTMLIFrameElement):
1508         * rendering/RenderFrame.cpp:
1509         (WebCore::RenderFrame::edgeInfo):
1510         * rendering/RenderFrame.h:
1511         * rendering/RenderFrameSet.cpp:
1512         (WebCore::RenderFrameSet::paint):
1513         (WebCore::RenderFrameSet::GridAxis::resize):
1514         (WebCore::RenderFrameSet::fillFromEdgeInfo):
1515         (WebCore::RenderFrameSet::computeEdgeInfo):
1516         (WebCore::RenderFrameSet::edgeInfo):
1517         (WebCore::RenderFrameSet::layout):
1518         (WebCore::RenderFrameSet::startResizing):
1519         (WebCore::RenderFrameSet::continueResizing):
1520         (WebCore::RenderFrameSet::canResizeRow):
1521         (WebCore::RenderFrameSet::canResizeColumn):
1522         (WebCore::RenderFrameSet::splitPosition):
1523         (WebCore::RenderFrameSet::hitTestSplit):
1524         (WebCore::RenderFrameSet::dump):
1525         * rendering/RenderFrameSet.h:
1526         (WebCore::):
1527         (WebCore::FrameEdgeInfo::FrameEdgeInfo):
1528         (WebCore::FrameEdgeInfo::preventResize):
1529         (WebCore::FrameEdgeInfo::allowBorder):
1530         (WebCore::FrameEdgeInfo::setPreventResize):
1531         (WebCore::FrameEdgeInfo::setAllowBorder):
1532
1533 2007-03-19  Mark Rowe  <mrowe@apple.com>
1534
1535         Rubber-stamped by Brady.
1536
1537         Update references to bugzilla.opendarwin.org with bugs.webkit.org.
1538
1539         * ChangeLog:
1540         * WebCore.vcproj/WebCore/build-generated-files.sh:
1541         * manual-tests/ATSU-bad-layout.html:
1542         * manual-tests/accidental-strict-mode.html:
1543         * manual-tests/applet-param-no-name.html:
1544         * manual-tests/bidi-parens.html:
1545         * manual-tests/bugzilla-3855.html:
1546         * manual-tests/bugzilla-4840.html:
1547         * manual-tests/bugzilla-6821.html:
1548         * manual-tests/containing-block-position-chage.html:
1549         * manual-tests/contenteditable-link.html:
1550         * manual-tests/css3-cursor-fallback-quirks.html:
1551         * manual-tests/css3-cursor-fallback-strict.html:
1552         * manual-tests/custom-cursors.html:
1553         * manual-tests/dictionary-scrolled-iframe.html:
1554         * manual-tests/dom-manipulation-on-resize.html:
1555         * manual-tests/drag-image-to-address-bar.html:
1556         * manual-tests/empty-link-target.html:
1557         * manual-tests/empty-title-popup.html:
1558         * manual-tests/first-line-style-crash.html:
1559         * manual-tests/invalid-mouse-event.html:
1560         * manual-tests/left-overflow-repaint.html:
1561         * manual-tests/linkjump-3.html:
1562         * manual-tests/log-keypress-events.html:
1563         * manual-tests/named-window-blank-target.html:
1564         * manual-tests/plain-text-paste.html:
1565         * manual-tests/plugin-controller-datasource.html:
1566         * manual-tests/pre-tab-selection-rect.html:
1567         * manual-tests/redirection-target.html:
1568         * manual-tests/redraw-page-cache-visited-links.html:
1569         * manual-tests/reset-initiatedDrag.html:
1570         * manual-tests/resources/named-window-blank-target-step2.html:
1571         * manual-tests/resources/named-window-blank-target-step3.html:
1572         * manual-tests/resources/named-window-blank-target-step4.html:
1573         * manual-tests/resources/redraw-page-cache-visited-links-2.html:
1574         * manual-tests/scrollbar-hittest.html:
1575         * manual-tests/scrollbar-hittest2.html:
1576         * manual-tests/subview-click-assertion.html:
1577         * manual-tests/tabbing-input-google.html:
1578         * manual-tests/text-field-autoscroll.html:
1579         * manual-tests/textarea-after-stylesheet-link.html:
1580         * manual-tests/textarea-focus.html:
1581         * manual-tests/whitespace-pre-affinity.html:
1582
1583 2007-03-18  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
1584
1585         Not reviewed - gdk build fix.
1586
1587         * platform/gdk/ScrollViewGdk.cpp:
1588         (WebCore::ScrollView::update): add a stub
1589
1590 2007-03-18  Brady Eidson  <beidson@apple.com>
1591
1592         Reviewed by Hyatt
1593
1594         http://bugs.webkit.org/show_bug.cgi?id=13111
1595         When stopped a load before it completes, partial images become the 
1596         broken image icon
1597
1598         * loader/loader.cpp:
1599         (WebCore::Loader::didFail): Split off into a method that knows the 
1600           difference between failed and cancelled.  If a load is cancelled,
1601           don't call error() on the object - only remove it from the cache
1602         (WebCore::Loader::cancelRequests): Call didFail(loader, true)
1603         * loader/loader.h: Added didFail(SubresourceLoader*, bool cancelled)
1604
1605 2007-03-18  Mitz Pettel  <mitz@webkit.org>
1606
1607         Reviewed by Adele.
1608
1609         - fix http://bugs.webkit.org/show_bug.cgi?id=13101
1610           REGRESSION (NativeTextField): Specifying word-wrap:break-word makes text field wrap
1611
1612         Test: fast/forms/input-text-word-wrap.html
1613
1614         * rendering/RenderTextControl.cpp:
1615         (WebCore::RenderTextControl::createInnerTextStyle): Force the inner block to
1616         'word-wrap:normal'.
1617
1618 2007-03-18  Dan Waylonis  <waylonis@mac.com>
1619
1620         Reviewed by Tim Hatcher.
1621
1622         Fix http://bugs.webkit.org/show_bug.cgi?id=13005
1623         Bug 13005: WebScriptObject +throwException needs NULL check.
1624
1625         Add checking for NULL interpreter before throwing exception.
1626
1627         * bindings/objc/WebScriptObject.mm:
1628         (+[WebScriptObject throwException:]):
1629
1630 2007-03-18  Geoffrey Garen  <ggaren@apple.com>
1631
1632         Reviewed by Oliver Hunt.
1633         
1634         Fixed http://bugs.webkit.org/show_bug.cgi?id=13106
1635         REGRESSION: Incomplete document.all implementation breaks abtelectronics.com 
1636         (Style Change Through JavaScript Blanks Content)
1637         
1638         When indexing into collections, treat the empty string as an invalid argument,
1639         instead of the number 0.
1640
1641         * bindings/js/kjs_html.cpp:
1642         (KJS::JSHTMLCollection::getOwnPropertySlot):
1643         (KJS::JSHTMLCollection::callAsFunction):
1644         (KJS::JSHTMLCollectionPrototypeFunction::callAsFunction):
1645
1646 2007-03-18  David Hyatt  <hyatt@apple.com>
1647
1648         Use fillRect instead of drawLine, since drawLine has some odd behavior (it's only used for borders).
1649
1650         Reviewed by aroben
1651
1652         * platform/graphics/IntRect.h:
1653         * rendering/RenderFrameSet.cpp:
1654         (WebCore::RenderFrameSet::paintColumnBorder):
1655         (WebCore::RenderFrameSet::paintRowBorder):
1656
1657 2007-03-18  David Hyatt  <hyatt@apple.com>
1658
1659         Change the frameborder color to be light gray for framesets.
1660
1661         Reviewed by aroben
1662
1663         * rendering/RenderFrameSet.cpp:
1664         (WebCore::borderFillColor):
1665         (WebCore::RenderFrameSet::paintColumnBorder):
1666         (WebCore::RenderFrameSet::paintRowBorder):
1667
1668 2007-03-18  David Hyatt  <hyatt@apple.com>
1669
1670         Make iframes work properly with frameborder="0".
1671
1672         Reviewed by aroben
1673
1674         * html/HTMLIFrameElement.cpp:
1675         (WebCore::HTMLIFrameElement::mapToEntry):
1676         (WebCore::HTMLIFrameElement::parseMappedAttribute):
1677
1678 2007-03-18  David Hyatt  <hyatt@apple.com>
1679
1680         Add a 2px border by default to <iframe>s for compatibility with other browsers.
1681
1682         Reviewed by aroben
1683
1684         * css/html4.css:
1685
1686 2007-03-18  David Hyatt  <hyatt@apple.com>
1687
1688         Move frame borders out of WebKit and into WebCore.
1689
1690         Reviewed by aroben, olliej
1691
1692         * bridge/mac/FrameViewMac.mm:
1693         * css/html4.css:
1694         * html/HTMLFrameSetElement.cpp:
1695         (WebCore::HTMLFrameSetElement::HTMLFrameSetElement):
1696         (WebCore::HTMLFrameSetElement::mapToEntry):
1697         (WebCore::HTMLFrameSetElement::parseMappedAttribute):
1698         (WebCore::HTMLFrameSetElement::attach):
1699         * html/HTMLFrameSetElement.h:
1700         (WebCore::HTMLFrameSetElement::hasBorderColor):
1701         * page/FrameView.cpp:
1702         (WebCore::FrameViewPrivate::FrameViewPrivate):
1703         * page/FrameView.h:
1704         * page/mac/WebCoreFrameBridge.h:
1705         * platform/graphics/IntRect.h:
1706         (WebCore::IntRect::topLeft):
1707         (WebCore::IntRect::topRight):
1708         (WebCore::IntRect::bottomLeft):
1709         (WebCore::IntRect::bottomRight):
1710         * rendering/RenderFrame.cpp:
1711         (WebCore::RenderFrame::viewCleared):
1712         * rendering/RenderFrameSet.cpp:
1713         (WebCore::borderStartEdgeColor):
1714         (WebCore::borderEndEdgeColor):
1715         (WebCore::RenderFrameSet::paintColumnBorder):
1716         (WebCore::RenderFrameSet::paintRowBorder):
1717         (WebCore::RenderFrameSet::paint):
1718         * rendering/RenderFrameSet.h:
1719         * rendering/RenderPartObject.cpp:
1720         (WebCore::RenderPartObject::viewCleared):
1721         * rendering/RenderView.cpp:
1722         (WebCore::RenderView::repaintViewRectangle):
1723
1724 2007-03-17  David Hyatt  <hyatt@apple.com>
1725
1726         Make onload do an explicit paint when a top-level document is ready (to ensure that a first paint always
1727         happens before any timers set by the onload can fire).
1728
1729         Reviewed by aroben
1730
1731         * dom/Document.cpp:
1732         (WebCore::Document::implicitClose):
1733         * platform/ScrollView.h:
1734         * platform/mac/ScrollViewMac.mm:
1735         (WebCore::ScrollView::update):
1736
1737 2007-03-17  Dave Hyatt  <hyatt@apple.com>
1738
1739         Prevent starvation of user input and painting when processing timers.
1740         If we are already in the processing of a custom timer message, don't allow that
1741         processing to do another PostMessage.  Force SetTimer to be used instead.
1742       
1743         Reviewed by ggaren
1744
1745        * platform/win/SharedTimerWin.cpp:
1746         (WebCore::TimerWindowWndProc):
1747         (WebCore::setSharedTimerFireTime):
1748
1749 2007-03-17  Geoffrey Garen  <ggaren@apple.com>
1750
1751         Reviewed by Beth Dakin.
1752
1753         Fixed <rdar://problem/5070967> REGRESSION (r20211): Repro crash when 
1754         closing View Source window
1755         
1756         I award myself 0 points, and may God have mercy on my soul.
1757
1758         * bindings/js/kjs_proxy.cpp:
1759         (WebCore::KJSProxy::~KJSProxy):
1760
1761 2007-03-17  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
1762
1763         Not reviewed - gdk build fix.
1764
1765         * platform/gdk/TemporaryLinkStubs.cpp:
1766         (Pasteboard::writeURL):
1767
1768 2007-03-17  David Hyatt  <hyatt@apple.com>
1769
1770         Fix tiny PLT regression.  Don't examine the border/background data for RenderImage when images change
1771         unless we actually have a border/background.
1772
1773         Reviewed by Brady
1774
1775         * rendering/RenderImage.cpp:
1776         (WebCore::RenderImage::imageChanged):
1777
1778 2007-03-17  Nikolas Zimmermann  <zimmermann@kde.org>
1779
1780         Reviewed by Sam Weinig.
1781
1782         Fixes: http://bugs.webkit.org/show_bug.cgi?id=13046 (CSS styles on hover and focus are broken for <use>)
1783         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12838 (SVG <use> CSS styles broken)
1784         Added test: svg/custom/use-css-events.svg
1785
1786         In general this fixes the peepo.co.uk website.
1787
1788         Forgot to pass the actual StyleChange to the recalcStyle() function,
1789         when calling it on the shadow tree root element.
1790
1791         * ksvg2/svg/SVGUseElement.cpp:
1792         (WebCore::SVGUseElement::recalcStyle):
1793
1794 2007-03-17  Timothy Hatcher  <timothy@apple.com>
1795
1796         Reviewed by Mark Rowe.
1797
1798         Made Version.xcconfig smarter when building for different configurations.
1799         Now uses the 522+ OpenSource version for Debug and Release, while using the
1800         full 522.4 version for Production builds. The system prefix is also computed
1801         based on the current system, so 4522.4 on Tiger and 5522.4 on Leopard.
1802
1803         * Configurations/Version.xcconfig:
1804         * Configurations/WebCore.xcconfig:
1805
1806 2007-03-17  Antti Koivisto  <antti@apple.com>
1807
1808         Reviewed by Adele.
1809
1810         Fix http://bugs.webkit.org/show_bug.cgi?id=12595
1811         REGRESSION: Can't add item to cart at lnt.com (JS type error)
1812         <rdar://problem/4722863>
1813         
1814         Emulate Firefox behavior where form elements accessed by a name
1815         can be accessed with that name later even if the name changes or
1816         even if element is removed from the document.
1817         
1818         This is loosely based on Darin's earlier patch for the same problem but
1819         is much less expansive. It takes somewhat different approach to more closely
1820         mimic Firefox behavior. Includes expanded test case.
1821
1822         * bindings/js/JSHTMLFormElementCustom.cpp:
1823         (WebCore::JSHTMLFormElement::canGetItemsForName):
1824             Use new the HTMLFormElement::getNamedElements() method
1825         (WebCore::JSHTMLFormElement::nameGetter):
1826             Use new the HTMLFormElement::getNamedElements() method
1827         * html/HTMLFormElement.cpp:
1828         (WebCore::HTMLFormElement::HTMLFormElement):
1829         (WebCore::HTMLFormElement::~HTMLFormElement):
1830         (WebCore::HTMLFormElement::elementForAlias):
1831         (WebCore::HTMLFormElement::addElementAlias):
1832             Maintain a map of known element aliases
1833         (WebCore::HTMLFormElement::getNamedElements):
1834             Get a list of elements matching the name, based both their
1835             current names and known aliases (earlier names).
1836             Keep the alias list in sync.
1837         * html/HTMLFormElement.h:
1838
1839 2007-03-17  Adele Peterson  <adele@apple.com>
1840
1841         Reviewed by Hyatt.
1842
1843         Fix for <rdar://problem/4990050> REGRESSION: onchange gets fired when clicking on a programmatically selected element in a listbox
1844         http://bugs.webkit.org/show_bug.cgi?id=12725
1845
1846         Test: updated fast/forms/listbox-onchange.html
1847
1848         Added HTMLSelectElement::saveLastSelection that is called before changing a selection that could result
1849         in onChange being called.  m_lastOnChangeIndex and m_lastOnChangeSelection no longer have to be up-to date all the time, 
1850         they just have to be up-to-date before we execute an action that may trigger onChange.
1851
1852         * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::setSelectedState): Added.
1853           The HTMLSelectElement will only set an option's selected state with this method.  This ensures
1854           that notifyOptionSelected won't get called when the call originates from the select element.
1855         * html/HTMLOptionElement.h:
1856
1857         * html/HTMLSelectElement.cpp:
1858         (WebCore::HTMLSelectElement::deselectItems): Calls setSelectedState.
1859         (WebCore::HTMLSelectElement::setSelectedIndex): ditto. Don't update the last selection variables here.  Scroll to the new selection.
1860          The scrolling call used to only be in notifyOptionSelected.  There's no reason we shouldn't scroll when the selection is set through
1861          the HTMLSelectElement.
1862         (WebCore::HTMLSelectElement::setValue): Call setSelectedIndex to update all options selected state.
1863         (WebCore::HTMLSelectElement::restoreState): Call setSelectedState.
1864         (WebCore::HTMLSelectElement::selectAll): Call saveLastSelection before making the selection, and calling onChange.
1865         (WebCore::HTMLSelectElement::recalcListItems): Call setSelectedState.  Don't need to save selection here anymore, 
1866          since it will get saved before we call onChange.
1867         (WebCore::HTMLSelectElement::reset): ditto.
1868         (WebCore::HTMLSelectElement::dispatchFocusEvent): Added. Call saveLastSelection for menu lists, since onChange can be fired
1869          on blur.
1870         (WebCore::HTMLSelectElement::dispatchBlurEvent): Call menuListOnChange.
1871         (WebCore::HTMLSelectElement::menuListDefaultEventHandler): Call saveLastSelection before showing the popup window.
1872         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):  Call saveLastSelection during mousedown (to prepare for an 
1873          onchange during mouseup, or after autoscroll).
1874         (WebCore::HTMLSelectElement::updateListBoxSelection): Call setSelectedState.
1875
1876         (WebCore::HTMLSelectElement::menuListOnChange): Added. Compares the m_lastOnChangeIndex to the selectedIndex().
1877         (WebCore::HTMLSelectElement::listBoxOnChange): Move the m_lastOnChangeSelection creation to saveLastSelection.
1878         (WebCore::HTMLSelectElement::saveLastSelection): Added. Sets m_lastOnChangeIndex or m_lastOnChangeSelection.
1879         * html/HTMLSelectElement.h:
1880         * platform/PopupMenu.h:
1881
1882 2007-03-16  Oliver Hunt  <oliver@apple.com>
1883
1884         Reviewed by Hyatt.
1885
1886         The old canSaveAsWebArchive call was necessary as stand alone
1887         images used to be rendered by ImageDocument.
1888
1889         Fixes rdar://problem/5061252
1890
1891         * dom/Clipboard.cpp:
1892         * dom/Clipboard.h:
1893         (WebCore::Clipboard::setDragHasStarted):
1894         * page/DragClient.h:
1895         (WebCore::DragClient::declareAndWriteDragImage):
1896         * platform/mac/ClipboardMac.mm:
1897         (WebCore::ClipboardMac::declareAndWriteDragImage):
1898
1899 2007-03-16  Anders Carlsson  <acarlsson@apple.com>
1900
1901         Reviewed by Maciej.
1902
1903         <rdar://problem/4869095>
1904         default content type changed for XMLHttpRequest POSTs changed (breaks Flickrator 0.1 widget)
1905         
1906         * xml/xmlhttprequest.cpp:
1907         (WebCore::XMLHttpRequest::send):
1908
1909 2007-03-16  Brady Eidson  <beidson@apple.com>
1910
1911         Rubberstamped by Tim Hatcher
1912
1913         Update the hash table header for Window object properties
1914
1915         * bindings/js/kjs_window.cpp:
1916
1917 2007-03-16  Brady Eidson  <beidson@apple.com>
1918
1919         Reviewed by Anders
1920
1921         <rdar://problem/5061826> and
1922         http://bugs.webkit.org/show_bug.cgi?id=12863
1923         Implement window.stop()
1924
1925         * bindings/js/kjs_window.cpp:
1926         (KJS::WindowFunc::callAsFunction): Add case Window::Stop
1927         * bindings/js/kjs_window.h:
1928         (KJS::Window::): Add "Stop"
1929
1930 2007-03-16  Geoffrey Garen  <ggaren@apple.com>
1931
1932         Reviewed by Brady Eidson.
1933
1934         Fixed dir creation to account for already existing dirs and missing leading
1935         dirs in path.
1936         
1937         * loader/icon/IconDatabase.cpp:
1938         (WebCore::makeAllDirectories):
1939
1940 2007-03-16  David Hyatt  <hyatt@apple.com>
1941
1942         Fix for 13084, assertion failure in the Cache.  Convert the client list
1943         to a HashCountedSet so that multiple refs and derefs are allowed.
1944
1945         Fix RenderImage so that if it has the same image used as a background/border
1946         and as the foreground that it will repaint properly (can be tested using
1947         border-image and a foreground image).
1948
1949         Optimize list marker so that it doesn't waste time in the base class method,
1950         since list markers don't support background or border images.
1951
1952         Reviewed by andersca
1953
1954         * ChangeLog:
1955         * loader/CachedResource.cpp:
1956         (WebCore::CachedResource::ref):
1957         * loader/CachedResource.h:
1958         * loader/CachedResourceClientWalker.cpp:
1959         (WebCore::CachedResourceClientWalker::CachedResourceClientWalker):
1960         * loader/CachedResourceClientWalker.h:
1961         * rendering/RenderImage.cpp:
1962         (WebCore::RenderImage::imageChanged):
1963         * rendering/RenderListMarker.cpp:
1964         (WebCore::RenderListMarker::imageChanged):
1965
1966 2007-03-16  Geoffrey Garen  <ggaren@apple.com>
1967
1968         Reviewed by Anders Carlsson.
1969         
1970         Fixed <rdar://problem/5065399> REGRESSION: leaks in Frame::bindingRootObject 
1971         seen on buildbot
1972
1973         The problem was that we were initializing the same WebScriptObject twice.
1974         This caused it to leak its original set of ivars.
1975         
1976         I think some refactoring could prevent this situation from arising in the
1977         first place, but I'm just adding a check at the call site for now, to do 
1978         the simplest thing.
1979
1980         * bindings/objc/WebScriptObject.mm:
1981         (-[WebScriptObject _setImp:originRootObject:rootObject:]): Added ASSERTs
1982         against multiple calls.
1983
1984         * bindings/objc/WebScriptObjectPrivate.h: Renamed _initializeWithObjectImp
1985         to setImp because "init" vs "initialize" was a too subtle indication that
1986         one was a Cocoa initializer and one was not.
1987
1988 2007-03-16  Lars Knoll <lars@trolltech.com>
1989
1990         don't use #import in .cpp files.
1991
1992         * editing/qt/EditorQt.cpp:
1993
1994 2007-03-16  Lars Knoll <lars@trolltech.com>
1995
1996         Fix the Qt build once again.
1997
1998         * platform/qt/PasteboardQt.cpp:
1999         (WebCore::Pasteboard::Pasteboard):
2000         (WebCore::Pasteboard::writeSelection):
2001         (WebCore::Pasteboard::plainText):
2002         (WebCore::Pasteboard::documentFragment):
2003         (WebCore::Pasteboard::writeURL):
2004         (WebCore::Pasteboard::writeImage):
2005         (WebCore::Pasteboard::clear):
2006
2007 2007-03-15  Shrikant Gangoda  <shrikant.gangoda@celunite.com>
2008
2009         Gdk build fix.
2010
2011         * loader/gdk/FrameLoaderClientGdk.cpp:
2012         (WebCore::FrameLoaderClientGdk::blockedError):
2013         * loader/gdk/FrameLoaderClientGdk.h:
2014
2015 2007-03-15  Beth Dakin  <bdakin@apple.com>
2016
2017         Reviewed by Geoff.
2018
2019         Fix for http://bugs.webkit.org/show_bug.cgi?id=13088 REGRESSION
2020         (r19761-19779): Copy image no longer includes image address 
2021         (rdar://5067927)
2022
2023         writeURL() does not need an isImage parameter. Now that it accepts 
2024         the types as a parameter, we can just declare the appropriate image 
2025         types within writeImage and send them to writeURL(). Also, 
2026         declaring the types twice is what broke this.
2027
2028         * platform/Pasteboard.h:
2029         * platform/mac/PasteboardMac.mm:
2030         (WebCore::Pasteboard::writeURL):
2031         (WebCore::Pasteboard::writeImage):
2032
2033 2007-03-15  Adele Peterson  <adele@apple.com>
2034
2035         Reviewed by Kevin Decker.
2036
2037         Fix for <rdar://problem/4926179> Text in menulist control should never update if menu is open
2038
2039         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
2040           Only setTextFromOption if the menu isn't visible.
2041
2042 2007-03-15  Brady Eidson  <beidson@apple.com>
2043
2044         Reviewed by Oliver
2045
2046         A few platform specific tweaks
2047
2048         * platform/cf/RetainPtr.h:
2049         (WebCore::RetainPtr::releaseRef): Fixed releaseRef to work with CF
2050         
2051         * platform/network/ResourceHandle.h: Added a "releaseRef" style call
2052
2053 2007-03-15  Maciej Stachowiak  <mjs@apple.com>
2054
2055         Reviewed by Geoff and Steve.
2056
2057         * config.h: Remove unneeded hack.
2058
2059 2007-03-15  Justin Garcia  <justin.garcia@apple.com>
2060
2061         Reviewed by john
2062         
2063         <rdar://problem/5062376> 
2064         REGRESSION: In Mail and Gmail, can't change alignment to text after it has been applied
2065         
2066         Bring back the remove step in applyBlockStyle.  It's 
2067         necessary because addBlockStyleIfNeeded assumes that 
2068         the properties it adds aren't already on the block that 
2069         it adds them to.
2070
2071         * editing/ApplyStyleCommand.cpp:
2072         (WebCore::ApplyStyleCommand::applyBlockStyle): 
2073         Bring back the remove step (added a testcase).
2074         Don't do the add step if m_removeOnly is true (no testcase
2075         because there aren't any clients using removeOnly functionality
2076         to remove styles yet, only styled elemets).
2077         Moved the code for creating new blocks up one level
2078         to this function so that we can pass blocks to removeCSSStyle.
2079         When converting VisiblePositions to indices and vice versa,
2080         use the highest node in the shadow tree if we're in one as
2081         the scope (working on a testcase).
2082         (WebCore::ApplyStyleCommand::addBlockStyle): Moved code to
2083         applyBlockStyle.
2084         * editing/ApplyStyleCommand.h: 
2085
2086 2007-03-15  Brady Eidson  <beidson@apple.com>
2087
2088         Reviewed by Maciej
2089
2090         <rdar://problem/4429701>
2091         Implements a port blocking black list that matches Firefox's
2092
2093         * loader/FrameLoader.cpp:
2094         (WebCore::FrameLoader::blockedError): Call through to the client for blockedError 
2095         * loader/FrameLoader.h:
2096
2097         * loader/FrameLoaderClient.h: Get the "port blocked" error for the current platform
2098
2099         * loader/ResourceLoader.cpp:
2100         (WebCore::ResourceLoader::wasBlocked): ResourceHandleClient method to pass on the didFail(error)
2101         (WebCore::ResourceLoader::blockedError): Following the pattern of "CancelledError()", get the 
2102           error to fail with for the didFail() call
2103         * loader/ResourceLoader.h:
2104
2105         * platform/graphics/svg/SVGImageEmptyClients.h:
2106         (WebCore::SVGEmptyFrameLoaderClient::blockedError): Added stub
2107
2108         * platform/network/ResourceHandle.cpp:
2109         (WebCore::ResourceHandle::create): If the port is blocked, create the handle but schedule it for
2110           deferred failure on a timer
2111         (WebCore::ResourceHandle::scheduleBlockedFailure): Do the timer scheduling
2112         (WebCore::ResourceHandle::fireBlockedFailure): Fire the timer here
2113         (WebCore::ResourceHandle::portAllowed): Implements checking of Mozilla's
2114         * platform/network/ResourceHandle.h:
2115         * platform/network/ResourceHandleClient.h:
2116         (WebCore::ResourceHandleClient::wasBlocked): Virtual for clients to get the "blocked" message
2117
2118 2007-03-15  Beth Dakin  <bdakin@apple.com>
2119
2120         Reviewed by Hyatt.
2121
2122         Fix for <rdar://problem/5065396> REGRESSION: leaks in 
2123         RenderBlock::layoutInlineChildren seen on buildbot
2124
2125         This leak appeared after http://trac.webkit.org/projects/webkit/
2126         changeset/20188. This change shifted line boxes around in 
2127         removeChild(). But since removeChild() calls 
2128         setNeedsLayoutAndMinMaxRecalc(), all of the line boxes will be 
2129         removed once we actually lay out anyway. So this patch fixes the 
2130         leak by deleting the line boxes instead of shifting them around. 
2131
2132         * editing/IndentOutdentCommand.cpp:
2133         (WebCore::IndentOutdentCommand::outdentParagraph): Call into 
2134         updateLayout(). This fixes an assertion I got in editing/
2135         execCommand/4976800.html This is very similar to the line box fix I 
2136         made recently (http://trac.webkit.org/projects/webkit/changeset/
2137         20177). We need to update layout before relying on VisiblePositions 
2138         after removing a node.
2139         * rendering/RenderBlock.cpp:
2140         (WebCore::RenderBlock::deleteLinesForBlock): New helper function 
2141         since this functionality is needed in three places now.
2142         (WebCore::RenderBlock::makeChildrenNonInline): Call into new 
2143         deleteLinesForBlock().
2144         (WebCore::RenderBlock::removeChild): Same.
2145         * rendering/RenderBlock.h:
2146
2147 2007-03-15  Timothy Hatcher  <timothy@apple.com>
2148
2149         Reviewed by John.
2150
2151         * Factored out most of our common build settings into .xcconfig files. Anything that was common in
2152           each build configuration was factored out into the shared .xcconfig file.
2153         * Adds a Version.xcconfig file to define the current framework version, to be used in other places.
2154         * Use the new $(BUNDLE_VERSION) (defined in Version.xcconfig) in the preprocessed Info.plist.
2155         * Use the versions defined in Version.xcconfig to set $(DYLIB_CURRENT_VERSION).
2156
2157         * Configurations/Base.xcconfig: Added.
2158         * Configurations/DebugRelease.xcconfig: Added.
2159         * Configurations/Version.xcconfig: Added.
2160         * Configurations/WebCore.xcconfig: Added.
2161         * Info.plist:
2162         * WebCore.xcodeproj/project.pbxproj:
2163
2164 2007-03-15  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
2165
2166         Not reviewed - gdk build fixes.
2167
2168         * platform/gdk/EditorClientGdk.cpp:
2169         (WebCore::EditorClientGdk::handleKeypress):
2170         * platform/graphics/cairo/ImageSourceCairo.cpp:
2171         (WebCore::ImageSource::setData):
2172         * platform/graphics/gdk/ImageGdk.cpp:
2173         (WebCore::Image::loadPlatformResource):
2174
2175 2007-03-14  Justin Garcia  <justin.garcia@apple.com>
2176
2177         Reviewed by john
2178         
2179         ~2x speed up of 5k rich text paste:
2180         http://shakespeare.mit.edu/hamlet/full.html        
2181
2182         * editing/ReplaceSelectionCommand.cpp:
2183         (WebCore::ReplaceSelectionCommand::doApply): Remove the top 
2184         level style span if it's unnecessary before inserting
2185         into the document, it's faster than doing it after.
2186         * editing/ReplaceSelectionCommand.h: Exposed 
2187         ReplacementFragment::removeNodePreservingChildren so that
2188         the style span can be removed using non-undoable removes,
2189         like the rest of the removes done on the ReplacementFragment.
2190         * editing/markup.cpp:
2191         (WebCore::createMarkup): Make the style span the top level
2192         element, otherwise it's useless.  This also facilitates the
2193         optimization mentioned above.
2194         When including markup for a fully selected root, include markup
2195         for all the nodes beneath that fully selected root, to preserve 
2196         the structure and appearance of the copied markup.  Did this
2197         by merging with the code for adding markup for descendants of
2198         special commonAncestorBlocks.
2199
2200 2007-03-15  Beth Dakin  <bdakin@apple.com>
2201
2202         Rubber-stamped by Adele.
2203
2204         Rolling out http://trac.webkit.org/projects/webkit/changeset/20148 
2205         (which is a fix for http://bugs.webkit.org/show_bug.cgi?id=12595 
2206         and rdar://4722863) because it causes a horrible memory-trasher. 
2207
2208         * bindings/js/JSHTMLFormElementCustom.cpp:
2209         (WebCore::JSHTMLFormElement::canGetItemsForName):
2210         (WebCore::JSHTMLFormElement::nameGetter):
2211         * bindings/js/kjs_dom.cpp:
2212         (KJS::):
2213         (KJS::DOMNamedNodesCollection::DOMNamedNodesCollection):
2214         (KJS::DOMNamedNodesCollection::lengthGetter):
2215         (KJS::DOMNamedNodesCollection::indexGetter):
2216         (KJS::DOMNamedNodesCollection::getOwnPropertySlot):
2217         * bindings/js/kjs_dom.h:
2218         (KJS::DOMNamedNodesCollection::classInfo):
2219         * bindings/js/kjs_html.cpp:
2220         (KJS::JSHTMLCollection::getNamedItems):
2221         * dom/ChildNodeList.cpp:
2222         (WebCore::ChildNodeList::ChildNodeList):
2223         (WebCore::ChildNodeList::length):
2224         (WebCore::ChildNodeList::item):
2225         (WebCore::ChildNodeList::nodeMatches):
2226         * dom/ChildNodeList.h:
2227         * dom/NameNodeList.cpp:
2228         (WebCore::NameNodeList::NameNodeList):
2229         (WebCore::NameNodeList::item):
2230         (WebCore::NameNodeList::nodeMatches):
2231         * dom/NameNodeList.h:
2232         (WebCore::NameNodeList::rootNodeAttributeChanged):
2233         * dom/Node.cpp:
2234         (WebCore::TagNodeList::TagNodeList):
2235         (WebCore::TagNodeList::nodeMatches):
2236         (WebCore::Node::registerNodeList):
2237         (WebCore::Node::unregisterNodeList):
2238         * dom/Node.h:
2239         * dom/NodeList.cpp:
2240         (WebCore::NodeList::NodeList):
2241         (WebCore::NodeList::~NodeList):
2242         (WebCore::NodeList::recursiveLength):
2243         (WebCore::NodeList::itemForwardsFromCurrent):
2244         (WebCore::NodeList::itemBackwardsFromCurrent):
2245         (WebCore::NodeList::recursiveItem):
2246         (WebCore::NodeList::itemWithName):
2247         (WebCore::NodeList::rootNodeChildrenChanged):
2248         * dom/NodeList.h:
2249         (WebCore::NodeList::rootNodeAttributeChanged):
2250         * html/HTMLFormElement.cpp:
2251         (WebCore::HTMLFormElement::HTMLFormElement):
2252         (WebCore::HTMLFormElement::~HTMLFormElement):
2253         (WebCore::HTMLFormElement::formData):
2254         (WebCore::HTMLFormElement::parseMappedAttribute):
2255         (WebCore::HTMLFormElement::removeFormElement):
2256         * html/HTMLFormElement.h:
2257         * html/HTMLGenericFormElement.cpp:
2258         (WebCore::HTMLGenericFormElement::parseMappedAttribute):
2259         (WebCore::HTMLGenericFormElement::insertedIntoTree):
2260         * html/HTMLGenericFormElement.h:
2261         * html/HTMLInputElement.cpp:
2262         (WebCore::HTMLInputElement::parseMappedAttribute):
2263
2264 2007-03-15  Geoffrey Garen  <ggaren@apple.com>
2265
2266         Added an assert to help catch a bug. Hopefully someone will hit it!
2267         
2268         * bindings/js/kjs_proxy.cpp:
2269         (WebCore::KJSProxy::~KJSProxy):
2270
2271 2007-03-14  Oliver Hunt  <oliver@apple.com>
2272
2273         Reviewed by Adele.
2274
2275         Fix for rdar://problem/5061737.
2276         
2277         This was a regression from the original Objective-C -> C++ conversion
2278         for the drag logic.  We don't need to call Range::startNode as we just
2279         need the document that contains the range.   
2280
2281         * page/DragController.cpp:
2282         (WebCore::documentFragmentFromDragData):
2283
2284 2007-03-14  Mitz Pettel  <mitz@webkit.org>
2285
2286         Reviewed by Hyatt.
2287
2288         - http://bugs.webkit.org/show_bug.cgi?id=13071
2289           REGRESSION: Plain text files no longer wrap lines longer than the width of the browser window
2290
2291         Test: fast/loader/text-document-wrapping.html
2292
2293         * loader/TextDocument.cpp:
2294         (WebCore::TextTokenizer::write): Specified word-wrap:break-word for the <pre> element.
2295
2296 2007-03-14  Mitz Pettel  <mitz@webkit.org>
2297
2298         Reviewed by Hyatt.
2299
2300         - fix http://bugs.webkit.org/show_bug.cgi?id=13072
2301           REGRESSION (r15617): white-space: pre-wrap breaks off the last character of a wide word
2302
2303         Test: fast/text/whitespace/pre-wrap-last-char.html
2304
2305         * rendering/bidi.cpp:
2306         (WebCore::RenderBlock::findNextLineBreak): Undid the change from r15617.
2307
2308 2007-03-14  David Hyatt  <hyatt@apple.com>
2309
2310         Add asserts to help catch double refs and double derefs of CachedResources.
2311
2312         Reviewed by mjs
2313
2314         * loader/CachedResource.cpp:
2315         (WebCore::CachedResource::ref):
2316         (WebCore::CachedResource::deref):
2317
2318 2007-03-14  Alice Liu  <alice.liu@apple.com>
2319
2320         Rubber-stamped by Hyatt.
2321
2322         Adding null check to prevent the crash that happens on 2nd run of iBench HTML load test
2323
2324         * loader/icon/IconDataCache.cpp:
2325         (WebCore::IconDataCache::writeToDatabase):
2326
2327 === Safari-5522.4 ===
2328
2329 2007-03-14  Adele Peterson  <adele@apple.com>
2330
2331         Reviewed by Adam.
2332
2333         Fix for <rdar://problem/5062898> REGRESSION: autocomplete window in text fields doesn't come up
2334
2335         When we moved the initialization of a bunch of variables in the HTMLFormElement constructor, m_autocomplete accidently got initialized to false.
2336
2337         * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::HTMLFormElement):
2338
2339 2007-03-14  Steve Falkenburg  <sfalken@apple.com>
2340
2341         Reviewed by Adam.
2342
2343         Added missing null check in case this is called on a subframe
2344         that hasn't started loading.
2345
2346         * page/Frame.cpp:
2347         (WebCore::Frame::setMarkedTextMatchesAreHighlighted): Check for a null document.
2348
2349 2007-03-14  Antti Koivisto  <antti@apple.com>
2350
2351         Reviewed by Geoff.
2352
2353         Fix http://bugs.webkit.org/show_bug.cgi?id=13060
2354         REGRESSION: Repro ASSERT failure in Cache::adjustSize running layout tests
2355         <rdar://5060208>
2356         
2357         Script evaluation may have dereffed the CachedScript object already, causing double deref and
2358         eventually m_liveResourcesSize underflow.
2359
2360         * html/HTMLScriptElement.cpp:
2361         (WebCore::HTMLScriptElement::notifyFinished):
2362
2363 2007-03-14  Adele Peterson  <adele@apple.com>
2364
2365         Reviewed by Darin.
2366
2367         Added InsertTab, InsertBacktab, InsertLineBreak, and InsertNewline to the editing command table.
2368         Added Event parameter to execCommand, and to all of the enabled and exec functions.  Right now,
2369         the event is only used by the newly added commands.  But in the future, many (and possibly all) of
2370         these editing commands will need to consider the event so they are applied to the correct selection.
2371
2372         * WebCore.exp:
2373         * editing/Editor.cpp:
2374         (WebCore::execCopy):
2375         (WebCore::execCut):
2376         (WebCore::execDelete):
2377         (WebCore::execBackwardDelete):
2378         (WebCore::execForwardDelete):
2379         (WebCore::execMoveBackward):
2380         (WebCore::execMoveBackwardAndModifySelection):
2381         (WebCore::execMoveUpByPageAndModifyCaret):
2382         (WebCore::execMoveDown):
2383         (WebCore::execMoveDownAndModifySelection):
2384         (WebCore::execMoveForward):
2385         (WebCore::execMoveForwardAndModifySelection):
2386         (WebCore::execMoveDownByPageAndModifyCaret):
2387         (WebCore::execMoveLeft):
2388         (WebCore::execMoveLeftAndModifySelection):
2389         (WebCore::execMoveRight):
2390         (WebCore::execMoveRightAndModifySelection):
2391         (WebCore::execMoveToBeginningOfDocument):
2392         (WebCore::execMoveToBeginningOfDocumentAndModifySelection):
2393         (WebCore::execMoveToBeginningOfSentence):
2394         (WebCore::execMoveToBeginningOfSentenceAndModifySelection):
2395         (WebCore::execMoveToBeginningOfLine):
2396         (WebCore::execMoveToBeginningOfLineAndModifySelection):
2397         (WebCore::execMoveToBeginningOfParagraph):
2398         (WebCore::execMoveToBeginningOfParagraphAndModifySelection):
2399         (WebCore::execMoveToEndOfDocument):
2400         (WebCore::execMoveToEndOfDocumentAndModifySelection):
2401         (WebCore::execMoveToEndOfSentence):
2402         (WebCore::execMoveToEndOfSentenceAndModifySelection):
2403         (WebCore::execMoveToEndOfLine):
2404         (WebCore::execMoveToEndOfLineAndModifySelection):
2405         (WebCore::execMoveToEndOfParagraph):
2406         (WebCore::execMoveToEndOfParagraphAndModifySelection):
2407         (WebCore::execMoveParagraphBackwardAndModifySelection):
2408         (WebCore::execMoveParagraphForwardAndModifySelection):
2409         (WebCore::execMoveUp):
2410         (WebCore::execMoveUpAndModifySelection):
2411         (WebCore::execMoveWordBackward):
2412         (WebCore::execMoveWordBackwardAndModifySelection):
2413         (WebCore::execMoveWordForward):
2414         (WebCore::execMoveWordForwardAndModifySelection):
2415         (WebCore::execMoveWordLeft):
2416         (WebCore::execMoveWordLeftAndModifySelection):
2417         (WebCore::execMoveWordRight):
2418         (WebCore::execMoveWordRightAndModifySelection):
2419         (WebCore::execPaste):
2420         (WebCore::execSelectAll):
2421         (WebCore::execToggleBold):
2422         (WebCore::execToggleItalic):
2423         (WebCore::execRedo):
2424         (WebCore::execUndo):
2425         (WebCore::execInsertTab):
2426         (WebCore::execInsertBacktab):
2427         (WebCore::execInsertNewline):
2428         (WebCore::execInsertLineBreak):
2429         (WebCore::enabled):
2430         (WebCore::canPaste):
2431         (WebCore::hasEditableSelection):
2432         (WebCore::hasEditableRangeSelection):
2433         (WebCore::hasRangeSelection):
2434         (WebCore::hasRichlyEditableSelection):
2435         (WebCore::canRedo):
2436         (WebCore::canUndo):
2437         (WebCore::CommandEntry::):
2438         (WebCore::Editor::toggleBold):
2439
2440         (WebCore::Editor::execCommand): Added optional event parameter.
2441         (WebCore::Editor::insertText): Added.  Calls handleTextInputEvent.
2442         (WebCore::Editor::insertTextWithoutSendingTextEvent): Renamed from insertText.
2443          Performs the actual insertion without dispatching any event.
2444         * editing/Editor.h:
2445         * page/EventHandler.cpp: (WebCore::EventHandler::defaultTextInputEventHandler):
2446           Call insertTextWithoutSendingTextEvent.
2447
2448 2007-03-14  Justin Garcia  <justin.garcia@apple.com>
2449
2450         Reviewed by darin
2451         
2452         ~3x speedup pasting 5k lines of rich text:
2453         http://shakespeare.mit.edu/hamlet/full.html
2454         ~2x speedup pasting 10k lines of plain text
2455         
2456         * css/CSSComputedStyleDeclaration.cpp:
2457         (WebCore::computedStyle): Added for convenience.
2458         * css/CSSComputedStyleDeclaration.h:
2459         * editing/ReplaceSelectionCommand.cpp:
2460         (WebCore::ReplaceSelectionCommand::removeRedundantStyles):
2461         The code that pushed down the top level style span had
2462         a bug in it that made it do unnecessary work.  Instead of
2463         fixing the bug I removed the code because it was used to 
2464         help see more redundancies in second level style spans, but 
2465         createMarkup now *only* creates a top level style span.
2466         Only remove redundant styles from style spans and only remove
2467         unstyled elements if they are style spans.  FF doesn't
2468         remove redundant styles from elements, or remove redundant 
2469         font tags on copy/paste.  We could offer this functionality 
2470         through a separate "cleanup" command.
2471         * editing/markup.cpp:
2472         (WebCore::createMarkup): Only add markup for ancestors of 
2473         lastClosed if we're including markup for acommonAncestorBlock 
2474         (we do this for commonAncestorBlocks like tables and lists),
2475         otherwise it's unnecessary/redundant.
2476
2477 2007-03-14  Anders Carlsson  <acarlsson@apple.com>
2478
2479         Reviewed by Ada.
2480
2481         Make sure to call ResourceLoader::didReceiveData to ensure that there's a shared buffer with the resource
2482         data, since SubresourceLoaderClients now make use of that buffer.
2483         
2484         * loader/SubresourceLoader.cpp:
2485         (WebCore::SubresourceLoader::didReceiveData):
2486
2487 2007-03-14  Administrator  <acarlsson@apple.com>
2488
2489         Get the size from the shared buffer.
2490         
2491         * platform/graphics/cg/ImageSourceCG.cpp:
2492         (WebCore::ImageSource::setData):
2493         * platform/graphics/cg/PDFDocumentImage.cpp:
2494         (WebCore::PDFDocumentImage::dataChanged):
2495
2496 2007-03-14  Mitz Pettel  <mitz@webkit.org>
2497
2498         Reviewed by Hyatt, thumbs up by Darin.
2499
2500         - fix http://bugs.webkit.org/show_bug.cgi?id=12782
2501           Reproducible crash in BidiContext::deref
2502
2503         Test: fast/dynamic/anonymous-block-orphaned-lines.html
2504
2505         * rendering/InlineBox.cpp:
2506         (WebCore::InlineBox::root): Added an assertion that we return a root inline box.
2507         * rendering/RenderBlock.cpp:
2508         (WebCore::RenderBlock::removeChild): Added code to adopt the line boxes of
2509         anonymous blocks being destroyed instead of leaving them orphaned, which
2510         is what caused this crash. The boxes will be deleted on the next layout, but
2511         this ensures consistency in the mean time.
2512
2513 2007-03-14  Lars Knoll <lars@trolltech.com>
2514
2515         Reviewed by Antti.
2516
2517         Fix the Qt build.
2518         Add a getter to SharedBuffer that returns a reference to the internal
2519         Vector to avoid an extra copy of the data.
2520
2521         * platform/SharedBuffer.h:
2522         (WebCore::SharedBuffer::buffer):
2523         * platform/graphics/qt/ImageQt.cpp:
2524         (WebCore::Image::loadPlatformResource):
2525         * platform/graphics/qt/ImageSourceQt.cpp:
2526         (WebCore::detectImageFormat):
2527         (WebCore::createDecoder):
2528         (WebCore::ImageSource::setData):
2529
2530 2007-03-14  Antti Koivisto  <antti@apple.com>
2531
2532         Reviewed by Mitz.
2533         
2534         Fix <rdar://problem/5058774>
2535         REGRESSION: In Mail, caret appears oversized when typing in a To Do note
2536         
2537         Horizontal and vertical were switched. Was regression from
2538         http://trac.webkit.org/projects/webkit/changeset/20103
2539
2540         * rendering/RootInlineBox.cpp:
2541         (WebCore::RootInlineBox::addHighlightOverflow):
2542
2543 2007-03-14  David Hyatt  <hyatt@apple.com>
2544
2545         Tweak the data() functions of stylesheets and scripts to be internally consistent.
2546
2547         * loader/CachedCSSStyleSheet.cpp:
2548         (WebCore::CachedCSSStyleSheet::data):
2549         * loader/CachedScript.cpp:
2550         (WebCore::CachedScript::data):
2551         * loader/CachedXSLStyleSheet.cpp:
2552         (WebCore::CachedXSLStyleSheet::data):
2553
2554 2007-03-14  David Hyatt  <hyatt@apple.com>
2555
2556         Fix Radar 5050688.  
2557
2558         For large animated GIFs, destroy and recreate the source for every animation frame.  This keeps
2559         the memory consumption down while giant images are animating.
2560
2561         Reviewed by andersca
2562
2563         * platform/graphics/BitmapImage.cpp:
2564         (WebCore::BitmapImage::BitmapImage):
2565         (WebCore::BitmapImage::destroyDecodedData):
2566         (WebCore::BitmapImage::dataChanged):
2567         (WebCore::BitmapImage::advanceAnimation):
2568         * platform/graphics/BitmapImage.h:
2569
2570 2007-03-14  David Hyatt  <hyatt@apple.com>
2571
2572         Make sure to use CFDataCreateWithBytesNoCopy where we can.
2573
2574         Reviewed by andersca
2575
2576         * platform/graphics/cg/ImageSourceCG.cpp:
2577         (WebCore::ImageSource::setData):
2578         * platform/graphics/cg/PDFDocumentImage.cpp:
2579         (WebCore::PDFDocumentImage::dataChanged):
2580
2581 2007-03-13  David Hyatt  <hyatt@apple.com>
2582
2583         Fix for bugzilla bug 13050 and also radar p1 5050645.
2584
2585         This patch reworks resource loading to avoid having redundant buffers in the icon database and in cached
2586         images in the WebCore cache.  It also avoids overcopying in top-level image documents and in the icon
2587         database.
2588
2589         There is now only one SharedBuffer for a resource and everybody observes that buffer now instead of ever
2590         making their own.  Even ImageIO uses the SharedBuffer while decoding.
2591
2592         The page in 13050 dropped from 145mb down to 45mb of memory use with this change for a stunning savings
2593         of 100mb.
2594
2595         Reviewed by olliej, mjs
2596
2597         * WebCore.exp:
2598         * loader/CachedCSSStyleSheet.cpp:
2599         (WebCore::CachedCSSStyleSheet::data):
2600         * loader/CachedCSSStyleSheet.h:
2601         * loader/CachedImage.cpp:
2602         (WebCore::CachedImage::data):
2603         * loader/CachedImage.h:
2604         * loader/CachedResource.cpp:
2605         (WebCore::CachedResource::CachedResource):
2606         (WebCore::CachedResource::~CachedResource):
2607         * loader/CachedResource.h:
2608         (WebCore::CachedResource::data):
2609         * loader/CachedScript.cpp:
2610         (WebCore::CachedScript::data):
2611         * loader/CachedScript.h:
2612         * loader/CachedXSLStyleSheet.cpp:
2613         (WebCore::CachedXSLStyleSheet::data):
2614         * loader/CachedXSLStyleSheet.h:
2615         * loader/DocLoader.cpp:
2616         (WebCore::DocLoader::checkCacheObjectStatus):
2617         * loader/ImageDocument.cpp:
2618         (WebCore::ImageTokenizer::writeRawData):
2619         (WebCore::ImageTokenizer::finish):
2620         * loader/icon/IconDataCache.cpp:
2621         (WebCore::IconDataCache::setImageData):
2622         (WebCore::IconDataCache::writeToDatabase):
2623         * loader/icon/IconDataCache.h:
2624         * loader/icon/IconDatabase.cpp:
2625         (WebCore::IconDatabase::imageDataForIconURL):
2626         (WebCore::IconDatabase::iconForPageURL):
2627         (WebCore::IconDatabase::setIconDataForIconURL):
2628         (WebCore::IconDatabase::setHaveNoIconForIconURL):
2629         (WebCore::IconDatabase::imageDataForIconURLQuery):
2630         * loader/icon/IconDatabase.h:
2631         * loader/icon/IconLoader.cpp:
2632         (WebCore::IconLoader::startLoading):
2633         (WebCore::IconLoader::didReceiveResponse):
2634         (WebCore::IconLoader::didReceiveData):
2635         (WebCore::IconLoader::didFail):
2636         (WebCore::IconLoader::finishLoading):
2637         (WebCore::IconLoader::clearLoadingState):
2638         * loader/icon/IconLoader.h:
2639         * loader/icon/SQLStatement.cpp:
2640         (WebCore::SQLStatement::getColumnBlobAsVector):
2641         (WebCore::SQLStatement::isExpired):
2642         * loader/icon/SQLStatement.h:
2643         * loader/loader.cpp:
2644         (WebCore::Loader::didFinishLoading):
2645         (WebCore::Loader::didReceiveData):
2646         * page/mac/WebCoreFrameBridge.mm:
2647         (-[WebCoreFrameBridge getData:andResponse:forURL:]):
2648         (-[WebCoreFrameBridge getAllResourceDatas:andResponses:]):
2649         * platform/SharedBuffer.h:
2650         (WebCore::SharedBuffer::isEmpty):
2651         * platform/graphics/BitmapImage.cpp:
2652         (WebCore::BitmapImage::destroyDecodedData):
2653         (WebCore::BitmapImage::dataChanged):
2654         * platform/graphics/BitmapImage.h:
2655         * platform/graphics/Image.cpp:
2656         (WebCore::Image::setData):
2657         * platform/graphics/Image.h:
2658         (WebCore::Image::dataChanged):
2659         (WebCore::Image::data):
2660         * platform/graphics/ImageSource.h:
2661         * platform/graphics/cg/ImageSourceCG.cpp:
2662         (WebCore::ImageSource::setData):
2663         * platform/graphics/cg/PDFDocumentImage.cpp:
2664         (WebCore::PDFDocumentImage::dataChanged):
2665         * platform/graphics/cg/PDFDocumentImage.h:
2666         * platform/graphics/mac/ImageMac.mm:
2667         (WebCore::Image::loadPlatformResource):
2668         * platform/graphics/svg/SVGImage.cpp:
2669         (WebCore::SVGImage::setData):
2670         * platform/mac/PasteboardMac.mm:
2671         (WebCore::fileWrapperForImage):
2672
2673 2007-03-13  Justin Garcia  <justin.garcia@apple.com>
2674
2675         Reviewed by darin
2676         
2677         <rdar://problem/5046875> 
2678         Gmail Editor: Applying alignment to selected text in message also applies alignment to signature
2679
2680         * editing/ApplyStyleCommand.cpp:
2681         (WebCore::ApplyStyleCommand::doApply): Don't call applyBlockStyle unless
2682         there is a block style to apply.
2683         (WebCore::ApplyStyleCommand::applyBlockStyle): Don't do the remove step.
2684         It was unnecessary and removed properties from blocks that could contain 
2685         content outside the range being operated on (added a testcase).
2686         (WebCore::ApplyStyleCommand::addBlockStyleIfNeeded): Used an early return
2687         instead of if-nesting.
2688         * editing/ApplyStyleCommand.h:
2689         * editing/CompositeEditCommand.cpp:
2690         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
2691         Return the new block, if one was created.  Use moveParagraphs to move
2692         paragraphs into the new block, instead of moving nodes.  The old code moved
2693         too much (added a testcase).
2694         * editing/CompositeEditCommand.h:
2695
2696 2007-03-13  Oliver Hunt  <oliver@apple.com>
2697
2698         Reviewed by Brady.
2699
2700         To fix <rdar://problem/5044366> we now pass a NSString
2701         representation of the URL extracted with _web_originalDataAsString
2702         instead of relying on [NSURL absoluteString] in the bridge
2703
2704         * page/mac/WebCoreFrameBridge.h:
2705         * page/mac/WebCoreFrameBridge.mm:
2706         (-[WebCoreFrameBridge getData:andResponse:forURL:]):
2707
2708 2007-03-13  Brady Eidson  <beidson@apple.com>
2709
2710         Reviewed by Anders
2711
2712         <rdar://problem/5048818> - REGRESSION: Incompletely loaded resources being saved to the object cache
2713
2714         Due to a subtle change in loader behavior back in 10904, we would stop all loaders before calling 
2715         didFail() on them in the Cache loader.  As a result, we basically cleared all of the Subresource Loaders 
2716         out of the Cache loader before more properly failing them as errored out.  The result?  Partially loaded
2717         resources being cached.
2718         
2719         Since Loader::didFail() both calls error() on the object *and* removes the loader, the solution is to call 
2720         didFail() for all cancelled loaders instead of *only* removing them from the set of active loaders.
2721         
2722         In addition, pages that didn't completely load were being saved to the back/forward cache.  To fix that,
2723         I added a null check on the DocumentLoader's error to see if the page ended in an error, or did indeed 
2724         completely load.
2725
2726         Note that the layout test for this - if possible - will require other enhancements including possibly adding
2727         support for window.stop().  That task is documented in <rdar://problem/5061826>
2728
2729         * loader/FrameLoader.cpp:
2730         (WebCore::FrameLoader::provisionalLoadStarted): Fixed a few bugs relating to my original BFCache rewrite to
2731           more perfectly restore the original behavior - including only caching HTML documents via the 
2732           m_client->canCachePage() call
2733         (WebCore::FrameLoader::canCachePage): Don't make the call to m_client->canCachePage() as that serves a different
2734           purpose
2735           - Check the mainDocumentError to see if the load ended in error as a further criteria in determining the 
2736           cachability of a page
2737
2738         * loader/loader.cpp:
2739         (WebCore::Loader::cancelRequests): Call didFail(cancelledError()) instead of just removing the loaders from the 
2740           loaders-in-progress set.  This adds the effect of properly cleaning up the cached object.
2741
2742 2007-03-13  Beth Dakin  <bdakin@apple.com>
2743
2744         Rendering part reviewed by Hyatt. Editing part consulted with and 
2745         rubber stamped by Justin and Harrison.
2746
2747         Fix for <rdar://problem/5025925> A hang occurs in Safari when 
2748         attempting to print page at http://www.pcadvisor.co.uk
2749
2750         * rendering/RenderBlock.cpp:
2751         (WebCore::RenderBlock::makeChildrenNonInline): 
2752         RenderBlock::makeChildrenNonInline() takes a block's inline 
2753         children and turns them into block children. If the children had 
2754         line boxes, those boxes were being leaked. In the layout test I 
2755         added with the change (and at pcadvisor.co.uk during printing) 
2756         children were being made non-inline, and then they were being made 
2757         inline again. This meant that some of the children ended up 
2758         pointing to totally stale line boxes that are normally just leaked. 
2759         This caused an infinite loop in RenderFlow::destroy(). This patch 
2760         simply deletes everyone's line boxes in 
2761         RenderBlock::makeChildrenNonInline()
2762
2763         * editing/InsertParagraphSeparatorCommand.cpp:
2764         (WebCore::InsertParagraphSeparatorCommand::doApply): The other part 
2765         of this fix is that I added a call to updateLayout in 
2766         InsertParagraphSeparatorCommand::doApply(). One layout test 
2767         (editing/spelling/spelling.html) was changed by my patch to 
2768         RenderBlock. doApply() inserts a node into the render tree. In at 
2769         least one case in spelling.html, that caused some line boxes to be 
2770         deleted. Back in doApply() this meant that the RenderTree was out-
2771         of-date, and we mistakenly thought we were at the end of the 
2772         paragraph. This caused us to insert a RenderBR() at the end of the 
2773         tree instead of an empty RenderText(). No one seems to know exactly 
2774         why we insert either, or if the change is necessarily a problem. It 
2775         is clear, though, that the RenderTree in doApply() is out-of-date 
2776         after inserting the node and deleting some line boxes, so it seems 
2777         prudent to call into updateLayout().
2778
2779 2007-03-13  Adam Roben  <aroben@apple.com>
2780
2781         Reviewed by Anders.
2782
2783         * platform/FontData.h: Added m_isSystemFont parameter to match NSFont.
2784
2785 2007-03-13  Beth Dakin  <bdakin@apple.com>
2786
2787         Reviewed by Maciej.
2788
2789         Export DocumentLoader::setFrame(). Part of fix for <rdar://
2790         problem/4277074> 8F32: Help Viewer crashed on clicking link - 
2791         KHTMLView::viewportMouseReleaseEvent (12647)
2792
2793         * WebCore.exp:
2794
2795 2007-03-13  Darin Adler  <darin@apple.com>
2796
2797         Reviewed by Maciej.
2798
2799         - fix http://bugs.webkit.org/show_bug.cgi?id=12794
2800           <rdar://problem/5028154> REGRESSION: TripTik planner at aaa.com never
2801           finishes loading due to unclosed canvas tag (12794)
2802
2803         Change <canvas> elements so that their contents are parsed normally,
2804         but not rendered. This change fixes the bug, because normal parsing
2805         rules close the <canvas> element in that case. The special parser
2806         stuff was just getting in the way.
2807
2808         Also do some basic cleanup to the HTML parser. This was motivated by
2809         an earlier version of this patch that made even more changes to the
2810         parser, but the cleanup is still worth landing.
2811
2812         Test: fast/canvas/canvas-hides-fallback.html
2813         Test: fast/canvas/script-inside-canvas-fallback.html
2814         Test: fast/canvas/unclosed-canvas-1.html
2815         Test: fast/canvas/unclosed-canvas-2.html
2816         Test: fast/canvas/unclosed-canvas-3.html
2817         Test: fast/canvas/unclosed-canvas-4.html
2818
2819         * html/HTMLCanvasElement.h: Added a data member to keep track of whether the
2820         renderer is a RenderHTMLCanvas or not.
2821         * html/HTMLCanvasElement.cpp:
2822         (WebCore::HTMLCanvasElement::createRenderer): If JavaScript is enabled, create
2823         a RenderHTMLCanvas. If it's not, let the default code create the default type
2824         of renderer, which will result in fallback content being visible. The
2825         RenderHTMLCanvas class already hides all of its children. Set the m_rendererIsCanvas
2826         boolean accordingly. Since the actual storage for the canvas is allocated lazily
2827         when you actually get a drawing context, we don't need to do anything special
2828         to prevent it when JavaScript is disabled; the relevant functions won't be called.
2829         (WebCore::HTMLCanvasElement::reset): Protect the code that manipulates the
2830         RenderHTMLCanvas with a check of m_rendererIsCanvas. This is the only code inside
2831         the DOM element that relies on the renderer type.
2832
2833         * html/HTMLParser.h: Removed unneeded includes. Marked HTMLParser as
2834         Noncopyable. Changed the Document parameter to the constructor to instead
2835         be HTMLDocument. Renamed discard_until to m_skipModeTag for clarity.
2836         Removed unused noSpaces function and unneeded public doc() function.
2837         Moved data members all down to the end so you can see them together in order.
2838         Renamed map to m_currentMapElement and isindex to m_isindexElement.
2839         Removed unused end and headLoaded data members.  Renamed m_fragment to
2840         m_isParsingFragment to make it clearer that it's a boolean, not a fragment.
2841
2842         * html/HTMLParser.cpp:
2843         (WebCore::HTMLParser::HTMLParser): Changed to use member construction
2844         syntax instead of calling reset(). This is especially helpful in the
2845         fragment case, where calling reset() later on is illegal, so not using
2846         it in the constructor lets us assert.
2847         (WebCore::HTMLParser::~HTMLParser): Did an explicit deref instead of
2848         calling setCurrent for its side effect.
2849         (WebCore::HTMLParser::reset): Updated for member name changes and removal
2850         and to use document instead of doc().
2851         (WebCore::HTMLParser::setCurrent): Use document instead of doc().
2852         (WebCore::HTMLParser::setSkipMode): Added. No longer inline. Now sets the
2853         m_inCanvasBeforeFirstOpenTag data member to false.
2854         (WebCore::HTMLParser::parseToken): Tightened up the skip mode logic at the
2855         top of the function, and added a FIXME about the strange case there where
2856         we don't skip yet stay in skip mode. Updated for renaming and doc().
2857         (WebCore::HTMLParser::insertNode): Updated for renaming and doc().
2858         (WebCore::HTMLParser::handleError): Ditto.
2859         (WebCore::HTMLParser::framesetCreateErrorCheck): Ditto.
2860         (WebCore::HTMLParser::isindexCreateErrorCheck): Changed to use RefPtr.
2861         (WebCore::HTMLParser::noscriptCreateErrorCheck): Updated for renaming and doc().
2862         (WebCore::HTMLParser::mapCreateErrorCheck): Ditto.
2863         (WebCore::HTMLParser::getNode): Removed the special case for canvas here.
2864         Canvas fallback is now handled in the DOM, not the parser. Updated for
2865         renaming and doc().
2866         (WebCore::HTMLParser::allowNestedRedundantTag): Changed a #define into a C++
2867         constant.
2868         (WebCore::HTMLParser::processCloseTag): Updated for renaming and doc().
2869         (WebCore::HTMLParser::isInline): Ditto.
2870         (WebCore::HTMLParser::tagIsOnStack): Added. Used by new canvas logic.
2871         (WebCore::HTMLParser::popBlock): Updated for renaming and doc(). Also renamed
2872         the local variable Elem to elem.
2873         (WebCore::HTMLParser::createHead): Ditto.
2874         (WebCore::HTMLParser::handleIsindex): Changed to use RefPtr.
2875         (WebCore::HTMLParser::startBody): Updated for renaming and doc().
2876         (WebCore::HTMLParser::finished): Ditto.
2877
2878 2007-03-13  David Hyatt  <hyatt@apple.com>
2879
2880         Two more cleanup fixes to the cache.  Don't call destroyDecodedData in the BitmapImage destructor, since
2881         clearing the image source and calling setData on it again causes it to do an extra copy of the encoded
2882         data.  Since we're about to be destroyed this is just wasteful.
2883
2884         When the cache prunes, don't allow it to destroy the decoded data of an image that is still actively loading,
2885         since we've established that ImageIO can actually crash if you yank the rug out from under it like that.
2886
2887         Reviewed by ggaren
2888
2889         * loader/Cache.cpp:
2890         (WebCore::Cache::prune):
2891         * platform/graphics/BitmapImage.cpp:
2892         (WebCore::BitmapImage::~BitmapImage):
2893
2894 2007-03-13  Anders Carlsson  <acarlsson@apple.com>
2895
2896         Try fixing the Qt build.
2897         
2898         * editing/Editor.h:
2899         (WebCore::Editor::setStartNewKillRingSequence):
2900
2901 2007-03-13  David Harrison  <harrison@apple.com>
2902
2903         Reviewed by Justin.
2904
2905         <rdar://problem/5031181> cntl-k at end of paragraph adds nothing to the kill ring
2906         <rdar://problem/5031189> REGRESSION: cntl-y yanks only the most recently killed content
2907
2908         For rdar://5031181, properly extend the selection before the killring handling, and
2909         make sure plainText of that selection returns a linefeed.
2910         
2911         For rdar://5031189, restore Editor::deleteRange() code that continued current killring,
2912         even though the range deletion implicitly stopped it via changing the selection.
2913         
2914         A byproduct of this change is the elimination of RUNDFINDER vs CONTENT TextIterator. The
2915         only difference between the two was whether to emit a newline when the range started
2916         with a blockflow element. No callers actually need that any more.
2917
2918         Tests added:
2919         * editing/pasteboard/emacs-ctrl-k-y-001-expected.checksum: Added.
2920         * editing/pasteboard/emacs-ctrl-k-y-001-expected.png: Added.
2921         * editing/pasteboard/emacs-ctrl-k-y-001-expected.txt: Added.
2922         * editing/pasteboard/emacs-ctrl-k-y-001.html: Added.
2923
2924         * editing/Editor.cpp:
2925         (WebCore::Editor::deleteRange):
2926         Clear the "start new kill ring sequence" setting, because it was set to true
2927         when the selection was updated by deleting the range.
2928         
2929         (WebCore::Editor::deleteWithDirection):
2930         If extending the selection to the end of paragraph resulted in a caret selection,
2931         extend by character, to handle the case when the selection started as a caret at
2932         the end of paragraph.
2933         
2934         * editing/TextIterator.cpp:
2935         (WebCore::TextIterator::TextIterator):
2936         Initialize new member variables for tracking handling of the beginning of the range.
2937         
2938         (WebCore::TextIterator::advance):
2939         Call representNodeOffsetZero on the m_endContainer.
2940         Move visibility checks into handleTextNode and handleReplacedElement.
2941         
2942         (WebCore::TextIterator::handleTextNode):
2943         (WebCore::TextIterator::handleTextBox):
2944         Call emitText.
2945         
2946         (WebCore::TextIterator::handleReplacedElement):
2947         Moved visibility check into here.
2948         
2949         (WebCore::shouldEmitNewlinesBeforeAndAfterNode):
2950         
2951         (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
2952         (WebCore::TextIterator::representNodeOffsetZero):
2953         New. Emits proper sequence when encountering offset 0 of a node, including the
2954         m_endContainer. Started with code from handleNonTextNode.
2955         
2956         (WebCore::TextIterator::handleNonTextNode):
2957         Call representNodeOffsetZero.
2958         
2959         (WebCore::TextIterator::exitNode):
2960         Similar to shouldRepresentNodeOffsetZero, do not emit the newline if the node
2961         was collapsed, and before any other emitted content.
2962         
2963         (WebCore::TextIterator::emitCharacter):
2964         
2965         (WebCore::TextIterator::emitText):
2966         New. Consolidates code used by handleText and handleTextBox.
2967         
2968         (WebCore::CharacterIterator::CharacterIterator):
2969         Removed RUNFINDER.
2970
2971         (WebCore::WordAwareIterator::WordAwareIterator):
2972         Removed RUNFINDER.
2973         
2974         (WebCore::WordAwareIterator::advance):
2975         Formatting.
2976
2977         (WebCore::TextIterator::rangeLength):
2978         Formatting.
2979         
2980         * editing/TextIterator.h:
2981         Added member variables for tracking handling of the beginning of the range.
2982         Eliminated concept of RUNDFINDER vs CONTENT TextIterator.
2983         
2984         * editing/visible_units.cpp:
2985         (WebCore::nextBoundary):
2986         Eliminated concept of RUNDFINDER vs CONTENT TextIterator.
2987
2988 2007-03-13  David Hyatt  <hyatt@apple.com>
2989
2990         Clean up the null image case in CachedImage::data to make sure the size totals will stay accurate.
2991         I'm not convinced this case can even be hit, but I'm cleaning it up just in case.
2992
2993         * loader/CachedImage.cpp:
2994         (WebCore::CachedImage::data):
2995
2996 2007-03-13  David Hyatt  <hyatt@apple.com>
2997
2998         Reorder the call to allReferencesRemoved, since otherwise the live object size will become
2999         incorrect.
3000
3001         * loader/CachedResource.cpp:
3002         (WebCore::CachedResource::deref):
3003
3004 2007-03-13  Antti Koivisto  <antti@apple.com>
3005
3006         Reviewed by Darin.
3007         
3008         Fix http://bugs.webkit.org/show_bug.cgi?id=11083
3009         REGRESSION: Typing tab key fails to insert a tab character in Google Docs editable area
3010         <rdar://problem/4757650>
3011         
3012         Allow inserting tabs in designMode. Backtab behaves like before (matches FF).
3013
3014         * page/EventHandler.cpp:
3015         (WebCore::EventHandler::defaultTabEventHandler):
3016
3017 2007-03-13  David Hyatt  <hyatt@apple.com>
3018
3019         Fix two counting errors in the decoded size of objects in the WebCore cache.  We need to explicitly
3020         destroy decoded data when clearing out a partially loaded image that had an error, since the destructor
3021         (although it does destroy the data) disconnects the observer so that the notification doesn't happen.
3022
3023         Some CachedImages aren't in the cache (like image documents).  When the decoded size of such an image
3024         changes we should not notify the cache, since - newsflash - we aren't actually in it.
3025
3026         Reviewed by ggaren
3027
3028         * loader/CachedImage.cpp:
3029         (WebCore::CachedImage::clear):
3030         (WebCore::CachedImage::decodedSizeChanged):
3031
3032 2007-03-13  Darin Adler  <darin@apple.com>
3033
3034         Reviewed by Tim Hatcher and John Sullivan.
3035
3036         - fix <rdar://problem/4915303> CrashTracer: 36 crashes in Safari at
3037           com.apple.AppKit: -[NSView getRectsBeingDrawn:count:] + 502
3038
3039         * page/mac/FrameMac.mm: (WebCore::Frame::imageFromRect):
3040         This was calling drawRect: directly, but NSView's getRectsBeingDrawn:count:
3041         method was never really safe to call unless it was AppKit that called your
3042         drawRect: method. Changed it to call drawSingleRect: instead. A little ugly,
3043         but seems to work and will almost certainly fix the bug.
3044
3045 2007-03-13  Nikolas Zimmermann  <zimmermann@kde.org>
3046
3047         Reviewed by Maciej.
3048
3049         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12974
3050
3051         Call forgetGenericContext in JSSVGPathSeg destructor, otherwhise
3052         we'll hit an ASSERT in a debug build, when running svg/custom/js-update-path-changes.svg
3053         a few dozen times in a single WebKit instance. The ASSERT is good and just warns that
3054         there was already a generic context pointer registered, and the new "to be registered"
3055         object already exists, but pointing to a different object. That's because garbage collection
3056         calls the JSSVGPathSeg destructor, but that didn't cleanup the generic context map.
3057
3058         Only JSSVGPathSeg is hit by this problem, as it's the only non SVGAnimated* type
3059         using the generic context system while using a custom JSSVGPathSegList implementation.
3060
3061         Also cleanup JSSVGPathSegListCustom code to call the static forgetGenericContext
3062         method instead of doing the same using custom code.
3063
3064         * bindings/js/JSSVGPathSegListCustom.cpp:
3065         (WebCore::removeFromPathSegContextMap):
3066         (WebCore::JSSVGPathSegList::clear):
3067         (WebCore::JSSVGPathSegList::removeItem):
3068         * bindings/scripts/CodeGeneratorJS.pm:
3069
3070 2007-03-13  Darin Adler  <darin@apple.com>
3071
3072         Reviewed by Adele.
3073
3074         - fix http://bugs.webkit.org/show_bug.cgi?id=12595
3075           <rdar://problem/4722863> REGRESSION: Can't add item to cart at lnt.com
3076           (JS type error) (12595)
3077
3078         Test: fast/forms/old-names.html
3079
3080         * bindings/js/JSHTMLFormElementCustom.cpp:
3081         (WebCore::JSHTMLFormElement::canGetItemsForName): If the form collection has
3082         nothing for a given name, try the form's oldNamedElement function.
3083         (WebCore::JSHTMLFormElement::nameGetter): Ditto.
3084
3085         * bindings/js/kjs_dom.h: Removed the DOMNamedNodesCollection. Instead we will use
3086         a class derived from NodeList.
3087         * bindings/js/kjs_dom.cpp: Ditto.
3088
3089         * bindings/js/kjs_html.cpp:
3090         (KJS::VectorNodeList::VectorNodeList): Added. Constructor for a new class derived
3091         from NodeList to be used for the named items result from a collection -- uses a
3092         vector of node pointers.
3093         (KJS::VectorNodeList::length): Added.
3094         (KJS::VectorNodeList::item): Added.
3095         (KJS::JSHTMLCollection::getNamedItems): Use VectorNodeList and the existing wrapper
3096         for NodeList rather than a custom JavaScript class, DOMNamedNodesCollection.
3097
3098         * dom/ChildNodeList.h:
3099         * dom/ChildNodeList.cpp:
3100         (WebCore::ChildNodeList::ChildNodeList): Updated to derive from TreeNodeList,
3101         since NodeList is now a simpler class.
3102         (WebCore::ChildNodeList::elementMatches): Updated for name and parameter change.
3103
3104         * dom/NameNodeList.h:
3105         * dom/NameNodeList.cpp:
3106         (WebCore::NameNodeList::NameNodeList): Updated to derive from TreeNodeList,
3107         since NodeList is now a simpler class.
3108         (WebCore::NameNodeList::rootNodeAttributeChanged): Updated for name and
3109         parameter change.
3110
3111         * dom/Node.h: Change register/unregister functions to take TreeNodeList.
3112         * dom/Node.cpp:
3113         (WebCore::TagNodeList::TagNodeList): Updated to derive from TreeNodeList,
3114         since NodeList is now a simpler abstract class.
3115         (WebCore::TagNodeList::elementMatches): Updated for name and parameter change.
3116         (WebCore::Node::registerNodeList): Changed type from NodeList to TreeNodeList.
3117         (WebCore::Node::unregisterNodeList): Ditto.
3118
3119         * dom/NodeList.h: Broke NodeList into a simpler base class and a derived class
3120         with the machinery for iterating a tree, called TreeNodeList.
3121         * dom/NodeList.cpp:
3122         (WebCore::NodeList::~NodeList): Added.
3123         (WebCore::NodeList::itemWithName): Factored out of the old itemWithName.
3124         (WebCore::TreeNodeList::TreeNodeList): Renamed from NodeList.
3125         (WebCore::TreeNodeList::~TreeNodeList): Ditto.
3126         (WebCore::TreeNodeList::recursiveLength): Ditto.
3127         (WebCore::TreeNodeList::itemForwardsFromCurrent): Ditto.
3128         (WebCore::TreeNodeList::itemBackwardsFromCurrent): Ditto.
3129         (WebCore::TreeNodeList::recursiveItem): Ditto.
3130         (WebCore::TreeNodeList::itemWithName): Factored half of this into this function,
3131         the other half in NodeList::itemWithName.
3132         (WebCore::TreeNodeList::rootNodeAttributeChanged): Added. No longer inline.
3133         (WebCore::TreeNodeList::rootNodeChildrenChanged): Renamed from NodeList.
3134
3135         * html/HTMLFormElement.h: Added formElementNameChanged and oldNamedElement
3136         fucntions, and a map called m_oldNames. Also removed m_boundary, which I
3137         thought I had already done.
3138         * html/HTMLFormElement.cpp:
3139         (WebCore::HTMLFormElement::HTMLFormElement): Initialize m_oldNames to 0.
3140         Switched the rest of the members to initialization syntax.
3141         (WebCore::HTMLFormElement::~HTMLFormElement): Delete m_oldNames.
3142         (WebCore::HTMLFormElement::formElementNameChanged): Added. Stores a reference
3143         to one element under each of its old names.
3144         (WebCore::HTMLFormElement::oldNamedElement): Added. Returns the old element
3145         that once had a given name.
3146
3147         * html/HTMLGenericFormElement.h:
3148         * html/HTMLGenericFormElement.cpp:
3149         (WebCore::HTMLGenericFormElement::parseMappedAttribute): When the name
3150         attribute changes, tell the form about the old name.
3151         (WebCore::HTMLGenericFormElement::insertedIntoTree): When telling a form
3152         about an element, also store away the old name so that we can use it
3153         when the name changes later.
3154
3155         * html/HTMLInputElement.cpp:
3156         (WebCore::HTMLInputElement::parseMappedAttribute): Added a call to the
3157         base class in the nameAttr case, so the code in HTMLGenericFormElement
3158         above will get called in the input element case.
3159
3160 2007-03-13  Antti Koivisto  <antti@apple.com>
3161
3162         Reviewed by Alexey.
3163
3164         Alexey spotted a DOS by using string of 64k unbreakable character in
3165         fix for http://bugs.webkit.org/show_bug.cgi?id=12833
3166
3167         * dom/Text.cpp:
3168         (WebCore::Text::createWithLengthLimit):
3169
3170 2007-03-13  Lars Knoll <lars@trolltech.com>
3171
3172         Fix the Qt build
3173
3174         * WebCore.pro:
3175
3176 2007-03-13  Rob Buis  <buis@kde.org>
3177
3178         Reviewed by Darin.
3179
3180         http://bugs.webkit.org/show_bug.cgi?id=12576
3181         WebKit does not support xlink:show attributes
3182
3183         Make an exception for non-empty targets, these should be opened
3184         in a new window, unless the value is _self.
3185
3186         * ksvg2/svg/SVGAElement.cpp:
3187         (WebCore::SVGAElement::defaultEventHandler):
3188
3189 2007-03-13  David Hyatt  <hyatt@apple.com>
3190
3191         - fix cache issues seen in http://bugs.webkit.org/show_bug.cgi?id=13050
3192           6 objects and ~200MB leaked after opening then closing tab
3193           <rdar://problem/5058714>
3194
3195         Double the encoded size of images for now.  We do this to account for a bug in ImageIO where they hold
3196         a separate copy of image data.  See <rdar://problem/5050645>.
3197
3198         Reviewed by aroben.
3199
3200         * loader/CachedImage.cpp:
3201         (WebCore::CachedImage::data):
3202
3203 2007-03-12  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
3204
3205         Not reviewed - gdk build fix.
3206
3207         * platform/gdk/TemporaryLinkStubs.cpp:
3208         (SearchPopupMenu::enabled): add missing stub.
3209
3210 2007-03-12  David Kilzer  <ddkilzer@kilzer.net>
3211
3212         Reviewed by Darin.
3213
3214         - fix http://bugs.webkit.org/show_bug.cgi?id=13045
3215           REGRESSION: Blackboard CourseWare Error with Nightlies after Mar 8
3216
3217         * html/HTMLFormElement.cpp:
3218         (WebCore::getUniqueBoundaryString): Speculative fix: remove dashes from
3219         the boundary prefix that appear after non-dash characters.
3220
3221 2007-03-12  Mitz Pettel  <mitz@webkit.org>
3222
3223         Reviewed by Anders.
3224
3225         - fix http://bugs.webkit.org/show_bug.cgi?id=13015
3226           REGRESSION (r17233-r17241): Repro crash when leaving a page whose unload handler submits a form
3227
3228         Test: fast/loader/onunload-form-submit-crash-2.html
3229
3230         * loader/DocumentLoader.cpp:
3231         (WebCore::DocumentLoader::finishedLoading): Added null check.
3232
3233 2007-03-12  Anders Carlsson  <acarlsson@apple.com>
3234
3235         Reviewed by Darin.
3236
3237         <rdar://problem/4900071>
3238         http://bugs.webkit.org/show_bug.cgi?id=6454
3239         ASSERTION: Navigating 'back' in frameset: !_private->previousItem (6454)
3240
3241         Change back the behavior of checkLoadComplete to traverse the entire frame tree instead of
3242         just the parent frames of the current frame. This is needed in order to reset the previous history item
3243         for all frames when doing a frame navigation. (This was changed in revision 11819)
3244         
3245         * loader/FrameLoader.cpp:
3246         (WebCore::FrameLoader::recursiveCheckLoadComplete):
3247         (WebCore::FrameLoader::checkLoadComplete):
3248         * loader/FrameLoader.h:
3249
3250 2007-03-12  Justin Garcia  <justin.garcia@apple.com>
3251
3252         Reviewed by darin
3253         
3254         <rdar://problem/5056619> 
3255         REGRESSION: Gmail Editor: Dragging text into Reply (textarea) field results in a crash at WebCore::InsertNodeBeforeCommand::doApply()
3256         
3257         * editing/SelectionController.cpp:
3258         (WebCore::removingNodeRemovesPosition): Added.
3259         (WebCore::SelectionController::nodeWillBeRemoved): Clear the
3260         selection if it's inside a shadow tree.
3261         * page/DragController.cpp:
3262         (WebCore::setSelectionToDragCaret): Return false to signal to
3263         clients that a drop shouldn't be performed if the second attempt
3264         to set a selection ends up in non-editable content.
3265
3266 2007-03-12  Darin Adler  <darin@apple.com>
3267
3268         Reviewed by Tim Hatcher.
3269
3270         - fixed JavaScript wrapper classes to be correct for a variety of cases
3271           that a new test uncovered: was broken for at least 5 classes
3272
3273         - fixed Objective-C wrapper classes to be correct for a variety of cases
3274           that a test case uncovered: was broken for ast least 50 classes
3275
3276         - added missing DOM API for creating OverflowEvent and WheelEvent instances
3277
3278         Test: fast/dom/wrapper-classes.html
3279
3280         * DerivedSources.make: Added missing bindings: HTMLCanvasElement for ObjC,
3281         CDATASection, Comment, and EntityReference for JavaScript.
3282         * WebCore.xcodeproj/project.pbxproj: Added those new generated files.
3283
3284         * bindings/js/JSHTMLElementWrapperFactory.cpp:
3285         (WebCore::createJSHTMLWrapper): Corrected the wrapper classes for <keygen>,
3286         which needs an HTMLSelectElement wrapper, and <xmp>, which needs an
3287         HTMLPreElement wrapper.
3288
3289         * bindings/objc/DOMInternal.h: Updated for new naming scheme.
3290         Also moved createDOMWrapper from the KJS namespace to the WebCore namespace.
3291         * bindings/objc/DOMUtility.mm:
3292         (KJS::createDOMWrapper): Broke the core function into a separate one, and
3293         left it in the KJS namespace because Objective-C++ rules make it impossible
3294         for it to work in the WebCore namespace. Used a macro-based implementation
3295         to cut down on repeated code, and added missing cases for Counter,
3296         HTMLOptionsCollection, Range, XPathExpression, XPathResult, Event, RGBColor,
3297         Rect, Window, DOMImplementation, NodeIterator, TreeWalker, and HTMLCollection.
3298         (WebCore::createDOMWrapper): The other half of the function.
3299
3300         * bindings/objc/DOM.mm:
3301         (WebCore::createElementClassMap): Corrected the wrapper classes for
3302         <canvas>, which needs a DOMHTMLCanvasElement wrapper, <del>, which needs
3303         a DOMHTMLModElement wrapper, <embed>, which needs a DOMHTMLEmbedElement
3304         wrapper, <ins>, which needs a DOMHTMLModElement wrapper, <th>, which needs
3305         a DOMHTMLTableCellElement wrapper, and <xmp>, which needs an
3306         DOMHTMLPreElement wrapper.
3307         (+[DOMNode _wrapNode:]): Updated for new naming scheme.
3308         (+[DOMNode _wrapEventTarget:]): Ditto.
3309         (+[DOMNodeFilter _wrapNodeFilter:]): Ditto.
3310         (ObjCNodeFilterCondition::acceptNode): Ditto.
3311         (-[DOMDocument createNodeIterator:whatToShow:filter:expandEntityReferences:]): Ditto.
3312         (-[DOMDocument createTreeWalker:whatToShow:filter:expandEntityReferences:]): Ditto.
3313         (WebCore::ObjCEventListener::handleEvent): Ditto.
3314
3315         * dom/Document.cpp: (WebCore::Document::createEvent):
3316         Added cases for OverflowEvent and WheelEvent.
3317
3318         * dom/OverflowEvent.h: Added empty constructor and initOverflowEvent.
3319         * dom/OverflowEvent.cpp:
3320         (WebCore::OverflowEvent::OverflowEvent): Added.
3321         (WebCore::OverflowEvent::initOverflowEvent): Added.
3322         * dom/OverflowEvent.idl: Added initOverflowEvent.
3323
3324         * bindings/objc/PublicDOMInterfaces.h: Added initOverflowEvent.
3325
3326         * bindings/objc/DOMCSS.mm:
3327         (+[DOMStyleSheet _wrapStyleSheet:]): Updated for new naming scheme.
3328         (+[DOMCSSRule _wrapCSSRule:]): Corrected wrapper for CSSUnknownRule.
3329         (+[DOMCSSValue _wrapCSSValue:]): Updated for new naming scheme.
3330
3331         * bindings/js/kjs_css.h:
3332         (KJS::DOMRGBColor::impl): Added. Used when making an ObjC wrapper.
3333         (KJS::DOMRect::impl): Ditto.
3334
3335         * bindings/js/kjs_dom.cpp: (KJS::toJS): Corrected the wrapper classes for
3336         CDATASection, Comment, and EntityReference.
3337
3338         * bindings/js/kjs_html.cpp: Corrected the class name for HTMLElement
3339         (was "DOMHTMLElement") and HTMLCollection (was "Collection").
3340
3341         * bindings/objc/DOMImplementationFront.h:
3342         * bindings/objc/DOMImplementationFront.cpp:
3343         (WebCore::implementationFront): Added new overload that returns a front given
3344         a JavaScript wrapper. Needed by the code that makes the Objective-C wrapper.
3345
3346         * bindings/objc/WebScriptObject.mm:
3347         (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
3348         Updated since createDOMWrapper is now in the WebCore namespace.
3349
3350         * bindings/scripts/CodeGeneratorObjC.pm: Update the naming scheme for the
3351         wrapper creation functions to use _wrapElement: rather then _elementWith:
3352         style. Removed now-unneeded special cases for things that needed to stay
3353         upper-case, since we don't have to do the whole lcfirst thing.
3354
3355         * html/HTMLCanvasElement.idl: Added #if so we can successfully generate the
3356         Objective-C wrapper for this class, even though we can't yet handle the
3357         DOMObject return type.
3358
3359         * html/HTMLOptionsCollection.idl: Added GenerateNativeConverter so we get
3360         an appropriate toJS function.
3361
3362         * bindings/objc/DOMEvents.mm:
3363         (+[DOMEvent _wrapEvent:]):
3364         * bindings/objc/DOMHTML.mm:
3365         (-[DOMHTMLDocument createDocumentFragmentWithMarkupString:baseURL:]):
3366         (-[DOMHTMLDocument createDocumentFragmentWithText:]):
3367         * bindings/objc/DOMObject.mm:
3368         (-[DOMObject sheet]):
3369         * bindings/objc/DOMRGBColor.mm:
3370         (-[DOMRGBColor red]):
3371         (-[DOMRGBColor green]):
3372         (-[DOMRGBColor blue]):
3373         (-[DOMRGBColor alpha]):
3374         (+[DOMRGBColor _wrapRGBColor:]):
3375         * bindings/objc/DOMSVGPathSegInternal.mm:
3376         (+[DOMSVGPathSeg _wrapSVGPathSeg:]):
3377         * bindings/objc/DOMXPath.mm:
3378         (+[DOMNativeXPathNSResolver _wrapXPathNSResolver:]):
3379         * page/mac/WebCoreFrameBridge.mm:
3380         (-[WebCoreFrameBridge nodesFromList:]):
3381         (-[WebCoreFrameBridge elementWithName:inForm:]):
3382         (-[WebCoreFrameBridge formForElement:]):
3383         (-[WebCoreFrameBridge currentForm]):
3384         (-[WebCoreFrameBridge controlsInForm:]):
3385         (-[WebCoreFrameBridge rangeByAlteringCurrentSelection:SelectionController::direction:SelectionController::granularity:]):
3386         (-[WebCoreFrameBridge convertNSRangeToDOMRange:]):
3387         (-[WebCoreFrameBridge markDOMRange]):
3388         (-[WebCoreFrameBridge markedTextDOMRange]):
3389         (-[WebCoreFrameBridge smartDeleteRangeForProposedRange:]):
3390         (-[WebCoreFrameBridge documentFragmentWithMarkupString:baseURLString:]):
3391         (-[WebCoreFrameBridge documentFragmentWithText:inContext:]):
3392         (-[WebCoreFrameBridge documentFragmentWithNodesAsParagraphs:]):
3393         (-[WebCoreFrameBridge replaceSelectionWithNode:selectReplacement:smartReplace:matchStyle:]):
3394         (-[WebCoreFrameBridge replaceSelectionWithText:selectReplacement:smartReplace:]):
3395         (-[WebCoreFrameBridge increaseSelectionListLevel]):
3396         (-[WebCoreFrameBridge increaseSelectionListLevelOrdered]):
3397         (-[WebCoreFrameBridge increaseSelectionListLevelUnordered]):
3398         (-[WebCoreFrameBridge dragCaretDOMRange]):
3399         (-[WebCoreFrameBridge editableDOMRangeForPoint:]):
3400         (-[WebCoreFrameBridge characterRangeAtPoint:]):
3401         (-[WebCoreFrameBridge typingStyle]):
3402         (-[WebCoreFrameBridge rangeOfCharactersAroundCaret]):
3403         * platform/mac/ClipboardMac.mm:
3404         (WebCore::ClipboardMac::declareAndWriteDragImage):
3405         * platform/mac/PasteboardMac.mm:
3406         (WebCore::Pasteboard::writeSelection):
3407         Updated for new naming scheme.
3408
3409 2007-03-12  Timothy Hatcher  <timothy@apple.com>
3410
3411         Reviewed by Darin.
3412
3413         <rdar://problem/4990691> REGRESSION: Selecting text in Adium's Messages field causes horizontal shift
3414
3415         Corrected the recursive point conversion and scrolling done in scrollPointRecursively to use the
3416         document view of each NSClipView.
3417
3418         * platform/mac/ScrollViewMac.mm:
3419         (WebCore::ScrollView::scrollPointRecursively): Call convertPoint:fromView: on the document views,
3420         not the clip views as we encounter them. Then call constrainScrollPoint: on the converted point to
3421         constrain to the document view bounds. And finally call scrollPoint: on the document view, not the clip view.
3422
3423 2007-03-12  Antti Koivisto  <antti@apple.com>
3424
3425         Reviewed by Alexey.
3426
3427         Fix http://bugs.webkit.org/show_bug.cgi?id=12833
3428         REGRESSION: Selecting text in 6.6MB txt file is sluggish as of the Feb 19th nightly
3429         <rdar://problem/5028159>
3430         
3431         Divide large text blocks (>64kB) over multiple text nodes. This limits linebox searches to
3432         a manageable subset.
3433         
3434         * dom/Text.cpp:
3435         (WebCore::Text::createWithLengthLimit):
3436         * dom/Text.h:
3437         * html/HTMLParser.cpp:
3438         (WebCore::HTMLParser::parseToken):
3439         * loader/TextDocument.cpp:
3440         (WebCore::TextTokenizer::write):
3441
3442 2007-03-12  David Hyatt  <hyatt@apple.com>
3443
3444         Fix a regression in printing.  Printer fonts need to be part of the
3445         font cache key, since printer fonts have different glyph widths.
3446         (Integer antialiasing is used for screen fonts but not for printer fonts.)
3447
3448         Reviewed by aroben
3449
3450         * platform/FontCache.cpp:
3451         (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
3452         (WebCore::FontPlatformDataCacheKey::operator==):
3453         (WebCore::computeHash):
3454         (WebCore::FontCache::getCachedFontPlatformData):
3455
3456 2007-03-12  Lars Knoll <lars@trolltech.com>
3457
3458         add missing symbol to fix the Qt build again.
3459
3460         * platform/qt/SearchPopupMenuQt.cpp:
3461         (WebCore::SearchPopupMenu::enabled):
3462
3463 2007-03-12  Adele Peterson  <adele@apple.com>
3464
3465         Reviewed by Oliver.
3466
3467         Adding the ability to enable or disable a SearchPopupMenu.
3468
3469         * platform/SearchPopupMenu.h:
3470         * platform/mac/SearchPopupMenuMac.mm: (WebCore::SearchPopupMenu::enabled):
3471         * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::showPopup):
3472
3473 2007-03-12  Rob Buis  <buis@kde.org>
3474
3475         Reviewed by Nikolas Zimmermann.
3476
3477         http://bugs.webkit.org/show_bug.cgi?id=12500
3478         SVG fails to correctly handle all link style selectors
3479         http://bugs.webkit.org/show_bug.cgi?id=12567
3480         <text> elements ignore <a> children
3481
3482         Allow <a> inside svg text and handle xlink:show.
3483
3484         * ksvg2/svg/SVGAElement.cpp:
3485         (WebCore::SVGAElement::createRenderer):
3486         (WebCore::SVGAElement::defaultEventHandler):
3487         (WebCore::SVGAElement::childShouldCreateRenderer):
3488         * ksvg2/svg/SVGAElement.h:
3489         * ksvg2/svg/SVGElement.h:
3490         (WebCore::SVGElement::isTextContent):
3491         * ksvg2/svg/SVGTextContentElement.h:
3492         (WebCore::SVGTextContentElement::isTextContent):
3493         * ksvg2/svg/SVGTextElement.cpp:
3494         (WebCore::SVGTextElement::childShouldCreateRenderer):
3495         * rendering/SVGInlineFlowBox.cpp:
3496         (WebCore::translateBox):
3497         (WebCore::placePositionedBoxesHorizontally):
3498         (WebCore::placeBoxesVerticallyWithAbsBaseline):
3499
3500 2007-03-12  Adele Peterson  <adele@apple.com>
3501
3502         Reviewed by Oliver.
3503
3504         Add a missing parameter to the constructor.
3505
3506         * platform/PlatformKeyboardEvent.h:
3507         * platform/win/KeyEventWin.cpp: (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
3508
3509 2007-03-12  Lars Knoll <lars@trolltech.com>
3510
3511         Fix the Qt build. I still get crashes though :/
3512
3513         * platform/graphics/qt/ImageDecoderQt.cpp:
3514         (WebCore::ImageDecoderQt::clearFrame):
3515         * platform/graphics/qt/ImageDecoderQt.h:
3516         * platform/graphics/qt/ImageSourceQt.cpp:
3517         (WebCore::ImageSource::setData):
3518         (WebCore::ImageSource::frameIsCompleteAtIndex):
3519         (WebCore::ImageSource::clear):
3520         (WebCore::ImageSource::destroyFrameAtIndex):
3521         * platform/qt/ClipboardQt.cpp:
3522         (WebCore::ClipboardQt::ClipboardQt):
3523         * platform/qt/ClipboardQt.h:
3524         * platform/qt/DragDataQt.cpp:
3525         (WebCore::DragData::createClipboard):
3526
3527 2007-03-11  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
3528
3529         Not reviewed - gdk build fixes.
3530
3531         * platform/gdk/EditorClientGdk.cpp:
3532         (WebCore::EditorClientGdk::respondToChangedSelection): add stub
3533         * platform/gdk/EditorClientGdk.h:
3534         * platform/gdk/FrameGdk.cpp:
3535         * platform/gdk/TemporaryLinkStubs.cpp:
3536         (Editor::markMisspellings): add stub
3537
3538 2007-03-11  Alexey Proskuryakov  <ap@webkit.org>
3539
3540         Reviewed by Adele.
3541
3542         http://bugs.webkit.org/show_bug.cgi?id=12560
3543         W3C XPath test Text_Nodes.svg fails