e6d2a6e53e79f84a156908f26251dcbe0fc21366
[WebKit-https.git] / WebCore / ChangeLog
1 2007-04-23  Anders Carlsson  <andersca@apple.com>
2
3         Reviewed by Ada.
4
5         <rdar://problem/5061022>
6         REGRESSION: Acrobat 8 plug-in fails to scroll with trackpad two-finger scroll or mouse wheel (12995)
7         
8         Pass wheel events to all widgets.
9         
10         * page/EventHandler.cpp:
11         (WebCore::EventHandler::handleWheelEvent):
12         * page/EventHandler.h:
13         * page/mac/EventHandlerMac.mm:
14         (WebCore::EventHandler::passWheelEventToWidget):
15
16 2007-04-23  Alp Toker  <alp@atoker.com>
17
18         Reviewed by Mark.
19
20         Save and restore the context state when beginning and ending a transparency layer.
21
22         * platform/graphics/cairo/GraphicsContextCairo.cpp:
23         (WebCore::GraphicsContext::beginTransparencyLayer):
24         (WebCore::GraphicsContext::endTransparencyLayer):
25
26 2007-04-23  Alp Toker  <alp@atoker.com>
27
28         Reviewed by Mark.
29
30         Further implementation and checks. The opacity layer code is not so beautiful
31         but gets the job done with fewer complications than maintaining our own stack.
32
33         * platform/graphics/cairo/GraphicsContextCairo.cpp:
34         (WebCore::GraphicsContext::translate):
35         (WebCore::GraphicsContext::setPlatformStrokeThickness):
36         (WebCore::GraphicsContext::beginTransparencyLayer):
37         (WebCore::GraphicsContext::endTransparencyLayer):
38         (WebCore::GraphicsContext::setCompositeOperation):
39         (WebCore::GraphicsContext::rotate):
40         (WebCore::GraphicsContext::scale):
41
42 2007-04-23  Darin Adler  <darin@apple.com>
43
44         Reviewed by Hyatt.
45
46         - rename box-sizing to -webkit-box-sizing
47           because of <rdar://problem/4667227> REGRESSION: Shifted table on page at
48           https://us.etrade.com/e/t/home (due to box-sizing)
49
50         * css/CSSComputedStyleDeclaration.cpp:
51         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Rename.
52         * css/CSSPropertyNames.in: Ditto.
53         * css/cssparser.cpp: (WebCore::CSSParser::parseValue): Rename and take out comment
54         explaining why we aren't prefacing with -webkit.
55         * css/cssstyleselector.cpp:
56         (WebCore::CSSStyleSelector::applyProperty): Rename.
57         * css/html4.css: Rename.
58         * css/quirks.css: Rename.
59
60 2007-04-23  Alp Toker  <alp@atoker.com>
61
62         Reviewed by Hyatt.
63
64         * platform/graphics/cairo/GraphicsContextCairo.cpp:
65         (WebCore::GraphicsContext::drawEllipse):
66         (WebCore::GraphicsContext::drawConvexPolygon):
67         Fix stroking and filling of ellipses and polygons.
68         * platform/graphics/cairo/ImageCairo.cpp:
69         (WebCore::BitmapImage::draw): Make use of a new GraphicsContext
70         function to simplify the code.
71         (WebCore::Image::drawPattern): Now implemented. This makes content
72         with tiled patterns (eg. CSS repeat) render correctly.
73         * platform/graphics/gdk/ImageGdk.cpp:
74         (WebCore::Image::drawPattern): Remove old stub.
75
76 2007-04-22  Lars Naesbye Christensen  <lars@naesbye.dk>
77
78         Reviewed by Tim Hatcher.
79
80         Prettier, more modern 'cell' cursor
81         http://bugs.webkit.org/show_bug.cgi?id=13441
82         Also updates past ChangeLog entries to new email address
83
84         * ChangeLog:
85         * ChangeLog-2006-12-31:
86         * Resources/cellCursor.png:
87
88 2007-04-23  Mark Rowe  <mrowe@apple.com>
89
90         Rubber-stamped by Hyatt.
91
92         Rename cMaxPenderingSourceLengthInLowBandwidthDisplay to cMaxPendingSourceLengthInLowBandwidthDisplay.
93
94         * loader/FrameLoader.cpp:
95         (WebCore::FrameLoader::switchOutLowBandwidthDisplayIfReady):
96
97 2007-04-22  Maciej Stachowiak  <mjs@apple.com>
98
99         Reviewed by Darin and Geoff.
100
101         - move most of Window's data members into a separate private object, to avoid needing
102         to use the oversize allocator for it
103         http://bugs.webkit.org/show_bug.cgi?id=13381
104         
105         It was the only remaining JSObject subclass to use the oversize
106         allocator on 32-bit platforms, and having oversize objects around
107         makes garbage collection slower so this would hurt performance
108         with many tabs/windows open.
109         
110         No significant effect on JS iBench.
111
112         * bindings/js/kjs_events.cpp:
113         (KJS::JSUnprotectedEventListener::JSUnprotectedEventListener):
114         (KJS::JSUnprotectedEventListener::~JSUnprotectedEventListener):
115         (KJS::JSEventListener::JSEventListener):
116         (KJS::JSEventListener::~JSEventListener):
117         (KJS::JSLazyEventListener::parseCode):
118         * bindings/js/kjs_window.cpp:
119         (KJS::WindowPrivate::WindowPrivate):
120         (KJS::Window::Window):
121         (KJS::Window::~Window):
122         (KJS::Window::location):
123         (KJS::Window::selection):
124         (KJS::Window::locationbar):
125         (KJS::Window::menubar):
126         (KJS::Window::personalbar):
127         (KJS::Window::statusbar):
128         (KJS::Window::toolbar):
129         (KJS::Window::scrollbars):
130         (KJS::Window::mark):
131         (KJS::Window::getValueProperty):
132         (KJS::Window::findJSEventListener):
133         (KJS::Window::findJSUnprotectedEventListener):
134         (KJS::Window::clearHelperObjectProperties):
135         (KJS::Window::clear):
136         (KJS::Window::setCurrentEvent):
137         (KJS::Window::setReturnValueSlot):
138         (KJS::Window::clearAllTimeouts):
139         (KJS::Window::installTimeout):
140         (KJS::Window::pauseTimeouts):
141         (KJS::Window::resumeTimeouts):
142         (KJS::Window::clearTimeout):
143         (KJS::Window::timerFired):
144         (KJS::Window::disconnectFrame):
145         (KJS::Window::jsEventListeners):
146         (KJS::Window::jsHTMLEventListeners):
147         (KJS::Window::jsUnprotectedEventListeners):
148         (KJS::Window::jsUnprotectedHTMLEventListeners):
149         * bindings/js/kjs_window.h:
150
151 2007-04-22  David Hyatt  <hyatt@apple.com>
152
153         Fix 1% regression on the PLT.  Make sure roundToDevicePixels does no
154         work when no scale is in effect.
155
156         Reviewed by mjs
157
158 2007-04-22  Darin Adler  <darin@apple.com>
159
160         Reviewed by Oliver.
161
162         - fix small things noticed while looking into a font subsitution bug
163
164         * platform/Font.h: (WebCore::Font::operator==): Corrected a misleading comment.
165
166         * platform/Font.cpp:
167         (WebCore::Font::Font): Initialize m_pageZero to 0 in the empty constructor instead
168         of leaving it uninitialized. Initialize m_fontList for tighter code. Remove unneeded
169         initialization of RefPtr members to 0. Changed the copy constructor to use initialization
170         for tighter code.
171         (WebCore::Font::operator=): Sorted to match the order from the header and the copy
172         constructor, and removed the uneeded self-assignment check.
173
174 2007-04-22  Darin Adler  <darin@apple.com>
175
176         Reviewed by Maciej.
177
178         - fix http://bugs.webkit.org/show_bug.cgi?id=5196
179           <rdar://problem/4537384> input type=file fields with style=display:none do not post
180           their values (5196)
181
182         - fix http://bugs.webkit.org/show_bug.cgi?id=8248
183           Can not clear file input field
184
185         * manual-tests/clear-input-file.html: Added.
186
187         * html/HTMLInputElement.cpp:
188         (WebCore::HTMLInputElement::appendFormData): Remove check that prevents submission of
189         form data when there is no renderer or the renderer is invisible. While well-intentioned,
190         the rule does not match the behavior of other web browsers.
191         (WebCore::HTMLInputElement::setValue): Instead of disallowing all value changes for file
192         type, allow changes to the empty string.
193         (WebCore::HTMLInputElement::storesValueSeparateFromAttribute): Made file type return true
194         for this. 1) The file type does store its value separate from the value attribute.
195         2) The code in setInputType() should do the right thing given this new value, according to
196         my inspection of the code. 3) The code in both reset() and setValue() will work properly
197         if this is true, which was the motivation for changing it.
198
199         * platform/FileChooser.h: Added a clear function.
200         * platform/FileChooser.cpp: (WebCore::FileChooser::clear): Clear the filename and the icon.
201
202         * rendering/RenderFileUploadControl.cpp:
203         (WebCore::RenderFileUploadControl::valueChanged): Used a local variable to make the code
204         a little bit more readable (and match the change below).
205         (WebCore::RenderFileUploadControl::updateFromElement): Used local variables a bit more in
206         the old code. Added code that will call clear on the FileChooser and repaint if the DOM
207         element has an empty value and the FileChooser does not.
208
209 2007-04-22  Grace Kloba  <klobag@gmail.com>
210
211         Reviewed by Hyatt.
212
213         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12279
214         Implemented two pass loading. Enabled by WTF_USE_LOW_BANDWIDTH_DISPLAY flag.
215
216         * dom/Document.cpp:
217         (WebCore::Document::Document): initialize member variable m_inLowBandwidthDisplay
218
219         * dom/Document.h:
220         (WebCore::Document::haveStylesheetsLoaded): while in low bandwidth display mode, ignore pending style sheets
221         (WebCore::Document::setDocLoader):
222         (WebCore::Document::inLowBandwidthDisplay):
223         (WebCore::Document::setLowBandwidthDisplay):
224         * html/HTMLTokenizer.cpp:
225         (WebCore::HTMLTokenizer::scriptHandler): while in low bandwidth display mode, don't execute JavaScript
226
227         * loader/Cache.cpp:
228         (WebCore::Cache::requestResource): while in low bandwidth display mode, don't let style sheet and JavaScript block
229
230         * loader/CachedCSSStyleSheet.cpp:
231         (WebCore::CachedCSSStyleSheet::checkNotify): add notifyFinished() as client may need "this" pointer
232
233         * loader/DocLoader.h:
234         (WebCore::DocLoader::replaceDocument):
235         * loader/FrameLoader.cpp:
236         (WebCore::FrameLoader::FrameLoader):
237         (WebCore::FrameLoader::requestFrame): while in low bandwidth display mode, don't load sub-frame
238         (WebCore::FrameLoader::stopLoading):
239         (WebCore::FrameLoader::begin): set to low bandwidth display mode if the top frame is HTML document
240         (WebCore::FrameLoader::write):
241         (WebCore::FrameLoader::endIfNotLoading):
242         (WebCore::FrameLoader::checkCompleted): while in low bandwidth display mode, don't set complete
243         (WebCore::FrameLoader::requestObject): while in low bandwidth display mode, don't care Object
244         (WebCore::FrameLoader::addLowBandwidthDisplayRequest):
245         (WebCore::FrameLoader::removeAllLowbandwidthDisplayRequests):
246         (WebCore::FrameLoader::notifyFinished):
247         (WebCore::FrameLoader::switchOutLowBandwidthDisplayIfReady):
248         * loader/FrameLoader.h:
249         (WebCore::FrameLoader::FrameLoader::needToSwitchOutLowBandwidthDisplay):
250         (WebCore::FrameLoader::FrameLoader::setUseLowBandwidthDisplay):
251         (WebCore::FrameLoader::FrameLoader::useLowBandwidthDisplay):
252
253 2007-04-22  Darin Adler  <darin@apple.com>
254
255         Reviewed by Tim Hatcher.
256
257         - fix http://bugs.webkit.org/show_bug.cgi?id=13439
258           4 problems found in dashboard-region parser and serializer
259
260         Test: fast/css/dashboard-region-parser.html
261
262         * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::cssText):
263         Fix code that overwrote each additional region with the previous one to
264         instead build a space-separated list. Check for the case of an identifier
265         that's invalid, since that's (accidentally) how we represent a region
266         value that doesn't have explicit top/right/bottom/left values. The old code
267         would end up writing out four spaces after the region type.
268
269         * css/cssparser.cpp: (WebCore::CSSParser::parseDashboardRegions):
270         Fail to parse if there is something after the "none" identifier or after
271         the arguments inside the dashboard-region "function". Also replaced code
272         that produced a identifier with CSS_VAL_INVALID in a roundabout way with
273         code that does it explicitly.
274
275 2007-04-22  Darin Adler  <darin@apple.com>
276
277         Reviewed by Adele.
278
279         - support for fix for <rdar://problem/5100240> REGRESSION: Control-O broken
280
281         * dom/KeyboardEvent.h: Include a vector of command names in the KeypressCommand object
282         instead of a single command name.
283
284 2007-04-22  Alexey Proskuryakov  <ap@webkit.org>
285
286         Reviewed by Darin.
287
288         http://bugs.webkit.org/show_bug.cgi?id=13115
289         REGRESSION: 1000% performance regression in DOM access by index, which was already slow
290
291         * dom/NodeList.h: Move cached data into a separate class, so it can be shared.
292
293         * dom/Node.h: Replace the set of registered NodeLists with a struct that also
294         contains a shared NodeList::Caches (so the size of Node doesn't change).
295
296         * dom/NodeList.cpp:
297         (WebCore::NodeList::NodeList):
298         (WebCore::NodeList::~NodeList):
299         (WebCore::NodeList::recursiveLength):
300         (WebCore::NodeList::itemForwardsFromCurrent):
301         (WebCore::NodeList::itemBackwardsFromCurrent):
302         (WebCore::NodeList::recursiveItem):
303         (WebCore::NodeList::itemWithName):
304         (WebCore::NodeList::rootNodeChildrenChanged):
305         (WebCore::NodeList::NodeListInfo::NodeListInfo):
306         (WebCore::NodeList::NodeListInfo::reset):
307         * dom/ChildNodeList.cpp:
308         (WebCore::ChildNodeList::ChildNodeList):
309         (WebCore::ChildNodeList::length):
310         (WebCore::ChildNodeList::item):
311         (WebCore::ChildNodeList::nodeMatches):
312         * dom/ChildNodeList.h:
313         * dom/Node.cpp:
314         (WebCore::Node::childNodes):
315         (WebCore::Node::registerNodeList):
316         (WebCore::Node::unregisterNodeList):
317         (WebCore::Node::notifyLocalNodeListsAttributeChanged):
318         (WebCore::Node::notifyLocalNodeListsChildrenChanged):
319         Adjust for the above changes.
320
321 2007-04-21  Mitz Pettel  <mitz@webkit.org>
322
323         Reviewed by Darin.
324
325         - fix http://bugs.webkit.org/show_bug.cgi?id=13391
326           REGRESSION (r18819): Incomplete repaint of button text
327
328         Test: fast/repaint/control-clip.html
329
330         Ignore controls' lightweight clip in repaint rect computation for now.
331
332         * rendering/RenderBox.cpp:
333         (WebCore::RenderBox::computeAbsoluteRepaintRect):
334
335 2007-04-21  Darin Adler  <darin@apple.com>
336
337         Reviewed by Adam.
338
339         - fix <rdar://problem/4816343> :-khtml-drag CSS pseudo-class changed to :-webkit-drag, need alias
340
341         * css/CSSSelector.cpp: (WebCore::CSSSelector::extractPseudoType):
342         Since Apple documentation claims "-khtml-drag" works, we need to keep it working,
343         so add it back as an alias.
344
345 2007-04-21  Darin Adler  <darin@apple.com>
346
347         Reviewed by Oliver.
348
349         - fix <rdar://problem/4782422> REGRESSION: -[stringByEvaluatingJavaScriptFromString]
350           returns an empty string instead of nil for non-string results
351
352         * page/mac/WebCoreFrameBridge.mm:
353         (-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
354         Added a call to nsStringNilIfEmpty to restore the old behavior. It might be nice to
355         distinguish the empty string from a non-string result, but there's no obvious way
356         to do that, and for compatibility it's probably best to just restore the old
357         behavior instead.
358
359 2007-04-21  David Hyatt  <hyatt@apple.com>
360
361         Fix for bug 13432, determineFlowSpacing is O(n^2).
362
363         Reviewed by aroben
364
365         * rendering/InlineBox.cpp:
366         (WebCore::InlineBox::nextOnLineExists):
367         (WebCore::InlineBox::prevOnLineExists):
368         * rendering/InlineBox.h:
369         (WebCore::InlineBox::InlineBox):
370
371 2007-04-21  Lamar Goddard <lamargoddard@gmail.com>
372
373         Reviewed by Darin.
374
375         Fix for http://bugs.webkit.org/show_bug.cgi?id=5262
376         <rdar://problem/5018778>
377         XMLSerializer drops Namespace information
378
379         Updated WebCore::markup to output namespace information for elements/attributes whose namespace information
380         doesn't appear in its scope in the output.
381
382         Added test case: fast/dom/serialize-nodes.xhtml
383
384         * WebCore/editing/markup.cpp:
385         (WebCore::createMarkup(const Node*, ...)): Changed call to WebCore::markup to match parameters
386         (WebCore::markup): Changed recursive call to match tree structure, removed ASSERT and no longer needed includeSiblings parameter.
387         (WebCore::startMarkup): Added optional parameter to track namespaces in the current scope.
388         (WebCore::addNamespace): Function to add namespace information to markup.
389         (WebCore::shouldAddNamespaceAttr):
390         (WebCore::shouldAddNamespaceElem): Functions that test whether namespace information should be added for a given node.
391         * WebCore/dom/Document.idl:
392         (createElementNS):
393         (createAttributeNS):
394         (getElementsByTagNameNS): Added [ConvertNullToNullString] to namespaceURI parameter.
395         * WebCore/dom/Node.cpp:
396         (Node::getElementsByTagNameNS): removed test for namespaceURI being null as null can be a valid namespace.
397
398 2007-04-21  Alexey Proskuryakov  <ap@webkit.org>
399
400         Reviewed by Darin.
401
402         http://bugs.webkit.org/show_bug.cgi?id=13300
403         Reproducible crash opening anekdot.ru
404
405         * html/HTMLParser.cpp:
406         (WebCore::HTMLParser::HTMLParser):
407         (WebCore::HTMLParser::getNode):
408         (WebCore::HTMLParser::handleIsindex):
409         * html/HTMLParser.h:
410         Made HTMLParser::form a RefPtr, and renamed it to m_currentFormElement.
411         Made m_currentMapElement a RefPtr.
412
413 2007-04-21  Mitz Pettel  <mitz@webkit.org>
414
415         Reviewed by Darin.
416
417         - fix http://bugs.webkit.org/show_bug.cgi?id=13353
418           REGRESSION (r20754-20766): Textarea does not resize when scrollbar is present
419
420         Test: fast/overflow/hit-test-overflow-controls.html
421
422         * page/EventHandler.cpp:
423         (WebCore::EventHandler::handleMouseMoveEvent): Avoid activating scrollbars
424         during layer resize.
425         * rendering/RenderBlock.cpp:
426         (WebCore::RenderBlock::isPointInOverflowControl): Renamed isPointInScrollbar
427         to this, to reflect that it returns true for points in the resize corner
428         as well. Changed it to call the layer to do the actual work.
429         (WebCore::RenderBlock::nodeAtPoint): Updated for the above rename.
430         * rendering/RenderBlock.h:
431         * rendering/RenderLayer.cpp:
432         (WebCore::RenderLayer::horizontalScrollbarWidget): Fixed typo in this function's
433         name (it was horizontaScrollbarWidget).
434         (WebCore::RenderLayer::hitTestOverflowControls): Added. Returns whether the
435         hit point is in one of the scrollbars or the resize corner, and updates the
436         platform scrollbar in the hit test result if a scrollbar was hit.
437         * rendering/RenderLayer.h:
438         * rendering/RenderListBox.cpp:
439         (WebCore::RenderListBox::isPointInOverflowControl): Rename.
440         * rendering/RenderListBox.h:
441
442 2007-04-21  Mitz Pettel  <mitz@webkit.org>
443
444         Reviewed by Darin.
445
446         - fix http://bugs.webkit.org/show_bug.cgi?id=13417
447           Repro crash when the first argument to getMatchedCSSRules is not an element
448
449         Test: fast/dom/Window/getMatchedCSSRules-null-crash.html
450
451         * css/cssstyleselector.cpp:
452         (WebCore::CSSStyleSelector::styleRulesForElement): Added null check.
453
454 2007-04-21  Mitz Pettel  <mitz@webkit.org>
455
456         Reviewed by Darin.
457
458         - fix http://bugs.webkit.org/show_bug.cgi?id=13416
459           Repro crash after referencing the user stylesheet from JavaScript
460
461         No test included because DumpRenderTree does not support setting the user stylesheet.
462
463         * css/cssstyleselector.cpp:
464         (WebCore::CSSStyleSelector::CSSStyleSelector):
465         (WebCore::CSSStyleSelector::~CSSStyleSelector):
466         * css/cssstyleselector.h: Made m_userSheet a RefPtr.
467
468 2007-04-21  MorganL  <morganl.webkit@yahoo.com>
469
470         Reviewed by Adam.
471
472         NPObject should be forward declared using 'struct' instead of 'class'
473
474         * page/Frame.h:
475
476 2007-04-21  Alp Toker  <alp@atoker.com>
477
478         Gdk build fix.
479
480         * platform/gdk/FontPlatformDataGdk.cpp:
481         (WebCore::FontPlatformData::FontPlatformData): Use the correct casts.
482
483 2007-04-20  Brady Eidson  <beidson@apple.com>
484
485         Reviewed by Oliver (Black Sheep)
486
487         <rdar://problem/3559794>
488         [WebView setMaintainsBackForwardList:] doesn't actually flush out the current page caches
489
490         * WebCore.exp:
491         * history/BackForwardList.cpp:
492         (WebCore::BackForwardList::BackForwardList): Set the flag to true by default
493         (WebCore::BackForwardList::addItem): Check the flag and bail if its false
494         (WebCore::BackForwardList::setCapacity): More correct if it set the m_current to 
495           NoCurrentItemIndex if we're setting capacity to 0
496         (WebCore::BackForwardList::enabled): 
497         (WebCore::BackForwardList::setEnabled): If we're disabling, cycle capacity to 0 and 
498           back to flush things out
499         * history/BackForwardList.h: Add enabled(), setEnabled(bool), and m_enabled
500
501 2007-04-20  David Hyatt  <hyatt@apple.com>
502
503         Bug 13424, firstLineStyle and verticalPositionHint together take
504         33% of the time on the new tag nesting PLT.  Don't waste time even
505         looking for first-line styles if no stylesheet used them.
506
507         Reviewed by beth
508
509         * css/CSSGrammar.y:
510         * dom/Document.cpp:
511         (WebCore::Document::Document):
512         * dom/Document.h:
513         (WebCore::Document::usesFirstLineRules):
514         (WebCore::Document::setUsesFirstLineRules):
515         * rendering/RenderObject.cpp:
516         (WebCore::RenderObject::verticalPositionHint):
517         (WebCore::RenderObject::firstLineStyle):
518
519 2007-04-20  Peter Kasting  <pkasting@google.com>
520
521         Reviewed by Oliver.
522
523         - fix http://bugs.webkit.org/show_bug.cgi?id=13420
524
525         * platform/TextEncodingRegistry.cpp:
526         (WebCore::addToTextEncodingNameMap): Change a pointer comparison to a
527         strcmp(), since the strings here are not necessarily
528         pointer-equivalent.
529
530 2007-04-20  Darin Adler  <darin@apple.com>
531
532         Reviewed by Geoff Garen and John Sullivan.
533
534         - fix <rdar://problem/4671964> document property on <iframe> elements causes problems for SAP application
535
536         Test: fast/dom/iframe-document.html
537
538         * bindings/js/kjs_html.h: Removed IFrameDocument.
539         * bindings/js/kjs_html.cpp: (KJS::JSHTMLElement::iFrameGetter): Ditto.
540
541 2007-04-19  Alp Toker  <alp@atoker.com>
542
543         Reviewed by Mark.
544
545         * platform/gdk/FontGdk.cpp:
546         (WebCore::Font::drawGlyphs):
547         * platform/gdk/FontPlatformDataGdk.cpp:
548         (WebCore::FontPlatformData::FontPlatformData): Fix font support in Gdk port.
549
550 2007-04-19  David Hyatt  <hyatt@apple.com>
551
552         Fix for bug 13208, implement word-break.  This patch produces a partial
553         implementation of word-break.  word-break: break-all is implemented.  In
554         addition, a custom value, word-break: break-word is added that is a hybrid
555         of word-wrap: break-word and word-break: break-all (and more useful than
556         either).
557
558         Reviewed by beth
559
560         Added fast/text/word-break.html
561
562         * css/CSSComputedStyleDeclaration.cpp:
563         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
564         * css/CSSPropertyNames.in:
565         * css/CSSValueKeywords.in:
566         * css/cssparser.cpp:
567         (WebCore::CSSParser::parseValue):
568         * css/cssstyleselector.cpp:
569         (WebCore::CSSStyleSelector::applyProperty):
570         * rendering/RenderStyle.cpp:
571         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
572         (WebCore::StyleRareInheritedData::operator==):
573         (WebCore::RenderStyle::diff):
574         * rendering/RenderStyle.h:
575         (WebCore::):
576         (WebCore::RenderStyle::breakWords):
577         (WebCore::RenderStyle::wordBreak):
578         (WebCore::RenderStyle::setWordBreak):
579         (WebCore::RenderStyle::initialWordBreak):
580         (WebCore::RenderStyle::initialWordWrap):
581         * rendering/RenderText.cpp:
582         (WebCore::RenderText::calcMinMaxWidthInternal):
583         * rendering/RenderTextControl.cpp:
584         (WebCore::RenderTextControl::createInnerTextStyle):
585         (WebCore::RenderTextControl::calcHeight):
586         * rendering/bidi.cpp:
587         (WebCore::RenderBlock::findNextLineBreak):
588
589 2007-04-20  Mark Rowe  <mrowe@apple.com>
590
591         Qt build fix for FreeBSD.
592
593         * WebCore.pro: FreeBSD needs HAVE_PTHREAD_NP_H defined.
594
595 2007-04-19  Mitz Pettel  <mitz@webkit.org>
596
597         Reviewed by Darin.
598
599         - fix http://bugs.webkit.org/show_bug.cgi?id=13403
600           REGRESSION (r18875-r18899): Can no longer type into search form field after searching and then clicking "back"
601
602         The problem was that the page was loaded from the page cache with a subtree
603         marked for layout and the layout timer stopped (having been stopped when the
604         page entered the page cache). FrameView::needsLayout() was returning false
605         which prevented the pending layout from completing.
606
607         * page/FrameView.cpp:
608         (WebCore::FrameView::clear): Removed the call to stop the layout timer, since
609         reset() does that already.
610         (WebCore::FrameView::needsLayout): Changed to return true if there's a subtree
611         pending relayout.
612
613 2007-04-19  Justin Garcia  <justin.garcia@apple.com>
614
615         Reviewed by harrison
616         
617         <rdar://problem/5144139> 
618         On delete, <BR> inserted into non-editable ToDo <TABLE> element
619         
620         The fact that the br was being inserted at a bad position 
621         (a non-editable position and one inside a table instead of 
622         before it) was fixed in the previous checkin. This change 
623         stops us from inserting a br at all, to fix the bug.
624         
625         After a delete, we need a placeholder if the selection
626         started at the start of a paragraph and ended at the end 
627         of a paragraph. But not if it starts just before a table 
628         and ends inside that table.  We need placeholders to hold 
629         open emptied out table cells, but that is handled separately.
630         
631         Also, moved lineBreakExistsAtPosition to htmlediting.cpp 
632         so that it can be used in more places.
633
634         * editing/CompositeEditCommand.cpp:
635         (WebCore::CompositeEditCommand::removePlaceholderAt):
636         (WebCore::CompositeEditCommand::moveParagraphs):
637         * editing/DeleteSelectionCommand.cpp:
638         (WebCore::DeleteSelectionCommand::doApply):
639         * editing/InsertLineBreakCommand.cpp:
640         * editing/InsertParagraphSeparatorCommand.cpp:
641         (WebCore::InsertParagraphSeparatorCommand::doApply):
642         * editing/htmlediting.cpp:
643         (WebCore::lineBreakExistsAtPosition):
644         * editing/htmlediting.h:
645
646 2007-04-19  Justin Garcia  <justin.garcia@apple.com>
647
648         Reviewed by harrison
649         
650         Fixes some issues found while investigating:
651         <rdar://problem/5144139> On delete, <BR> inserted into non-editable ToDo <TABLE> element
652         
653         Move the code to handle inserting content before/after
654         tables for [table, 0/max] to insertNodeAt, so that
655         all insertions get it, not just some.
656         Changed insertNodeAt to take in a position instead of a
657         node and an offset.
658
659         * editing/CompositeEditCommand.cpp:
660         (WebCore::CompositeEditCommand::insertNodeAt):
661         (WebCore::CompositeEditCommand::insertNodeAtTabSpanPosition):
662         (WebCore::CompositeEditCommand::insertBlockPlaceholder):
663         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
664         If paragrahStart.node() is an atomic node, insertNodeAt can handle
665         insertion, we don't need to special case it.
666         (WebCore::CompositeEditCommand::moveParagraphs):
667         (WebCore::CompositeEditCommand::positionAvoidingSpecialElementBoundary):
668         * editing/CompositeEditCommand.h:
669         * editing/DeleteSelectionCommand.cpp:
670         (WebCore::DeleteSelectionCommand::mergeParagraphs):
671         (WebCore::DeleteSelectionCommand::doApply):
672         * editing/FormatBlockCommand.cpp:
673         (WebCore::FormatBlockCommand::doApply):
674         * editing/IndentOutdentCommand.cpp:
675         (WebCore::IndentOutdentCommand::indentRegion):
676         (WebCore::IndentOutdentCommand::outdentParagraph):
677         * editing/InsertLineBreakCommand.cpp:
678         (WebCore::InsertLineBreakCommand::doApply):
679         * editing/InsertListCommand.cpp:
680         (WebCore::InsertListCommand::doApply):
681         * editing/InsertParagraphSeparatorCommand.cpp:
682         (WebCore::InsertParagraphSeparatorCommand::doApply):
683         * editing/InsertTextCommand.cpp:
684         (WebCore::InsertTextCommand::prepareForTextInsertion): Removed some
685         dead code that handled insertion at non-editable positions.
686         (WebCore::InsertTextCommand::insertTab):
687         * editing/ReplaceSelectionCommand.cpp:
688         (WebCore::ReplaceSelectionCommand::doApply):
689         (WebCore::ReplaceSelectionCommand::insertNodeAtAndUpdateNodesInserted):
690         * editing/ReplaceSelectionCommand.h:
691
692 2007-04-19  Mitz Pettel  <mitz@webkit.org>
693
694         Reviewed by Darin.
695
696         - fix http://bugs.webkit.org/show_bug.cgi?id=13336
697           REGRESSION (r20646): editing/execCommand/hilitecolor.html crashes under guardMalloc
698
699         Avoid calling selectionRect() and selectionGapRects() on a renderer that needs
700         layout.
701
702         * rendering/RenderBlock.cpp:
703         (WebCore::RenderBlock::selectionGapRects):
704         * rendering/RenderBlock.h:
705         (WebCore::RenderBlock::BlockSelectionInfo::BlockSelectionInfo):
706         * rendering/RenderListMarker.cpp:
707         (WebCore::RenderListMarker::selectionRect):
708         * rendering/RenderObject.h:
709         (WebCore::RenderObject::SelectionInfo::SelectionInfo):
710         * rendering/RenderReplaced.cpp:
711         (WebCore::RenderReplaced::selectionRect):
712         * rendering/RenderText.cpp:
713         (WebCore::RenderText::selectionRect):
714
715 2007-04-19  Justin Garcia  <justin.garcia@apple.com>
716
717         Reviewed by darin
718
719         <rdar://problem/5142012> 
720         GoogleDocs: Crash at WebCore::Range::startPosition() when creating a list from a link
721         
722         List creation uses moveParagraphs to push content into list items.
723         Its fragment creation (using createMarkup) incorrectly uses regular
724         spaces instead of nbsps for spaces that were rendered (11475), which 
725         causes spaces to be collapsed during the move operation.  This results 
726         in a call to rangeFromLocationAndLength with a location past the end
727         of the document.  We use the result from rangeFromLocationAndLength
728         (null) and crash.
729         
730         Also when moveParagraphs tries to push content into a list item surrounded
731         by an anchor, it fails because positionAvoidingSpecialElementBoundary avoids 
732         the anchor, which also avoids the list item.  This was fixed by pushing
733         down anchors before avoiding them.
734         
735         * editing/CompositeEditCommand.cpp:
736         (WebCore::CompositeEditCommand::pushAnchorElementDown): Remove the
737         old anchor after we push down clones of it, this is what callers
738         expect.
739         (WebCore::CompositeEditCommand::pushPartiallySelectedAnchorElementsDown):
740         Call the new enclosingAnchorElement, that takes in a position instead
741         of a node.
742         (WebCore::CompositeEditCommand::moveParagraphs): If spaces collapsed
743         as a result of the move, rangeFromLocationAndLength can return null,
744         bail and don't try to preserve the selection in that case.
745         (WebCore::CompositeEditCommand::positionAvoidingSpecialElementBoundary):
746         Moved from htmlediting.cpp.
747         Make sure anchors are pushed down before avoiding them so that we don't
748         also avoid structural elements like lists and blocks.
749         * editing/CompositeEditCommand.h:
750         * editing/TypingCommand.cpp: Moved isFirst/LastPositionBefore/AfterTable
751         to htmlediting.cpp.
752         * editing/htmlediting.cpp:
753         Moved positionAvoidingSpecialElementBoundary so that it could call
754         pushAnchorElementDown.
755         (WebCore::isFirstPositionAfterTable): Moved here.
756         (WebCore::isLastPositionBeforeTable): Moved here.
757         (WebCore::enclosingAnchorElement): Moved here.
758         (WebCore::enclosingListChild): Removed an extraneous space.
759         * editing/htmlediting.h:
760
761 2007-04-19  Beth Dakin  <bdakin@apple.com>
762
763         Reviewed by Hyatt.
764
765         Fix for <rdar://problem/5120889> Sized table cells w/borders not 
766         drawn to correct size
767
768         When table cells have children with %-height, the cells were 
769         incorrectly shrinking down to be the size of the child. This 
770         exposed another problem with replaced children and sizing.
771
772         * rendering/RenderBox.cpp:
773         (WebCore::RenderBox::calcReplacedHeightUsing): The exposed problem. 
774         Subtract our borders and padding in the auto or percent table cell 
775         containing block case.
776         * rendering/RenderTableSection.cpp:
777         (WebCore::RenderTableSection::layoutRows): When our children can 
778         flex, do not always set the cellTopExtra and cellBottomExtra to 0! 
779         That is bad! We should do the same as the non-flex case.
780
781 2007-04-19  Anders Carlsson  <andersca@apple.com>
782
783         Reviewed by Geoff.
784
785         http://bugs.webkit.org/show_bug.cgi?id=13333
786         Support naturalWidth/naturalHeight on image elements
787
788         * html/HTMLImageElement.cpp:
789         (WebCore::HTMLImageElement::naturalWidth):
790         (WebCore::HTMLImageElement::naturalHeight):
791         * html/HTMLImageElement.h:
792         * html/HTMLImageElement.idl:
793
794 2007-04-19  Patti Hoa  <patti@apple.com>
795
796         Reviewed by Darin.
797         - review suggestion for rdar://5145011 code change
798         
799         * bridge/mac/WebCoreAXObject.mm:
800         (-[WebCoreAXObject value]):
801         return early if value attribute is not supported by the attachment view.
802
803 2007-04-19  Patti Hoa  <patti@apple.com>
804
805         Reviewed by Darin.
806
807         <rdar://problem/5145011> Allow attachment view of web object to handle accessibility actions
808         
809         * bridge/mac/WebCoreAXObject.mm:
810         (-[WebCoreAXObject value]):
811         Only allow asking the attachmentView for value if attachmentView supports this value attribute 
812         (-[WebCoreAXObject title]):
813         (-[WebCoreAXObject accessibilityAttributeNames]):
814         Should not return that long list of unrelated attributes for attachmentView.
815         (-[WebCoreAXObject accessibilityActionNames]):
816         (-[WebCoreAXObject accessibilityPerformAction:]):
817         Allow attachmentView a chance to handle actions.
818         (-[WebCoreAXObject accessibilityParameterizedAttributeNames]):
819         Should not return that long list of unrelated attributes for attachmentView.
820         
821 2007-04-19  Mitz Pettel  <mitz@webkit.org>
822
823         Reviewed by Hyatt.
824
825         - fix http://bugs.webkit.org/show_bug.cgi?id=13291
826           REGRESSION (r19595): WebViewDidBeginEditingNotification not posted when focusing with the mouse
827
828         Covered by editing tests.
829
830         * dom/Document.cpp:
831         (WebCore::Document::setFocusedNode): Moved the call to Editor::didBeginEditing()
832         back into here.
833         * dom/Element.cpp:
834         (WebCore::Element::updateFocusAppearance): Removed the call to didBeginEditing().
835         * html/HTMLInputElement.cpp:
836         (WebCore::HTMLInputElement::updateFocusAppearance): Ditto.
837
838 2007-04-19  Sam Weinig  <sam@webkit.org>
839
840         Reviewed by Darin.
841
842         - Patch for http://bugs.webkit.org/show_bug.cgi?id=12249
843           FCKeditor: <hr>, <ul> and <ol> have id="undefined"
844
845         Convert undefined and null to a null string for third argument of
846         execCommand(); 
847
848         Test: editing/execCommand/arguments-combinations.html
849
850         * WebCore.xcodeproj/project.pbxproj:
851         * bindings/js/kjs_binding.cpp:
852         (KJS::valueToStringWithUndefinedOrNullCheck):
853         * bindings/js/kjs_binding.h:
854         * bindings/scripts/CodeGeneratorJS.pm:
855         * dom/Document.idl:
856
857 2007-04-19  Alp Toker  <alp@atoker.com>
858
859         Reviewed by hyatt.
860
861         * WebCoreSources.bkl: Remove obsolete source file from build.
862
863 2007-04-18  Alp Toker  <alp@atoker.com>
864
865         Gdk build fix.  Reviewed by Sam Weinig.
866
867         Track changes to make GdkLauncher work again.
868
869         * WebCoreSources.bkl:
870         * platform/gdk/ChromeClientGdk.h:
871         * platform/gdk/TemporaryLinkStubs.cpp:
872         (ChromeClientGdk::createWindow):
873         (ChromeClientGdk::createModalDialog):
874         (Editor::markBadGrammar):
875
876 2007-04-17  Brady Eidson  <beidson@apple.com>
877
878         Reviewed by Tim
879
880         <rdar://problem/5008925>
881         Expose the NSURLConnection delegate willCacheResponse API to WebResourceLoadDelegate
882
883         * WebCore.xcodeproj/project.pbxproj: Added ResourceLoaderMac.mm
884
885         * loader/FrameLoaderClient.h: Add the willCacheResponse SPI for WebKit to implement
886
887         * loader/ResourceLoader.h:
888         * loader/mac/ResourceLoaderMac.mm: Added.
889         (WebCore::ResourceLoader::willCacheResponse): Return the new cachedResponse from the client
890
891         * platform/graphics/svg/SVGImageEmptyClients.h:
892         (WebCore::SVGEmptyFrameLoaderClient::willCacheResponse): Stub
893
894         * platform/network/ResourceHandleClient.h:
895         (WebCore::ResourceHandleClient::willCacheResponse):  Return the new cachedResponse from the client
896
897         * platform/network/mac/ResourceHandleMac.mm:
898         (-[WebCoreResourceHandleAsDelegate connection:willCacheResponse:]): Call to get the new 
899           cachedURLResponse before calling for the cache policy
900
901 2007-04-18  Darin Adler  <darin@apple.com>
902
903         Reviewed by Hyatt.
904
905         - fix http://bugs.webkit.org/show_bug.cgi?id=13375
906           REGRESSION (r20901): failing fast/overflow/scrollRevealButton.html
907
908         * dom/Document.cpp: (WebCore::Document::updateLayout):
909         If we have a parent frame, update its layout too.
910
911 2007-04-18  Alp Toker  <alp@atoker.com>
912
913         Gdk build fix.  Reviewed by Mark.
914
915         * loader/gdk/FrameLoaderClientGdk.cpp:
916         (WebCore::FrameLoaderClientGdk::loadedFromCachedPage):
917         (WebCore::FrameLoaderClientGdk::setDocumentViewFromCachedPage):
918         (WebCore::FrameLoaderClientGdk::saveDocumentViewToCachedPage):
919         * loader/gdk/FrameLoaderClientGdk.h:
920         * platform/gdk/TemporaryLinkStubs.cpp:
921         (CachedPage::close): Track PageCache to CachedPage refactoring.
922
923 2007-04-17  Mitz Pettel  <mitz@webkit.org>
924
925         Reviewed by Darin.
926
927         - fix http://bugs.webkit.org/show_bug.cgi?id=13369
928           REGRESSION (r13366): Invisible table cell background is painted
929
930         Test: fast/table/invisible-cell-background.html
931
932         * rendering/RenderTableCell.cpp:
933         (WebCore::RenderTableCell::paintBackgroundsBehindCell): Don't paint any
934         background if the cell is not visible. This behavior matches WinIE and Opera.
935
936 2007-04-17  Justin Garcia  <justin.garcia@apple.com>
937
938         Reviewed by harrison
939
940         <rdar://problem/5119244> 
941         Crash when indenting a selected ToDo
942         
943         indentRegion() was using the old (incorrect) editable root 
944         getter, which returned null for a valid, editable position, 
945         causing the crash.
946
947         * editing/IndentOutdentCommand.cpp:
948         (WebCore::IndentOutdentCommand::indentRegion):
949         The editable root for a position is editableRootForPosition(p),
950         not p.node()->rootEditableElement(), because of VisiblePositions 
951         before/after tables, replaced elements and others.
952
953 2007-04-17  Justin Garcia  <justin.garcia@apple.com>
954
955         Reviewed by hyatt
956
957         <rdar://problem/5138441> 
958         GoogleDocs: Indented text looks like text that's been Quoted
959         
960         GoogleDocs uses FormatBlock, blockquotes and a style rule
961         for blockquotes to implement a "Quote Text" feature.  Styles
962         intended only for those blockquotes were added to the 
963         blockquotes that we use for indenting.
964
965         * css/html4.css: Removed the webkit-indent-blockquote class rule.
966         * editing/IndentOutdentCommand.cpp:
967         (WebCore::createIndentBlockquoteElement): Use custom margins
968         and turn off border and padding to override author rules for
969         blockquotes.
970
971 2007-04-17  Justin Garcia  <justin.garcia@apple.com>
972
973         Reviewed by darin
974
975         <rdar://problem/5136770> 
976         Gmail Editor: Hang when turning a particular multi-line selection into a list
977         
978         When InsertListCommand pushes content into list items, 
979         it creates an empty list item and then calls moveParagraphs.  
980         But moveParagraphs' selection preservation code fails when 
981         it encounters empty list items (list items w/o placeholders).
982         This causes InsertListCommand to lose track of where it has 
983         already been performed, which causes the hang.
984
985         * editing/InsertListCommand.cpp:
986         (WebCore::InsertListCommand::doApply): Use brs to hold open 
987         empty list items.
988
989 2007-04-17  Darin Adler  <darin@apple.com>
990
991         Oops, rolled that last change out. I'll redo it again later after making
992         som additional refinments.
993
994 2007-04-17  Darin Adler  <darin@apple.com>
995
996         Reviewed by Brady.
997
998         - a few baby steps to try to make lockHistory and userGesture less confusing
999
1000         * page/FrameLoadRequest.h:
1001         (WebCore::FrameLoadRequest::FrameLoadRequest): Add initialization of m_isUserGesture
1002         to true.
1003         (WebCore::FrameLoadRequest::shouldLockHistory): Renamed from lockHistory to avoid having
1004         a getter that sounds like a verb phrase.
1005         (WebCore::FrameLoadRequest::setShouldLockHistory): Ditto.
1006         (WebCore::FrameLoadRequest::isUserGesture): Added.
1007         (WebCore::FrameLoadRequest::setIsUserGesture): Ditto.
1008
1009         * loader/FrameLoader.h: Remove userGesture parameter from load that takes
1010         FrameLoadRequest. Remove default values for lockHistory and userGesture parameters,
1011         since that just makes it more likely we'll forget to pass them in. Remove one of
1012         the overloads of urlSelected, since it's only called one place.
1013
1014         * loader/FrameLoader.cpp:
1015         (WebCore::FrameLoader::createWindow): Remove userGesture parameter, relying on
1016         the true default in FrameLoadRequest.
1017         (WebCore::FrameLoader::urlSelected): Call setShouldLockHistory and setIsUserGesture
1018         on the FrameLoadRequest, and call load directly; also eliminate the other urlSelected
1019         overload since this was the only place it was called.
1020         (WebCore::FrameLoader::load): Remove userGesture parameter, relying on the true
1021         default in FrameLoadRequest. In the other overload, clean up logic to eliminate the
1022         argsReferrer variable and get rid of the userGesture parameter, using the value from
1023         FrameLoadRequest.
1024         (WebCore::FrameLoader::submitForm): Remove userGesture parameter, relying on the value
1025         in the FrameLoadRequest. This actually changes behavior.
1026
1027         * bindings/js/kjs_html.cpp: (KJS::JSHTMLDocument::putValueProperty): Pass
1028         false for userGesture explicitly instead of relying on default argument.
1029
1030         * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected):
1031         Remove userGesture parameter, relying on the true default in FrameLoadRequest.
1032
1033 2007-04-16  David Kilzer  <ddkilzer@webkit.org>
1034
1035         Reviewed by NOBODY (fixed misspelling).
1036
1037         * manual-tests/containing-block-position-chage.html: Removed.
1038         * manual-tests/containing-block-position-change.html: Added.
1039
1040 2007-04-16  Justin Garcia  <justin.garcia@apple.com>
1041
1042         Reviewed by darin
1043
1044         <rdar://problem/5134759> 
1045         GMail Editor: Hang after pasting underlined text multiple times
1046         
1047         The moveParagraphs call that ReplaceSelectionCommand
1048         performs must receive only inline content from createMarkup, 
1049         or else it will result in another call to moveParagraphs 
1050         when it performs the move, resulting in infinite recursion.
1051
1052         * editing/markup.cpp:
1053         (WebCore::startMarkup): We were only converting a block to
1054         an inline if it had an inline style declaration or styles 
1055         coming from matched rules.  Cleaned up this code a bit by 
1056         handling an element's style separately from its other 
1057         attributes.
1058
1059 2007-04-16  Darin Adler  <darin@apple.com>
1060
1061         - get layout tests going again
1062
1063         * page/mac/FrameMac.mm: (WebCore::Frame::setUseSecureKeyboardEntry):
1064         Replace assertion with a runtime check. We can consider changing it back to
1065         an assertion some day, but it's not important.
1066
1067 2007-04-16  Darin Adler  <darin@apple.com>
1068
1069         Reviewed by John Sullivan.
1070
1071         - fix http://bugs.webkit.org/show_bug.cgi?id=13303
1072           <rdar://problem/5126341> REGRESSION: controls in a background Safari window
1073           maintain active appearance if the address bar has focus (13303)
1074
1075         - fix a related problem where elements could look focused in non-active windows
1076
1077         - simplify secure keyboard entry logic in Frame::setIsActive
1078
1079         * WebCore.exp: Add two new symbols for use by WebKit.
1080
1081         * html/HTMLInputElement.cpp:
1082         (WebCore::HTMLInputElement::dispatchFocusEvent): Call setUseSecureKeyboardEntryWhenActive
1083         rather than calling setSecureKeyboardEntry directly -- does nothing if the frame is not active.
1084         (WebCore::HTMLInputElement::dispatchBlurEvent): Ditto.
1085
1086         * page/Frame.cpp:
1087         (WebCore::Frame::setUseSecureKeyboardEntryWhenActive): Added. Calls
1088         setUseSecureKeyboardEntry only if the frame is active, but also stores away the state,
1089         so that the setIsActive function doesn't have to recompute it.
1090         (WebCore::Frame::setIsActive): Rewrote all the comments in the function. Removed the code
1091         to manage control tints, which are not based on the whether the frame is active but rather
1092         on AppKit's concept of whether the window should have "key appearance". Simplified the
1093         logic about when to call setUseSecureKeyboardEntry by using the value of
1094         m_useSecureKeyboardEntryWhenActive.
1095         (WebCore::FramePrivate::FramePrivate): Initialize m_useSecureKeyboardEntryWhenActive.
1096         * page/Frame.h: Made setSecureKeyboardEntry private and renamed it to
1097         setUseSecureKeyboardEntry, removed isSecureKeyboardEntry, and
1098         added a public setUseSecureKeyboardEntryWhenActive.
1099         * page/FramePrivate.h: Added m_useSecureKeyboardEntryWhenActive.
1100         * page/mac/FrameMac.mm: (WebCore::Frame::setUseSecureKeyboardEntry): Added an assertion,
1101         and removed isSecureKeyboardEntry().
1102
1103         * page/FrameView.h: Added updateControlTints.
1104         * page/FrameView.cpp: (WebCore::FrameView::updateControlTints): Added. Code was moved
1105         here from setIsActive for two reasons: (1) it makes more sense in the view class, and
1106         (2) it needs to be called at the appropriate time for AppKit, not when active changes.
1107
1108         * rendering/RenderTheme.cpp: (WebCore::RenderTheme::isFocused): Added an isActive
1109         check here to match the logic in the implementation of the CSS pseudo-state.
1110         * rendering/RenderThemeMac.mm:
1111         (WebCore::RenderThemeMac::updateFocusedState): Use the isFocused function instead of
1112         repeating the logic here. Removed the "need to add a key window test here" comment.
1113         (WebCore::RenderThemeMac::controlSupportsTints): Added a comment about the NSCell
1114         SPI that's related to the _windowChangedKeyState method we now use in WebHTMLView.
1115
1116 2007-04-16  Darin Adler  <darin@apple.com>
1117
1118         Reviewed by John Sullivan.
1119
1120         - fix http://bugs.webkit.org/show_bug.cgi?id=13227
1121           StringImpl::isLower incorrectly assumes islower returns 1 (it can return any non-0)
1122
1123         * platform/StringImpl.cpp:
1124         (WebCore::StringImpl::isLower): Based on test application results, changed to use &&
1125         instead of trying to use & to avoid branches. Use U16_NEXT so we can handle characters
1126         outside the BMP. Improved comments.
1127         (WebCore::StringImpl::lower): Improved comments.
1128         (WebCore::equalIgnoringCase): Changed to use && instead of trying to use & to avoid
1129         branches. Improved comments. Added an assertion about the assumption we're
1130         making that characters in the char* are all ASCII.
1131
1132 2007-04-13  David Kilzer  <ddkilzer@webkit.org>
1133
1134         Patch and review by hyatt.  Testing and landing by ddkilzer.
1135
1136         <rdar://problem/5078866>
1137         tables don't inherit text-align (in strict mode; they're not supposed to in quirks mode)
1138
1139         Test: fast/css/table-text-align-quirk.html
1140               fast/css/table-text-align-strict.html
1141
1142         Previous commit (r20731) removed the wrong property from WebCore/css/html4.css.  However,
1143         when the correct property was removed, it caused tables to inherit alignment properties
1144         from tags like <center> and <div align="center">.  This is fixed in
1145         WebCore::CSSStyleSelector::adjustRenderStyle() by special-casing tables to reset the
1146         text-align property.
1147
1148         * css/CSSComputedStyleDeclaration.cpp:
1149         (WebCore::valueForTextAlign): Renamed KHTML_CENTER, KHTML_LEFT and KHTML_RIGHT to
1150         WEBKIT_CENTER, WEBKIT_LEFT and WEBKIT_RIGHT.
1151         * css/cssparser.cpp:
1152         (WebCore::CSSParser::parseValue): Ditto.
1153         * css/cssstyleselector.cpp:
1154         (WebCore::CSSStyleSelector::adjustRenderStyle): Tables should not support -webkit-center,
1155         -webkit-left or -webkit-right values for text-align, so reset them back to auto.
1156         * css/html4.css: Removed "text-align: -webkit-auto;" property from tables selector.  It
1157         was previously added to css/quirks.css in r20731.
1158         * rendering/RenderBlock.cpp:
1159         (WebCore::RenderBlock::determineHorizontalPosition): Renamed KHTML_* to WEBKIT_*.
1160         * rendering/RenderBox.cpp:
1161         (WebCore::RenderBox::calcHorizontalMargins): Ditto.
1162         * rendering/RenderFlow.cpp:
1163         (WebCore::RenderFlow::caretRect): Ditto.
1164         * rendering/RenderStyle.h: Ditto.
1165         (WebCore::):
1166         * rendering/bidi.cpp:
1167         (WebCore::RenderBlock::computeHorizontalPositionsForLine): Ditto.
1168
1169 2007-04-12  Brady Eidson  <beidson@apple.com>
1170
1171         Reviewed by Black Sheep
1172
1173         <rdar://problem/4664154> and http://bugs.webkit.org/show_bug.cgi?id=3546
1174
1175         When you click on a link that opens in a new window from within gmail, they first create a new window 
1176         with an empty URL, then immediately document.write() into the window to schedule a redirect.
1177
1178         Since the initial page doesn't have a URL associated with it, a history item never gets created.  The 
1179         reasonable solution?  To actually create the history item after the redirect (in updateHistoryForInternalLoad)
1180
1181         * loader/FrameLoader.cpp:
1182         (WebCore::FrameLoader::addHistoryForCurrentLocation): Updates global and B/F history with a new history item
1183         (WebCore::FrameLoader::updateHistoryForStandardLoad): Call addHistoryForCurrentLocation
1184         (WebCore::FrameLoader::updateHistoryForInternalLoad): Call addHistoryForCurrentLocation if there is not already
1185           a current history item
1186         * loader/FrameLoader.h:
1187
1188 2007-04-12  Oliver Hunt  <oliver@apple.com>
1189
1190         Reviewed by Adam.
1191
1192         This fixes <rdar://problem/5060766> -- Frameset with 
1193         an empty frame crashes due to null document.  Debug
1194         builds hit the frame->document() assertion in 
1195         EventHandler::prepareMouseEvent
1196
1197         This null check seems necessary now, having run through 
1198         all the logic on the path to this crash it appears that
1199         we can't avoid this null check.  
1200
1201         * page/EventHandler.cpp:
1202         (WebCore::EventHandler::updateDragAndDrop):
1203
1204 2007-04-12  Justin Garcia  <justin.garcia@apple.com>
1205
1206         Reviewed by darin
1207         
1208         <rdar://problem/5131716> 
1209         Clicking just before a ToDo doesn't put the caret before the ToDo
1210         
1211         * rendering/RenderBlock.cpp:
1212         (WebCore::RenderBlock::positionForCoordinates):
1213         Consider clicks inside the blocks padding, instead of
1214         incorrectly sending them to the position before the block.
1215
1216 2007-04-12  John Sullivan  <sullivan@apple.com>
1217
1218         Reviewed by Anders
1219
1220         - WebCore part of fix for:
1221         <rdar://problem/5128697> REGRESSION: At least one PDF context menu item isn't appearing on Leopard
1222
1223         * platform/ContextMenuItem.h:
1224         (WebCore::):
1225         add two PDF-related context menu items to enum to keep it in sync with WebKit
1226
1227         * platform/ContextMenu.cpp:
1228         (WebCore::ContextMenu::checkOrEnableIfNeeded):
1229         add the new context menu items to the do-nothing case of a big switch statement
1230
1231 2007-04-12  Simon Hausmann  <hausmann@kde.org>
1232
1233         Reviewed by Zack.
1234
1235         Fixed drawing of justified text in the Qt port.
1236
1237         * platform/qt/FontQt.cpp:
1238         (Font::drawGlyphs):
1239
1240 2007-04-11  Oliver Hunt  <oliver@apple.com>
1241
1242         Reviewed by Maciej.
1243
1244         Adding RetainPtr to the many global obj-c pointers we use in
1245         C/C++ methods.  This is necessary to prevent GC from collecting
1246         globals we want to keep around.
1247
1248         We use RetainPtr in obj-c++ and c++ files, and CFRetain/Release in pure
1249         obj-c.
1250
1251         Also made the Pasteboard::m_pasteboard a RetainPtr although it
1252         shouldn't be necessary as the only NSPasteboard instances that 
1253         should ever be inserted are the system clipboard and dragging 
1254         pasteboard.  Neither of which should ever be collected.
1255
1256         * page/mac/WebCoreFrameBridge.mm:
1257         (_getPreSmartSet):
1258         (_getPostSmartSet):
1259         * platform/Pasteboard.h:
1260         * platform/graphics/mac/ColorMac.mm:
1261         (WebCore::nsColor):
1262         * platform/graphics/mac/GraphicsContextMac.mm:
1263         (WebCore::GraphicsContext::drawLineForMisspellingOrBadGrammar):
1264         * platform/mac/FontDataMac.mm:
1265         (WebCore::webFallbackFontFamily):
1266         * platform/mac/PasteboardMac.mm:
1267         (WebCore::writableTypesForURL):
1268         (WebCore::writableTypesForImage):
1269         (WebCore::Pasteboard::clear):
1270         (WebCore::Pasteboard::writeSelection):
1271         (WebCore::Pasteboard::writeURL):
1272         (WebCore::Pasteboard::writeFileWrapperAsRTFDAttachment):
1273         (WebCore::Pasteboard::writeImage):
1274         (WebCore::Pasteboard::canSmartReplace):
1275         (WebCore::Pasteboard::plainText):
1276         (WebCore::Pasteboard::documentFragment):
1277
1278 2007-04-11  Mitz Pettel  <mitz@webkit.org>
1279
1280         Reviewed by Dave Hyatt.
1281
1282         - fix http://bugs.webkit.org/show_bug.cgi?id=11362
1283           Native popup with size="1" wraps options
1284
1285         Test: fast/forms/menulist-option-wrap.html
1286
1287         * css/html4.css: Added white-space declaration for select[size="0"] and
1288         select[size="1"]. Added border-radius declaration for select.
1289
1290 2007-04-11  MorganL  <morganl.webkit@yahoo.com>
1291
1292         Reviewed by Maciej.
1293
1294         Add a Frame pointer to ChromeClient methods:
1295         http://bugs.webkit.org/show_bug.cgi?id=13127
1296
1297         * loader/FrameLoader.cpp:
1298         (WebCore::FrameLoader::createWindow):
1299         * page/Chrome.cpp:
1300         (WebCore::Chrome::createWindow):
1301         (WebCore::Chrome::createModalDialog):
1302         * page/Chrome.h:
1303         * page/ChromeClient.h:
1304         * page/ContextMenuController.cpp:
1305         (WebCore::openNewWindow):
1306         * platform/graphics/svg/SVGImageEmptyClients.h:
1307         (WebCore::SVGEmptyChromeClient::createWindow):
1308         (WebCore::SVGEmptyChromeClient::createModalDialog):
1309
1310 2007-04-11  Brady Eidson  <beidson@apple.com>
1311
1312         Reviewed by Ada
1313
1314         <rdar://problem/5080987> - Crash in DocumentLoader::frameLoader() const
1315
1316         This was free nil checking lost during the ObjC -> C++ conversion
1317
1318         * loader/FrameLoader.cpp:
1319         (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Null check the DocumentLoader
1320
1321 2007-04-11  Justin Garcia  <justin.garcia@apple.com>
1322
1323         Reviewed by harrison
1324
1325         <rdar://problem/5126166> 
1326         Deleting selection starting at before ToDo checkbox to end of line, inserts a BR in the subsequent ToDo
1327         
1328         If a selection ends in a table cell, we shouldn't perform
1329         a merge after deleting that selection.  We have code in
1330         place to prevent those merges, but it failed here.
1331         
1332         It fails because the end of the selection was [tableCell, 0],
1333         (normally not a valid VisiblePosition, but valid here
1334         because the table cell is empty).  We prevent the merge
1335         if the node of the position at the end of the selection 
1336         has an enclosingTableCell.  Even though [tableCell, 0] has 
1337         an enclosing table cell, the node tableCell doesn't, so 
1338         the check fails.
1339         
1340         Fixed this by changing enclosingTableCell to take in
1341         a position, instead of a node.  The other enclosing element
1342         getters should be changed in this way as well.
1343
1344         * editing/DeleteSelectionCommand.cpp:
1345         (WebCore::DeleteSelectionCommand::initializePositionData):
1346         Call the new enclosingTableCell.
1347         * editing/ReplaceSelectionCommand.cpp:
1348         (WebCore::ReplaceSelectionCommand::shouldMerge): Ditto.
1349         * editing/htmlediting.cpp:
1350         (WebCore::enclosingTableCell): Take in a position instead
1351         of a node.
1352         * editing/htmlediting.h:
1353
1354 2007-04-12  Mark Rowe  <mrowe@apple.com>
1355
1356         Qt build fix.
1357
1358         * WebCore.pro:
1359         * editing/qt/EditorQt.cpp:
1360         (WebCore::Editor::markBadGrammar):
1361         * history/qt/CachedPageQt.cpp: Added.
1362         (WebCore::CachedPage::close):
1363         * history/qt/PageCacheQt.cpp: Removed.
1364
1365 2007-04-11  Brady Eidson  <beidson@apple.com>
1366
1367         Reviewed by Antti
1368
1369         <rdar://problem/5125648> and http://bugs.webkit.org/show_bug.cgi?id=13326
1370
1371         Crash opening a link in a new window from Gmail
1372
1373         Problem here is that the currentHistoryItem in the new window is null.  This *shouldn't* be the case, 
1374         and is the cause of a very long standing bug - 
1375         http://bugs.webkit.org/show_bug.cgi?id=3546 - Can't go back to first page in new window opened from gmail
1376
1377         For now, adding a null check prevents this crash and restores the original, long standing regression
1378  
1379         * loader/FrameLoader.cpp:
1380         (WebCore::FrameLoader::updateHistoryForInternalLoad): NULL check
1381
1382 2007-04-11  Adam Roben  <aroben@apple.com>
1383
1384         Reviewed by Anders.
1385
1386         Made image document copying more cross-platform.
1387
1388         All layout tests pass.
1389
1390         * editing/Editor.cpp:
1391         (WebCore::imageNodeFromImageDocument): Added.
1392         (WebCore::Editor::canCopy): Called imageNodeFromImageDocument.
1393         (WebCore::Editor::copy): Ditto.
1394         (WebCore::Editor::copyImage): Updated for changes to Pasteboard.
1395         * platform/Pasteboard.h: Made writeImage more general, which allowed
1396         getting rid of its second incarnation.
1397         * platform/gdk/TemporaryLinkStubs.cpp:
1398         * platform/mac/PasteboardMac.mm:
1399         (WebCore::Pasteboard::writeImage): Collapsed logic from the two
1400         writeImage methods into one.
1401         (Pasteboard::writeImage): Updated for Pasteboard changes.
1402         * platform/qt/PasteboardQt.cpp:
1403         (WebCore::Pasteboard::writeImage): Ditto.
1404
1405 2007-04-11  Darin Adler  <darin@apple.com>
1406
1407         * css/CSSValueKeywords.in: Fix a comment.
1408
1409 2007-04-09  Justin Garcia  <justin.garcia@apple.com>
1410
1411         Reviewed by harrison
1412         
1413         <rdar://problem/4932260> 
1414         Invalid attributed string for attachment range obtained via AXPreviousWordStartTextMarkerForTextMarker
1415         
1416         By default, text iterators don't emit anything for replaced 
1417         elements.  Boundary finding code works around this but has 
1418         bugs: replaced elements act as sentence boundaries and the 
1419         above bug, where previousBoundary moves past the start of a 
1420         word if there is a replaced element just before it. This 
1421         patch fixes these issues by treating replaced elements as 
1422         punctuation for boundary finding.
1423
1424         * editing/TextIterator.cpp:
1425         (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
1426         Set m_pastStartNode, the node after (in a reverse pre-order traversal) the 
1427         last one that should be processed.
1428         (WebCore::SimplifiedBackwardsTextIterator::advance):
1429         Stop at m_pastStartNode.
1430         Iterate over nodes in reverse pre-order (TextIterator traverses in 
1431         pre-orer). This makes knowing when to emit characters after nodes vs. when
1432         to emit characters before nodes easier.
1433         Remove the special case for entering a new block, emitting characters 
1434         after nodes can now be handled generally, in handleNonTextNode(), because
1435         of the way we traverse.
1436         Set m_handledChildren to false every iteration since we now do traverse in 
1437         reverse pre-order.
1438         (WebCore::SimplifiedBackwardsTextIterator::handleReplacedElement):
1439         Emit a comma for replaced elements.  We only use this kind of iterator 
1440         for finding boundaries, so we can do this unconditionally.
1441         (WebCore::SimplifiedBackwardsTextIterator::handleNonTextNode):
1442         Don't use emitNewline, instead specify where the newline should be positioned.
1443         A node is handled before its children, so characters emitted here should 
1444         be positioned after the node, not before it.
1445         (WebCore::SimplifiedBackwardsTextIterator::exitNode): 
1446         Don't use emitNewline, instead specify where the newline should be positioned.
1447         (WebCore::CharacterIterator::CharacterIterator): 
1448         Create a TextIterator that emits content for replaced elements, if requested.
1449         * editing/TextIterator.h:
1450         * editing/visible_units.cpp:
1451         (WebCore::previousBoundary): 
1452         Removed replaced element handling code.
1453         If the start of the chunk that contained the boundary was in a non-text
1454         node, then the boundary is not necessarily in that node.  Particularly
1455         because it is only the end of the chunk that is guaranteed to be a valid
1456         position in those cases.  We must iterate backwards by character from 
1457         the end of the chunk to find the boundary.
1458         (WebCore::nextBoundary): Removed replaced element handling code.
1459
1460 2007-04-10  Brady Eidson  <beidson@apple.com>
1461
1462         Reviewed by Darin
1463
1464         <rdar://problem/4887095> - PageCache and PageState should be combined
1465
1466         These two objects are a relic of when the PageCache was split between WebCore and WebKit
1467         It just makes good sense to combine them now, and the new object is more appropriately
1468         called "CachedPage"
1469
1470         This patch is vast in scope, but simple in depth - anywhere a PageCache or PageState object 
1471         was used has been adjusted to use a CachedPage object instead.  The most notable change is
1472         that HistoryItem - which always used to have a PageCache object which may or may not have 
1473         had a PageState - now may or may not have a CachedPage.  This actually simplifies the 
1474         HistoryItem code a bit while making the role of CachedPage much more clear.
1475
1476         * WebCore.exp:
1477         * WebCore.xcodeproj/project.pbxproj:
1478
1479         * history/BackForwardList.cpp:
1480         (WebCore::BackForwardList::addItem):
1481         (WebCore::BackForwardList::setCapacity):
1482         (WebCore::BackForwardList::setPageCacheSize):
1483         (WebCore::BackForwardList::clearPageCache):
1484         (WebCore::BackForwardList::close):
1485
1486         * history/PageCache.cpp: Removed.
1487         * history/PageCache.h: Removed.
1488         * page/PageState.cpp: Removed.
1489         * page/PageState.h: Removed.
1490         * history/CachedPage.cpp: Added.
1491         (WebCore::CachedPage::create):
1492         (WebCore::CachedPage::CachedPage):
1493         (WebCore::CachedPage::~CachedPage):
1494         (WebCore::CachedPage::restore):
1495         (WebCore::CachedPage::clear):
1496         (WebCore::CachedPage::setDocumentLoader):
1497         (WebCore::CachedPage::documentLoader):
1498         (WebCore::CachedPage::setTimeStamp):
1499         (WebCore::CachedPage::setTimeStampToNow):
1500         (WebCore::CachedPage::timeStamp):
1501         * history/CachedPage.h: Added.
1502         (WebCore::CachedPage::document):
1503         (WebCore::CachedPage::mousePressNode):
1504         (WebCore::CachedPage::URL):
1505
1506         * history/HistoryItem.cpp:
1507         (WebCore::HistoryItem::HistoryItem):
1508         (WebCore::HistoryItem::setCachedPage):
1509         (WebCore::HistoryItem::setURL):
1510         (WebCore::HistoryItem::alwaysAttemptToUseCachedPage):
1511         (WebCore::HistoryItem::setAlwaysAttemptToUseCachedPage):
1512         (WebCore::HistoryItem::cachedPage):
1513         (WebCore::cachedPagesPendingRelease):
1514         (WebCore::HistoryItem::releaseCachedPagesOrReschedule):
1515         (WebCore::HistoryItem::releaseAllPendingCachedPages):
1516         (WebCore::HistoryItem::scheduleCachedPageForRelease):
1517         * history/HistoryItem.h:
1518         * history/mac/HistoryItemMac.mm:
1519
1520         * history/HistoryItemTimer.cpp:
1521         (WebCore::HistoryItemTimer::HistoryItemTimer):
1522         (WebCore::HistoryItemTimer::callReleaseCachedPagesOrReschedule):
1523         * history/HistoryItemTimer.h:
1524
1525         * history/mac/PageCacheMac.mm: Removed.
1526         * history/mac/CachedPageMac.mm: Added.
1527         (WebCore::CachedPage::close):
1528         (WebCore::CachedPage::setDocumentView):
1529         (WebCore::CachedPage::documentView):
1530
1531         * loader/DocumentLoader.cpp:
1532         (WebCore::DocumentLoader::DocumentLoader):
1533         (WebCore::DocumentLoader::loadFromCachedPage):
1534         (WebCore::DocumentLoader::setLoadingFromCachedPage):
1535         (WebCore::DocumentLoader::isLoadingFromCachedPage):
1536         * loader/DocumentLoader.h:
1537
1538         * loader/FrameLoader.cpp:
1539         (WebCore::FrameLoader::provisionalLoadStarted):
1540         (WebCore::FrameLoader::commitProvisionalLoad):
1541         (WebCore::FrameLoader::transitionToCommitted):
1542         (WebCore::FrameLoader::open):
1543         (WebCore::FrameLoader::startLoading):
1544         (WebCore::FrameLoader::receivedMainResourceError):
1545         (WebCore::FrameLoader::opened):
1546         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
1547         (WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
1548         (WebCore::FrameLoader::cachePageToHistoryItem):
1549         (WebCore::FrameLoader::createHistoryItem):
1550         (WebCore::FrameLoader::purgePageCache):
1551         (WebCore::FrameLoader::invalidateCurrentItemCachedPage):
1552         (WebCore::FrameLoader::loadItem):
1553         (WebCore::FrameLoader::updateHistoryForStandardLoad):
1554         (WebCore::FrameLoader::updateHistoryForClientRedirect):
1555         (WebCore::FrameLoader::updateHistoryForBackForwardNavigation):
1556         (WebCore::FrameLoader::updateHistoryForReload):
1557         (WebCore::FrameLoader::updateHistoryForInternalLoad):
1558         (WebCore::FrameLoader::updateHistoryForCommit):
1559         * loader/FrameLoader.h:
1560         * loader/FrameLoaderClient.h:
1561
1562         * page/mac/WebCoreFrameBridge.h: Got rid of unused WebCorePageCacheStateKey
1563         * page/mac/WebCoreFrameBridge.mm: Ditto
1564
1565         * platform/graphics/svg/SVGImage.cpp:
1566         * platform/graphics/svg/SVGImageEmptyClients.h: Update to reflect the new names
1567         (WebCore::SVGEmptyFrameLoaderClient::loadProvisionalItemFromCachedPage):
1568         (WebCore::SVGEmptyFrameLoaderClient::invalidateCurrentItemCachedPage):
1569         (WebCore::SVGEmptyFrameLoaderClient::loadedFromCachedPage):
1570         (WebCore::SVGEmptyFrameLoaderClient::clearLoadingFromCachedPage):
1571         (WebCore::SVGEmptyFrameLoaderClient::isLoadingFromCachedPage):
1572         (WebCore::SVGEmptyFrameLoaderClient::setDocumentViewFromCachedPage):
1573         (WebCore::SVGEmptyFrameLoaderClient::saveDocumentViewToCachedPage):
1574
1575 2007-04-10  Antti Koivisto  <antti@apple.com>
1576
1577         Reviewed by Hyatt.
1578
1579         Fix <rdar://5057686> 
1580         Flex box layout example hangs in WebCore::RenderFlexibleBox::allowedChildFlex
1581         
1582         Forcibly distribute remaining pixels if the algorithm is not advancing.
1583
1584         * rendering/RenderFlexibleBox.cpp:
1585         (WebCore::RenderFlexibleBox::layoutHorizontalBox):
1586         (WebCore::RenderFlexibleBox::layoutVerticalBox):
1587
1588 2007-04-11  Mark Rowe  <mrowe@apple.com>
1589
1590         Build fix.
1591
1592         * bridge/mac/WebCoreAXObject.mm:
1593         (-[WebCoreAXObject accessibilityDescription]):
1594
1595 2007-04-10  Patti Hoa <patti@apple.com>
1596
1597         Reviewed by Justin Garcia.
1598
1599         <rdar://problem/5122276> Allow focused frame to fire off notification
1600         Improve accessibility support for Mail WebView embedded Notes.
1601
1602         * bridge/mac/AXObjectCacheMac.mm:
1603         (WebCore::AXObjectCache::postNotification):
1604         The focused document with the selection change should fire the selection changed notification, not the top level document
1605         * bridge/mac/WebCoreAXObject.mm:
1606         (-[WebCoreAXObject accessibilityDescription]):
1607         Allow the name attribute of the html body to be used as the accessibility description
1608
1609 2007-04-09  Geoffrey Garen  <ggaren@apple.com>
1610
1611         Reviewed by Maciej Stachowiak.
1612         
1613         Support for fixing fast/forms/textarea-paste-newline.html.
1614         
1615         Changed clients to use new preference specifying whether a Page should 
1616         allow pasting through the DOM API, instead of a global flag.
1617
1618         Removed old behavior of always allowing DOM paste in debug builds. In 
1619         light of the new preference-based API, that behavior makes no sense anymore. 
1620         Instead, developers who want to test paste inside Safari can set the 
1621         preference for themselves.
1622
1623         * WebCore.exp:
1624         * editing/CommandByName.cpp: Removed crazy hack to keep an identically 
1625         named but invalid copy of the global "pate allowed" flag in this file.
1626         (WebCore::Frame::enabledPaste):
1627         * editing/JSEditor.cpp: Removed "always allow" behavior for debug builds.
1628         (WebCore::JSEditor::queryCommandSupported):
1629         * editing/JSEditor.h:
1630         * page/Settings.cpp:
1631         (WebCore::Settings::setDOMPasteAllowed):
1632         * page/Settings.h:
1633         (WebCore::Settings::isDOMPasteAllowed):
1634         * rendering/RenderTreeAsText.cpp:
1635         (WebCore::externalRepresentation): Removed crazy hack to allow DOM paste
1636         after this function has been called.
1637
1638 2007-04-10  John Sullivan  <sullivan@apple.com>
1639
1640         Reviewed by Tim Hatcher
1641
1642         - fixed <rdar://problem/4859132> Grammar must always be checked in entire-sentence chunks, 
1643           and shouldn't show markers for current sentence
1644
1645         * editing/Editor.h:
1646         add markBadGrammar, now distinct from markMisspellings
1647
1648         * editing/mac/EditorMac.mm:
1649         (WebCore::Editor::markMisspellingsAfterTypingToPosition):
1650         call markMisspellings on one word, and markBadGrammar on entire sentence
1651         (WebCore::markMisspellingsOrBadGrammar):
1652         new static function, extracted from markMisspellings
1653         (WebCore::Editor::markMisspellings):
1654         now calls extracted function
1655         (WebCore::Editor::markBadGrammar):
1656         new method, calls extracted function
1657
1658         * page/Frame.cpp:
1659         (WebCore::Frame::respondToChangedSelection):
1660         update grammar markers for entire new and old sentences
1661
1662 2007-04-09  Anders Carlsson  <andersca@apple.com>
1663
1664         Reviewed by John.
1665
1666         * WebCore.exp:
1667         Add __ZNK7WebCore11FrameLoader10isCompleteEv.
1668         
1669 2007-04-09  Brady Eidson  <beidson@apple.com>
1670
1671         Reviewed by Darin
1672
1673         Fixes <rdar://4921797> and http://bugs.webkit.org/show_bug.cgi?id=12005
1674
1675         The original regression was to claim that more loads were the result of a "user gesture" than really
1676         were.  A lot of the ways a frame load could be kicked off didn't properly set up this flag, and it 
1677         wasn't properly propagated and respected where it should've been.
1678
1679         This patch cleans much of that up.  One loose end is the "treatAsUserGesture" flag which is a stop
1680         gap measure to keep "slow redirects" working to create a new history item.  In the future, we need
1681         to cleanup the meaning and use of "userGesture" and "lockHistory."  This includes integrating them 
1682         in to FrameLoadRequest and being very clear of what their meaning actually is at different stages of
1683         the Frame load process.
1684
1685         * dom/Document.cpp:
1686         (WebCore::Document::processHttpEquiv): Pass only the delay for the redirect
1687
1688         * html/HTMLAnchorElement.cpp:
1689         (WebCore::HTMLAnchorElement::defaultEventHandler): Pass "lockHistory" false, "userGesture" true
1690
1691         * ksvg2/svg/SVGAElement.cpp:
1692         (WebCore::SVGAElement::defaultEventHandler): Pass "lockHistory" false, "userGesture" true
1693
1694         * loader/FrameLoader.cpp:
1695         (WebCore::ScheduledRedirection::ScheduledRedirection): Figure "lockHistory" and "userGesture" from the 
1696           delay here, instead of at 3 other different sites that call this method
1697         (WebCore::FrameLoader::changeLocation): Set userGesture correctly
1698         (WebCore::FrameLoader::urlSelected): Propagate userGesture down
1699         (WebCore::FrameLoader::requestFrame): 
1700         (WebCore::FrameLoader::receivedFirstData):
1701         (WebCore::FrameLoader::scheduleRedirection): Pass only the delay here
1702         (WebCore::FrameLoader::redirectionTimerFired): Set userGesture correctly
1703         (WebCore::FrameLoader::load):
1704         (WebCore::FrameLoader::updateHistoryForInternalLoad): Insteading of asserting we aren't a redirect,
1705           handle the case where we *are* a redirect by updating the previous history item
1706         * loader/FrameLoader.h:
1707
1708 2007-04-09  Anders Carlsson  <andersca@apple.com>
1709
1710         Reviewed by Darin.
1711
1712         <rdar://problem/5120801> 
1713         http://bugs.webkit.org/show_bug.cgi?id=13247
1714         Closing a page during slow cloning causes crash in setJSStatusBarText (13247)
1715
1716         * bindings/js/kjs_window.cpp:
1717         (KJS::Window::put):
1718         Return early if m_frame is null. A closed window only has one property, "closed" 
1719         so no properties should be settable in that case.
1720
1721 2007-04-09  Andrew Wellington  <proton@wiretapped.net>
1722
1723         Reviewed by Justin Garcia.
1724         
1725         Fix for http://bugs.webkit.org/show_bug.cgi?id=12959
1726         "REGRESSION: Edit -> Copy not enabled on standalone images"
1727
1728         * dom/Document.h: Add support for determining if a document is an image
1729         (WebCore::Document::isImageDocument):
1730         * editing/Editor.cpp:
1731         (WebCore::Editor::canCopy): Image documents are copyable
1732         (WebCore::Editor::copy): If copying an image document, call appropriate pasteboard methods
1733         * loader/ImageDocument.h:
1734         (WebCore::ImageDocument::isImageDocument): Override to return true for image documents
1735         * platform/Pasteboard.h: Add new writeImage function to pasteboard
1736         * platform/mac/PasteboardMac.mm:
1737         (WebCore::Pasteboard::writeImage): Add writeImage implementation that takes Node and URL
1738         * platform/qt/PasteboardQt.cpp:
1739         (WebCore::Pasteboard::writeImage): Stub for Qt implementation of pasteboard
1740
1741 2007-04-08  Oliver Hunt  <oliver@apple.com>
1742
1743         rs=Adam.
1744
1745         Add ASSERT(selectedRange) to previous change
1746
1747         * platform/mac/PasteboardMac.mm:
1748         (WebCore::Pasteboard::writeSelection):
1749
1750 2007-04-08  Oliver Hunt  <oliver@apple.com>
1751
1752         rs=Adam.
1753
1754         Fix minor error when writing selection to pasteboard.
1755         This shouldn't have an effect as selectedRange should be the
1756         selected range from source frame, however this is safer.
1757
1758         * platform/mac/PasteboardMac.mm:
1759         (WebCore::Pasteboard::writeSelection):
1760
1761 2007-04-08  David Hyatt  <hyatt@apple.com>
1762
1763         Fix mouseover/out failing layout tests.
1764
1765         Reviewed by aroben
1766
1767         * page/EventHandler.cpp:
1768         (WebCore::EventHandler::handleMouseMoveEvent):
1769         (WebCore::EventHandler::updateMouseEventTargetNode):
1770         (WebCore::EventHandler::dispatchMouseEvent):
1771         * page/EventHandler.h:
1772
1773 2007-04-08  Oliver Hunt  <oliver@apple.com>
1774
1775         Reviewed by Adam.
1776
1777         Fix for <rdar://problem/5113621> REGRESSION: Dragging PDF as image does not give any feedback
1778
1779         If we fail when attempting to create a drag image for a dragged
1780         image, we fall back to the appropriate icon.
1781
1782         * page/DragController.cpp:
1783         (WebCore::DragController::doImageDrag):
1784
1785 2007-04-08  Adam Roben  <aroben@apple.com>
1786
1787         Reviewed by Oliver.
1788
1789         Bestowed the gift of -webkit-dashboard-region upon all platforms, since
1790         there's nothing Mac-specific about it other than the name. This also
1791         allowed me to get rid of FrameViewMac.mm.
1792
1793         Removed a lot of #if PLATFORM(MAC):
1794
1795         * css/CSSComputedStyleDeclaration.cpp:
1796         (WebCore::):
1797         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
1798         * css/CSSPrimitiveValue.cpp:
1799         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1800         (WebCore::CSSPrimitiveValue::cleanup):
1801         (WebCore::CSSPrimitiveValue::cssText):
1802         * css/CSSPrimitiveValue.h:
1803         (WebCore::CSSPrimitiveValue::getDashboardRegionValue):
1804         (WebCore::CSSPrimitiveValue::):
1805         * css/cssparser.cpp:
1806         (WebCore::CSSParser::parseValue):
1807         (WebCore::CSSParser::parseDashboardRegions):
1808         * css/cssparser.h:
1809         * css/cssstyleselector.cpp:
1810         (WebCore::CSSStyleSelector::applyProperty):
1811         * dom/Document.cpp:
1812         (WebCore::Document::Document):
1813         * dom/Document.h:
1814         * page/Frame.cpp:
1815         (WebCore::Frame::paint):
1816         * page/Frame.h:
1817         * page/FrameView.cpp:
1818         (WebCore::FrameView::layout):
1819         (WebCore::FrameView::updateDashboardRegions): Moved from FrameViewMac.mm.
1820         * page/FrameView.h:
1821         * page/qt/FrameQt.cpp:
1822         (WebCore::Frame::dashboardRegionsChanged): Stubbed out.
1823         * platform/gdk/FrameGdk.cpp:
1824         (WebCore::Frame::dashboardRegionsChanged): Ditto.
1825         * rendering/RenderLayer.cpp:
1826         (WebCore::RenderLayer::scrollToOffset):
1827         (WebCore::RenderLayer::setHasHorizontalScrollbar):
1828         (WebCore::RenderLayer::setHasVerticalScrollbar):
1829         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
1830         * rendering/RenderObject.cpp:
1831         (WebCore::RenderObject::setStyle):
1832
1833         * WebCore.xcodeproj/project.pbxproj: Removed FrameViewMac.mm.
1834         * bridge/mac/FrameViewMac.mm: Removed.
1835
1836 2007-04-08  Mark Rowe  <mrowe@apple.com>
1837
1838         Qt build fix.
1839
1840         * platform/qt/TemporaryLinkStubs.cpp:
1841
1842 2007-04-06  Geoffrey Garen  <ggaren@apple.com>
1843
1844         Reviewed by Beth Dakin.
1845         
1846         Fixed one more case of <rdar://problem/5112273> REGRESSION(TOT): 
1847         Reproducible crash loading an old version of amazon.com as a web archive
1848
1849         * bindings/js/JSXMLHttpRequest.cpp:
1850         (KJS::JSXMLHttpRequestPrototypeFunction::callAsFunction):
1851
1852 2007-04-06  Oliver Hunt  <oliver@apple.com>
1853
1854         Reviewed by Adam.
1855
1856         Fix MouseEvent so it's possible to distinguish between
1857         a MouseMouseEvent with NoButton down, and a move with
1858         LeftButton down.  It would be nice if the DOM allowed 
1859         for NoButton to exist, but it doesn't so this is necessary.
1860
1861         * dom/EventTargetNode.cpp:
1862         (WebCore::EventTargetNode::dispatchMouseEvent):
1863         * dom/MouseEvent.cpp:
1864         (WebCore::MouseEvent::MouseEvent):
1865         (WebCore::MouseEvent::initMouseEvent):
1866         * dom/MouseEvent.h:
1867         (WebCore::MouseEvent::noButton):
1868
1869 2007-04-06  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
1870
1871         Not reviewed - gdk build fix.
1872
1873         * platform/gdk/MouseEventGdk.cpp:
1874
1875 2007-04-06  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
1876
1877         Reviewed by darin.
1878
1879         Coverity fix. Coverity says:
1880         "Event var_deref_op: Variable "info_ptr" tracked as NULL was dereferenced."
1881
1882         * platform/image-decoders/png/pngrutil.c:
1883         (png_handle_gAMA):
1884
1885 2007-04-06  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
1886
1887         Reviewed by darin.
1888
1889         Coverity fix. Coverity says:
1890         "Event var_deref_model: Variable "(this)->clientptr" tracked as NULL was passed to a function that dereferences it."
1891
1892         * platform/image-decoders/gif/GIFImageReader.cpp:
1893         (GIFImageReader::read):
1894
1895 2007-04-06  David Hyatt  <hyatt@apple.com>
1896
1897         Fix more of the layout test failures caused by fixing the slider layout test failure (sigh).  clear()
1898         needs to null out the capturingMouseEventsNode in the case where a mousedown or move while captured
1899         causes a navigation to another page.
1900
1901         * page/EventHandler.cpp:
1902         (WebCore::EventHandler::clear):
1903         (WebCore::EventHandler::handleMouseReleaseEvent):
1904
1905 2007-04-06  David Hyatt  <hyatt@apple.com>
1906
1907         Fix failing slider layout test.  Don't clear the subframe capture unless we really were capturing on a
1908         subframe.
1909
1910         Reviewed by adele, darin
1911
1912         * page/EventHandler.cpp:
1913         (WebCore::EventHandler::handleMouseReleaseEvent):
1914
1915 2007-04-06  Beth Dakin  <bdakin@apple.com>
1916
1917         Reviewed by Geoff and Darin.
1918
1919         Fix for <rdar://problem/4875433> WebView underlines are too thick 
1920         when scaled small
1921
1922         When we have a small scale factor, we should follow the line-
1923         drawing code as if we were printing. Meaning, specifically, that we 
1924         should not round to device pixels and we should antialias.
1925
1926         * platform/graphics/cg/GraphicsContextCG.cpp:
1927         (WebCore::GraphicsContext::drawLineForText):
1928
1929 2007-04-06  Geoffrey Garen  <ggaren@apple.com>
1930
1931         Reviewed by Beth Dakin.
1932         
1933         Fixed <rdar://problem/5112273> REGRESSION(TOT): Reproducible crash loading 
1934         an old version of amazon.com as a web archive
1935         
1936         The problem was JavaScript executing inside a frame with a NULL document.
1937         It's probably a bug that the document was NULL, but we don't want a minor
1938         bug to be a crasher, and we don't want the DOM to depend on the implementation
1939         details of the JS bindings, so I added NULL checks.
1940
1941         * bindings/js/kjs_window.cpp: Call FrameLoader::completeURL instead of
1942         Document::completeURL, since FrameLoader::completeURL is safe against a
1943         NULL document.
1944         (KJS::Window::put):
1945         (KJS::WindowFunc::callAsFunction):
1946         (KJS::Location::put):
1947         (KJS::LocationFunc::callAsFunction):
1948
1949 2007-04-06  David Hyatt  <hyatt@apple.com>
1950
1951         Fix for bug 13274.  Rework mouse events so that subframe capturing works again.  Make sure
1952         everything just comes down through the top FrameView even when capturing is in effect.  Update
1953         scrollbar handling logic so that scrollbars receive events correctly while capturing is in
1954         effect.  Eliminate the notion of widget capture.  Fix mouse moves so that they only fire
1955         on the innermost hit frame.
1956
1957         Reviewed by olliej
1958
1959         * page/EventHandler.cpp:
1960         (WebCore::EventHandler::handleMouseDraggedEvent):
1961         (WebCore::subframeForTargetNode):
1962         (WebCore::EventHandler::handleMousePressEvent):
1963         (WebCore::EventHandler::handleMouseMoveEvent):
1964         (WebCore::EventHandler::handleMouseReleaseEvent):
1965         * page/EventHandler.h:
1966         * platform/PopupMenu.h:
1967         (WebCore::PopupMenu::scrollbarCapturingMouse):
1968         (WebCore::PopupMenu::setScrollbarCapturingMouse):
1969         * platform/ScrollBar.h:
1970         (WebCore::Scrollbar::handleMouseReleaseEvent):
1971         * platform/Widget.h:
1972         (WebCore::Widget::geometryChanged):
1973
1974 2007-04-06  Justin Garcia  <justin.garcia@apple.com>
1975
1976         Reviewed by john
1977
1978         <rdar://problem/5115601> 
1979         REGRESSION: Crash deleting a selection that starts in an editable table cell
1980         
1981         The selection starts at the start of an editable 
1982         root that's embedded in a non-editable ToDo (table).  
1983         Removing the selection removes all editable 
1984         VisiblePositions from the root.  Then, the creation 
1985         of mergeDestination fails, and using it causes a crash.
1986
1987         * editing/DeleteSelectionCommand.cpp:
1988         (WebCore::DeleteSelectionCommand::mergeParagraphs):
1989         Nil-check mergeDestination to avoid crashing and
1990         also insert a break in that case at m_upstreamStart, 
1991         so that we can create a valid mergeDestination and
1992         perform the merge.
1993         
1994         
1995 2007-04-06  Mitz Pettel  <mitz@webkit.org>
1996
1997         Reviewed by Oliver.
1998
1999         Eliminate PlatformMouseEvent::currentEvent.
2000
2001         No test possible (no change to functionality).
2002
2003         * page/EventHandler.cpp:
2004         (WebCore::EventHandler::handleDrag):
2005         * platform/PlatformMouseEvent.h:
2006         * platform/gdk/TemporaryLinkStubs.cpp:
2007         * platform/mac/PlatformMouseEventMac.mm:
2008         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
2009         * platform/qt/PlatformMouseEventQt.cpp:
2010         * platform/win/TemporaryLinkStubs.cpp:
2011
2012 2007-04-05  Oliver Hunt  <oliver@apple.com>
2013
2014         Reviewed by Maciej.
2015
2016         Fix for rdar://problem/4849948 -- JSCanvasRenderingContext2D::drawImage
2017         crashes when given invalid arguments.
2018
2019         JSCanvasRenderingContext2D frequently casts from JSValue* to JSObject*
2020         and then checks isObject *after* the cast.  JSObject::isObject is unsafe 
2021         if applied to a JSImmediate value (null, undefined, etc).  This patch 
2022         corrects the logic in a number of places by performing the isObject check
2023         before casting to JSObject.
2024
2025         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
2026         (WebCore::JSCanvasRenderingContext2D::drawImage):
2027         (WebCore::JSCanvasRenderingContext2D::drawImageFromRect):
2028         (WebCore::JSCanvasRenderingContext2D::createPattern):
2029
2030 2007-04-05  Adele Peterson  <adele@apple.com>
2031
2032         Reviewed by Oliver.
2033
2034         Fix for <rdar://problem/4965597> REGRESSION: mouseup doesn't fire for slider (causes it to always default to max)
2035
2036         Test: fast/forms/slider-mouse-events.html
2037
2038         * page/EventHandler.cpp: (WebCore::EventHandler::dispatchMouseEvent):
2039         Since the actual target node of the event can't be a shadow node, set the target node to the capturing node before adjusting it.
2040
2041 2007-04-05  Kevin McCullough  <kmccullough@apple.com>
2042
2043         Reviewed by Darin.
2044
2045         - Added reportLocalLoadFailed to FrameLoader to send an error to the console when
2046         calls to canLoad fail. 
2047
2048         * loader/Cache.cpp:
2049         (WebCore::Cache::requestResource):
2050         * loader/FrameLoader.cpp:
2051         (WebCore::FrameLoader::loadSubframe):
2052         (WebCore::FrameLoader::loadPlugin):
2053         (WebCore::FrameLoader::load):
2054         (WebCore::FrameLoader::reportLocalLoadFailed):
2055         * loader/FrameLoader.h:
2056         * loader/SubresourceLoader.cpp:
2057         (WebCore::SubresourceLoader::create):
2058
2059 2007-04-05  Adele Peterson  <adele@apple.com>
2060
2061         Reviewed by Maciej.
2062
2063         Add text-align: -webkit-auto for form controls.  Buttons already override this property to center their text.
2064
2065         * css/html4.css:
2066
2067 2007-04-05  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
2068
2069         Reviewed by rwlbuis.
2070
2071         Coverity fix. Coverity says:
2072         "Event var_deref_model: Variable "page" tracked as NULL was passed to a function that dereferences it."
2073
2074         * platform/Font.cpp:
2075         (WebCore::Font::glyphDataForCharacter):
2076
2077 2007-04-05  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
2078
2079         Reviewed by darin.
2080
2081         Coverity fix. Coverity says:
2082         "Event var_deref_model: Variable "unicode" tracked as NULL was passed to a 
2083         function that dereferences it."
2084
2085         * platform/DeprecatedString.cpp:
2086         (WebCore::DeprecatedString::DeprecatedString):
2087
2088 2007-04-05  Adele Peterson  <adele@apple.com>
2089
2090         Reviewed by Hyatt.
2091
2092         Fix for <rdar://problem/5113593> REGRESSION: Search fields in RSS pages don't show ibeam cursor
2093
2094         * css/html4.css: Set the cursor values explicitly for input, textarea (to auto), & select (to default).
2095
2096 2007-04-05  David Hyatt  <hyatt@apple.com>
2097
2098         Fix for <rdar://problem/5078866> tables should only reset text-align
2099         in quirks mode.
2100
2101         Reviewed by beth
2102
2103         * css/html4.css:
2104         * css/quirks.css:
2105
2106 2007-04-05  Adele Peterson  <adele@apple.com>
2107
2108         Fixing typo that's crashing.
2109
2110         * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::defaultEventHandler):
2111           Use evt instead of null variable k.
2112
2113 2007-04-05  Adele Peterson  <adele@apple.com>
2114
2115         Reviewed by Hyatt.
2116
2117         Fix for <rdar://problem/5021500> Cursor should stay as pointer when slider is being dragged
2118
2119         Don't set the selection ibeam cursor when there's a node that's capturing mouse events.
2120
2121         * page/EventHandler.cpp:
2122         (WebCore::selectCursor):
2123         (WebCore::EventHandler::handleMouseMoveEvent):
2124
2125 2007-04-05  Geoffrey Garen  <ggaren@apple.com>
2126
2127         Reviewed by Beth Dakin.
2128
2129         More clean-up while fixing <rdar://problem/5112273> REGRESSION(TOT): 
2130         Reproducible crash loading an old version of amazon.com as a web archive
2131         
2132         Layout tests pass.
2133         
2134         Removed more superfluous document NULL checks. (Node::document() never 
2135         returns NULL, and it asserts as much.)
2136         
2137         Merged some duplicate editing code into a static inline function.
2138         
2139         * page/mac/WebCoreFrameBridge.mm:
2140         (updateRenderingForBindings): Removed superfluous static_cast.
2141
2142 2007-04-05  Adele Peterson  <adele@apple.com>
2143
2144         Reviewed by Darin.
2145
2146         A little cleanup from my last checkin.  Always check if an Event is really a MouseEvent or a KeyboardEvent
2147         before casting it.
2148
2149         * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::defaultEventHandler):
2150         * html/HTMLSelectElement.cpp:
2151         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
2152         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
2153         * html/HTMLTextFieldInnerElement.cpp:
2154         (WebCore::HTMLSearchFieldResultsButtonElement::defaultEventHandler):
2155         (WebCore::HTMLSearchFieldCancelButtonElement::defaultEventHandler):
2156         * ksvg2/svg/SVGAElement.cpp: (WebCore::SVGAElement::defaultEventHandler):
2157         * page/ContextMenuController.cpp: (WebCore::ContextMenuController::handleContextMenuEvent):
2158         * rendering/RenderFrameSet.cpp: (WebCore::RenderFrameSet::userResize):
2159         * rendering/RenderSlider.cpp: (WebCore::HTMLSliderThumbElement::defaultEventHandler):
2160
2161 2007-04-05  Geoffrey Garen  <ggaren@apple.com>
2162
2163         Reviewed by Beth Dakin.
2164         
2165         Some clean-up while fixing <rdar://problem/5112273> REGRESSION(TOT): 
2166         Reproducible crash loading an old version of amazon.com as a web archive
2167         
2168         Removed superfluous document NULL checks. (Node::document() never returns
2169         NULL, and it asserts as much.)
2170         
2171         Removed duplicate implementation of displayString.
2172         
2173         Layout tests pass.
2174
2175         * bindings/objc/DOMInternal.h:
2176         * bindings/objc/DOMInternal.mm:
2177         * html/HTMLGenericFormElement.cpp:
2178         (WebCore::HTMLGenericFormElement::supportsFocus):
2179         * html/HTMLPlugInElement.cpp:
2180         (WebCore::HTMLPlugInElement::createNPObject):
2181         * platform/ContextMenu.cpp:
2182         (WebCore::ContextMenu::checkOrEnableIfNeeded):
2183         * rendering/HitTestResult.cpp:
2184         (WebCore::displayString):
2185         * rendering/HitTestResult.h:
2186         * rendering/RenderLayer.cpp:
2187         (WebCore::RenderLayer::updateHoverActiveState):
2188
2189 === Safari-5522.6 ===
2190
2191 2007-04-05  Oliver Hunt  <oliver@apple.com>
2192
2193         Reviewed by Adam.
2194
2195         Fix rdar://problem/5030934 -- landscape PDFs embedded as an image are cut off
2196         also fixes scaling of pdf images
2197
2198         PDFDocumentImage was not accounting for page rotation in a number of places
2199
2200         * platform/graphics/cg/PDFDocumentImage.cpp:
2201         (WebCore::PDFDocumentImage::size):
2202           we need to account for rotation of the pdf image effecting our bounds
2203         (WebCore::PDFDocumentImage::draw):
2204           When compensating for flipped coords we need to use the correct rect for the 
2205           coordinate space.  We can't pass size() to CGContextDrawPDFDocument as it
2206           returns the rotated bounds now -- this is also save the old 
2207           FloatSize -> IntSize -> FloatSize conversions.
2208           
2209 2007-04-04  Alexey Proskuryakov  <ap@webkit.org>
2210
2211         Reviewed by Darin.
2212
2213         http://bugs.webkit.org/show_bug.cgi?id=13278
2214         REGRESSION: cannot change SELECT option
2215
2216         Test: fast/forms/option-change-single-selected.html
2217
2218         * html/HTMLSelectElement.cpp:
2219         (WebCore::HTMLSelectElement::setSelectedIndex): If multiple selection is not allowed, 
2220         be sure to deselect the previous option.
2221
2222 2007-04-04  Adele Peterson  <adele@apple.com>
2223
2224         Reviewed by Oliver.
2225
2226         Fix for <rdar://5105009> Prepare for fix to send mousedown and mouseup (but not click) events when right-clicking
2227
2228         * page/EventHandler.cpp: Don't ever send click events for right-clicks.
2229         (WebCore::EventHandler::handleMouseDoubleClickEvent):
2230         (WebCore::EventHandler::handleMouseReleaseEvent):
2231         
2232         Check that the mousedown and mouseup are not with the right button before performing default behavior.
2233         * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::defaultEventHandler):
2234         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler):
2235         * html/HTMLSelectElement.cpp:
2236         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
2237         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
2238         * html/HTMLTextFieldInnerElement.cpp:
2239         (WebCore::HTMLSearchFieldResultsButtonElement::defaultEventHandler):
2240         (WebCore::HTMLSearchFieldCancelButtonElement::defaultEventHandler):
2241         * ksvg2/svg/SVGAElement.cpp:(WebCore::SVGAElement::defaultEventHandler):
2242         * rendering/RenderFrameSet.cpp: (WebCore::RenderFrameSet::userResize):
2243         * rendering/RenderSlider.cpp: (WebCore::HTMLSliderThumbElement::defaultEventHandler):
2244
2245 2007-04-03  Justin Garcia  <justin.garcia@apple.com>
2246
2247         Reviewed by darin
2248         
2249         <rdar://problem/5026848> Can cut/delete ToDo subunits
2250         
2251         We were removing non-editable content during a delete.
2252
2253         * editing/DeleteSelectionCommand.cpp: 
2254         (WebCore::DeleteSelectionCommand::initializePositionData): 
2255         Set m_startRoot and m_endRoot.
2256         (WebCore::DeleteSelectionCommand::removeNode): If a node
2257         is not inside both the start and end roots, remove it only
2258         if it is in editable content.
2259         * editing/DeleteSelectionCommand.h: Added m_startRoot and 
2260         m_endRoot, the editable roots that contain the start and end
2261         of the selection, respectively.  We consult these every
2262         time we remove a node, and don't want to recompute them 
2263         on every call to removeNode().
2264
2265 2007-04-03  David Hyatt  <hyatt@apple.com>
2266
2267         Fix for <rdar://problem/5108896>, make sure the assert for setEncodedSize
2268         deals with the error case.
2269
2270         Reviewed by andersca
2271
2272         * loader/CachedResource.cpp:
2273         (WebCore::CachedResource::setEncodedSize):
2274
2275 2007-04-03  Anders Carlsson  <andersca@apple.com>
2276
2277         Reviewed by Dave Hyatt.
2278
2279         * loader/ImageDocument.cpp:
2280         Don't call error() in stopParsing.
2281
2282 2007-04-03  Justin Garcia  <justin.garcia@apple.com>
2283
2284         Reviewed by darin
2285         
2286         <rdar://problem/5107422> 
2287         TOT REGRESSION: Delete key fails to delete text, and cursor disappears in Mail.app
2288         <rdar://problem/5107413> 
2289         TOT REGRESSION: Crash deleting text in email (infinite recursion in shouldInsertNode)
2290
2291         * editing/CompositeEditCommand.cpp:
2292         (WebCore::CompositeEditCommand::moveParagraphs):
2293         Back out the call to shouldInsert until we
2294         add WebViewInsertActionMoved, because Mail returns
2295         NO from shouldInsert for WebViewInsertActionPasted
2296         to override our Paste operation.
2297
2298 2007-04-03  Anders Carlsson  <andersca@apple.com>
2299
2300         Reviewed by Mitz.
2301
2302         Make window.innerWidth/innerHeight include the size of any present scrollbar to match Firefox.
2303         
2304         Make document.body.clientWidth/clientHeight return the width/height of the visible content when in
2305         quirks mode to match WinIE.
2306         
2307         * bindings/js/kjs_window.cpp:
2308         (KJS::Window::getValueProperty):
2309         Return the width and height of the scroll view, not the visible width and height.
2310         
2311         * dom/Element.cpp:
2312         (WebCore::Element::clientWidth):        
2313         (WebCore::Element::clientHeight):
2314         Return the visible size if the element is the body element and we're in quirks mode.
2315
2316 2007-04-03  Adele Peterson  <adele@apple.com>
2317
2318         Reviewed by Darin.
2319
2320         Updated fix for <rdar://problem/5107095> REGRESSION: disabled text color calculations are slowing down launchtime measurements
2321
2322         * platform/graphics/Color.cpp: Moved optimization for lightening black and darkening white into the Color class.
2323         (WebCore::Color::light):
2324         (WebCore::Color::dark):
2325         * rendering/RenderTextControl.cpp: (WebCore::disabledTextColor): Skip the difference calculation for black text, which will always be lightened.
2326
2327 2007-04-03  Anders Carlsson  <andersca@apple.com>
2328
2329         Reviewed by Tim.
2330
2331         <rdar://problem/4649516> 
2332         Turn off slow script dialog or crank up time that makes it come up
2333         
2334         * bindings/js/kjs_binding.cpp:
2335         (KJS::ScriptInterpreter::ScriptInterpreter):
2336         Increase the timeout to 10 seconds to match Firefox.
2337
2338 2007-04-03  Mitz Pettel  <mitz@webkit.org>
2339
2340         Reviewed by Darin.
2341
2342         - fix http://bugs.webkit.org/show_bug.cgi?id=13251
2343           editing/style/fontsize-1.html fails intermittently when run multiple times on Intel, generates incorrect DOM
2344
2345         Covered by existing editing tests.
2346
2347         * css/CSSPrimitiveValue.cpp:
2348         (WebCore::CSSPrimitiveValue::getFloatValue): Added ASSERTs that the requested conversion
2349         is from a scalar type to a scalar type. The intermittent failures in the test were
2350         the result of trying to convert an identifier type to a scalar type.
2351         * editing/ApplyStyleCommand.cpp:
2352         (WebCore::StyleChange::checkForLegacyHTMLStyleChange): Added a check that the
2353         font-size property value is an absolute length. If it is not (such as in the case
2354         of relative units or keywords like "x-large"), then no corresponding 'size' attribute
2355         will be generated for legacy HTML.
2356
2357 2007-04-03  Mitz Pettel  <mitz@webkit.org>
2358
2359         Reviewed by Darin.
2360
2361         - fix http://bugs.webkit.org/show_bug.cgi?id=13218
2362           <rdar://problem/5095977>
2363           Reproducible crash after call to window.close()
2364
2365         * manual-tests/stale-currentEvent.html: Added.
2366         * page/EventHandler.cpp:
2367         (WebCore::EventHandler::hoverTimerFired): Instead of faking a mouse event,
2368         just hit-test the last mouse event coordinates and update for hover state
2369         changes. This eliminates the use of currentEvent, which can be a non-mouse
2370         event or even a stale event.
2371
2372 2007-04-02  Adele Peterson  <adele@apple.com>
2373
2374         Reviewed by Maciej.
2375
2376         Fix for <rdar://problem/5107095> REGRESSION: disabled text color calculations are slowing down launchtime measurements
2377
2378         Hardcode disabled text colors for the most common cases- black and white.
2379
2380         * rendering/RenderTextControl.cpp: (WebCore::disabledTextColor):
2381
2382 2007-04-02  David Hyatt  <hyatt@apple.com>
2383
2384         Fix for <rdar://problem/5105784>, assertion failure in cache.  Encoded sizes were being set to
2385         garbage by accident because of a mismatch between derived class and base class constructors.  This
2386         patch cleans all of this up and gets rid of expiration date as a concept separate from the response.
2387
2388         Reviewed by anders
2389
2390         * dom/Document.cpp:
2391         (WebCore::Document::processHttpEquiv):
2392         * html/HTMLImageLoader.cpp:
2393         (WebCore::HTMLImageLoader::updateFromElement):
2394         * loader/Cache.cpp:
2395         (WebCore::createResource):
2396         (WebCore::Cache::requestResource):
2397         * loader/Cache.h:
2398         * loader/CachedCSSStyleSheet.cpp:
2399         (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
2400         * loader/CachedCSSStyleSheet.h:
2401         * loader/CachedImage.cpp:
2402         (WebCore::CachedImage::CachedImage):
2403         * loader/CachedImage.h:
2404         * loader/CachedResource.cpp:
2405         (WebCore::CachedResource::CachedResource):
2406         (WebCore::CachedResource::finish):
2407         * loader/CachedResource.h:
2408         * loader/CachedScript.cpp:
2409         (WebCore::CachedScript::CachedScript):
2410         * loader/CachedScript.h:
2411         * loader/CachedXBLDocument.cpp:
2412         (WebCore::CachedXBLDocument::CachedXBLDocument):
2413         * loader/CachedXBLDocument.h:
2414         * loader/CachedXSLStyleSheet.cpp:
2415         (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
2416         * loader/CachedXSLStyleSheet.h:
2417         * loader/DocLoader.cpp:
2418         (WebCore::DocLoader::DocLoader):
2419         (WebCore::DocLoader::requestResource):
2420         * loader/DocLoader.h:
2421
2422 2007-04-03  Antti Koivisto  <antti@apple.com>
2423
2424         Reviewed by Hyatt.
2425
2426         Render tree memory savings, part 3
2427         
2428         These changes shrink all RenderBlocks by additional 28 bytes. Together with parts 1 and 2
2429         RenderBlock goes from 172 bytes to 128 bytes, a saving of 26%.
2430         
2431         - Pack bitfields together in RenderFlow
2432         - Move top/bottom min/max margin values to a struct that is only allocated in case these
2433           variables have non default values. Usually this is <5% of all blocks. 
2434         - Move rarely used column variables to hash
2435
2436         * rendering/RenderBlock.cpp:
2437         (WebCore::ColumnInfo::ColumnInfo):
2438         (WebCore::RenderBlock::RenderBlock):
2439         (WebCore::RenderBlock::~RenderBlock):
2440         (WebCore::RenderBlock::layoutBlock):
2441         (WebCore::RenderBlock::collapseMargins):
2442         (WebCore::RenderBlock::clearFloatsIfNeeded):
2443         (WebCore::RenderBlock::setCollapsedBottomMargin):
2444         (WebCore::RenderBlock::layoutBlockChildren):
2445         (WebCore::RenderBlock::paintColumns):
2446         (WebCore::RenderBlock::paintObject):
2447         (WebCore::RenderBlock::fillSelectionGaps):
2448         (WebCore::RenderBlock::lowestPosition):
2449         (WebCore::RenderBlock::rightmostPosition):
2450         (WebCore::RenderBlock::leftmostPosition):
2451         (WebCore::RenderBlock::nodeAtPoint):
2452         (WebCore::RenderBlock::hitTestColumns):
2453         (WebCore::RenderBlock::positionForCoordinates):
2454         (WebCore::RenderBlock::availableWidth):
2455         (WebCore::RenderBlock::calcColumnWidth):
2456         (WebCore::RenderBlock::setDesiredColumnCountAndWidth):
2457         (WebCore::RenderBlock::desiredColumnWidth):
2458         (WebCore::RenderBlock::desiredColumnCount):
2459         (WebCore::RenderBlock::columnRects):
2460         (WebCore::RenderBlock::layoutColumns):
2461         (WebCore::RenderBlock::adjustPointToColumnContents):
2462         (WebCore::RenderBlock::adjustRectForColumns):
2463         (WebCore::RenderBlock::setMaxTopMargins):
2464         (WebCore::RenderBlock::setMaxBottomMargins):
2465         * rendering/RenderBlock.h:
2466         (WebCore::RenderBlock::maxTopMargin):
2467         (WebCore::RenderBlock::maxBottomMargin):
2468         (WebCore::RenderBlock::maxTopPosMargin):
2469         (WebCore::RenderBlock::maxTopNegMargin):
2470         (WebCore::RenderBlock::maxBottomPosMargin):
2471         (WebCore::RenderBlock::maxBottomNegMargin):
2472         (WebCore::RenderBlock::initMaxMarginValues):
2473         (WebCore::RenderBlock::MaxMargin::MaxMargin):
2474         (WebCore::RenderBlock::MaxMargin::topPosDefault):
2475         (WebCore::RenderBlock::MaxMargin::topNegDefault):
2476         (WebCore::RenderBlock::MaxMargin::bottomPosDefault):
2477         (WebCore::RenderBlock::MaxMargin::bottomNegDefault):
2478         * rendering/RenderFlexibleBox.cpp:
2479         (WebCore::RenderFlexibleBox::layoutBlock):
2480         * rendering/RenderFlow.h:
2481         (WebCore::RenderFlow::RenderFlow):
2482         (WebCore::RenderFlow::hasColumns):
2483         * rendering/RenderInline.cpp:
2484         (WebCore::RenderInline::RenderInline):
2485         * rendering/RenderInline.h:
2486
2487 2007-04-03  Antti Koivisto  <antti@apple.com>
2488
2489         Reviewed by Hyatt.
2490
2491         Fix asserts, these may also be called for rel positioned elements
2492
2493         * rendering/RenderBox.cpp:
2494         (WebCore::RenderBox::setStaticX):
2495         (WebCore::RenderBox::setStaticY):
2496
2497 2007-04-02  David Hyatt  <hyatt@apple.com>
2498
2499         Throw in an assert to try to track down a problem where an image is being set to a smaller encoded
2500         size.
2501
2502         * loader/CachedResource.cpp:
2503         (WebCore::CachedResource::setEncodedSize):
2504
2505 2007-04-02  Ada Chan  <adachan@apple.com>
2506
2507         Reviewed by Adele.
2508
2509         <rdar://5105331> Missing null check in Editor::execCommand
2510         Added null check.
2511
2512         * editing/Editor.cpp:
2513         (WebCore::Editor::execCommand):
2514
2515 2007-04-02  Justin Garcia  <justin.garcia@apple.com>
2516
2517         Reviewed by darin
2518
2519         <rdar://problem/5058163> 
2520         Hitting return inserts a new line between two To Dos, but caret is position after second ToDo
2521
2522         * editing/InsertParagraphSeparatorCommand.cpp:
2523         (WebCore::InsertParagraphSeparatorCommand::doApply):
2524         Removed refPos, it was unused.
2525         Don't assume that upstream() moves to a different
2526         node.  This assumption caused the line break to
2527         be inserted *after* the caret and a bad position
2528         to be set (added a testcase).
2529         Use isStartOfParagraph instead of checking
2530         for the existence of a br because the line might 
2531         be broken by a newline character in text that 
2532         preserves newlines.  Paragraphs that are created 
2533         in other ways, like with blocks, are handled 
2534         above (added a testcase).
2535
2536  2007-04-02  David Harrison  <harrison@apple.com>
2537
2538         Reviewed by Darin.
2539
2540         <rdar://problem/4906488> text attributes are not working for frame based web page
2541
2542         Attribute handling now treats each WebArea as its own world, rather than sometimes
2543         referring back up to the top WebArea. e.g. getting/setting the selection now
2544         operates on the WebArea containing the WebCoreAXObject that is being messaged (self).
2545         The methods that sit above this and are able to go into arbitrary WebAreas
2546         are accessibilityFocusedUIElement and doAXTextMarkerForPosition, allowing VoiceOver
2547         to navigate between frames.
2548         
2549         * bridge/mac/WebCoreAXObject.mm:
2550         (-[WebCoreAXObject topRenderer]):
2551         (-[WebCoreAXObject frameView]):
2552         (-[WebCoreAXObject topFrameView]):
2553         Removed topDocument, renamed topView to topFrameView, added frameView.
2554         
2555         (-[WebCoreAXObject accessibilityAttributeValue:]):
2556         AXSelectedTextMarkerRange, AXStartTextMarker, and AXEndTextMarker now use
2557         self's WebArea, rather than the top WebArea.
2558         
2559         (-[WebCoreAXObject doAXTextMarkerRangeForLine:]):
2560         Use self's WebArea, rather than the top WebArea.
2561
2562         (-[WebCoreAXObject doAXTextMarkerForPosition:]):
2563         Use renamed methods for accessing top WebArea.
2564          
2565         (-[WebCoreAXObject doAXBoundsForTextMarkerRange:]):
2566         Use renamed methods for accessing self's WebArea.
2567
2568         (AXAttributeStringSetColor):
2569         (AXAttributeStringSetNumber):
2570         (AXAttributeStringSetFont):
2571         (AXAttributeStringSetStyle):
2572         (AXAttributeStringSetElement):
2573         (-[WebCoreAXObject rendererForView:]):
2574         Clean up uses of nil and NULL.
2575         
2576         (-[WebCoreAXObject accessibilityFocusedUIElement]):
2577         Find the focused node on the whole page. If there is no focused node,
2578         return the WebArea for the focused document.
2579         
2580         (-[WebCoreAXObject doSetAXSelectedTextMarkerRange:]):
2581         Use self's WebArea, rather than the top WebArea.
2582
2583 2007-04-02  Antti Koivisto  <antti@apple.com>
2584
2585         Fix build. This one was not supposed to be checked in.
2586
2587         * rendering/RenderFlexibleBox.cpp:
2588         (WebCore::RenderFlexibleBox::layoutBlock):
2589
2590 2007-03-30  Antti Koivisto  <antti@apple.com>
2591
2592         Reviewed by Hyatt.
2593
2594         Render tree memory savings, part 2
2595         
2596         - Move staticX and staticY variables to RenderLayer since they are only
2597           applicable to positioned objects
2598         - Move very rarely used overrideSize variable to hash
2599         
2600         These changes shrink all box types by 12 bytes
2601
2602         * rendering/RenderBox.cpp:
2603         (WebCore::RenderBox::RenderBox):
2604         (WebCore::RenderBox::destroy):
2605         (WebCore::RenderBox::overrideSize):
2606         (WebCore::RenderBox::setOverrideSize):
2607         (WebCore::RenderBox::overrideWidth):
2608         (WebCore::RenderBox::overrideHeight):
2609         (WebCore::RenderBox::position):
2610         (WebCore::RenderBox::calcWidth):
2611         (WebCore::RenderBox::calcHeight):
2612         (WebCore::RenderBox::staticX):
2613         (WebCore::RenderBox::staticY):
2614         (WebCore::RenderBox::setStaticX):
2615         (WebCore::RenderBox::setStaticY):
2616         (WebCore::RenderBox::calcAbsoluteHorizontal):
2617         (WebCore::RenderBox::calcAbsoluteVertical):
2618         (WebCore::RenderBox::calcAbsoluteHorizontalReplaced):
2619         (WebCore::RenderBox::calcAbsoluteVerticalReplaced):
2620         * rendering/RenderBox.h:
2621         * rendering/RenderLayer.cpp:
2622         (WebCore::RenderLayer::RenderLayer):
2623         * rendering/RenderLayer.h:
2624         (WebCore::RenderLayer::staticX):
2625         (WebCore::RenderLayer::staticY):
2626         (WebCore::RenderLayer::setStaticX):
2627         (WebCore::RenderLayer::setStaticY):
2628         * rendering/RenderObject.cpp:
2629         (WebCore::RenderObject::RenderObject):
2630         * rendering/RenderObject.h:
2631         (WebCore::):
2632         (WebCore::RenderObject::hasOverrideSize):
2633         (WebCore::RenderObject::setHasOverrideSize):
2634         * rendering/RenderWidget.cpp:
2635         (WebCore::RenderWidget::destroy):
2636
2637 2007-03-31  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
2638
2639         Not reviewed - gdk build fix.
2640
2641         * platform/gdk/TemporaryLinkStubs.cpp:
2642         (Font::selectionRectForComplexText):
2643         (Font::drawComplexText):
2644
2645 2007-03-31  Alexey Proskuryakov  <ap@webkit.org>
2646
2647         Reviewed by Darin.
2648
2649         http://bugs.webkit.org/show_bug.cgi?id=12778
2650         REGRESSION: Nightly won't load Curl plugin for full page use
2651
2652         * dom/DOMImplementation.cpp:
2653         (WebCore::DOMImplementation::createDocument): Re-order cases to give more priority to plugins.
2654         This also fixes Adobe SVG Viewer and any plugins that register XML MIME types.
2655         Added a case for XHTML to avoid enumerating plugins.
2656
2657 2007-03-31  David Hyatt  <hyatt@apple.com>
2658
2659         Fix for bug 13234, layout of selected justified text is broken.  Rework TextRuns to avoid having
2660         from/to members.  Let those be passed in only by the functions that need them (drawing and selection rect).
2661
2662         Reviewed by mitz
2663
2664         fast/text/justified-selection-at-edge.html
2665
2666         * platform/Font.cpp:
2667         (WebCore::WidthIterator::WidthIterator):
2668         (WebCore::WidthIterator::advance):
2669         (WebCore::Font::canUseGlyphCache):
2670         (WebCore::Font::drawSimpleText):
2671         (WebCore::Font::drawText):
2672         (WebCore::Font::floatWidth):
2673         (WebCore::Font::floatWidthForSimpleText):
2674         (WebCore::Font::selectionRectForText):
2675         (WebCore::Font::selectionRectForSimpleText):
2676         (WebCore::Font::offsetForPositionForSimpleText):
2677         * platform/Font.h:
2678         (WebCore::TextRun::m_len):
2679         * platform/graphics/GraphicsContext.cpp:
2680         (WebCore::GraphicsContext::drawText):
2681         (WebCore::GraphicsContext::drawHighlightForText):
2682         * platform/graphics/GraphicsContext.h:
2683         * platform/mac/FontMac.mm:
2684         (WebCore::addDirectionalOverride):
2685         (WebCore::overrideLayoutOperation):
2686         (WebCore::ATSULayoutParameters::initialize):
2687         (WebCore::Font::selectionRectForComplexText):
2688         (WebCore::Font::drawComplexText):
2689         (WebCore::Font::floatWidthForComplexText):
2690         (WebCore::Font::offsetForPositionForComplexText):
2691         * platform/qt/FontQt.cpp:
2692         (WebCore::Font::drawComplexText):
2693         (WebCore::Font::floatWidthForComplexText):
2694         * platform/qt/TemporaryLinkStubs.cpp:
2695         (Font::selectionRectForComplexText):
2696         * rendering/EllipsisBox.cpp:
2697         (WebCore::EllipsisBox::paint):
2698         * rendering/InlineTextBox.cpp:
2699         (WebCore::InlineTextBox::selectionRect):
2700         (WebCore::InlineTextBox::paint):
2701         (WebCore::InlineTextBox::paintSelection):
2702         (WebCore::InlineTextBox::paintMarkedTextBackground):
2703         (WebCore::InlineTextBox::paintSpellingOrGrammarMarker):
2704         (WebCore::InlineTextBox::paintTextMatchMarker):
2705         (WebCore::InlineTextBox::offsetForPosition):
2706         (WebCore::InlineTextBox::positionForOffset):
2707         * rendering/RenderListMarker.cpp:
2708         (WebCore::RenderListMarker::paint):
2709         (WebCore::RenderListMarker::calcMinMaxWidth):
2710         (WebCore::RenderListMarker::getRelativeMarkerRect):
2711         * rendering/RenderMenuList.cpp:
2712         (WebCore::RenderMenuList::updateOptionsWidth):
2713         * rendering/RenderText.cpp:
2714         (WebCore::RenderText::widthFromCache):
2715         (WebCore::RenderText::width):
2716
2717 2007-03-31  Mitz Pettel  <mitz@webkit.org>
2718
2719         Reviewed by Darin.
2720
2721         - fix http://bugs.webkit.org/show_bug.cgi?id=13243
2722               <rdar://problem/5103226>
2723           REGRESSION (r20506): Repro crash/assert when using scroll wheel on a list box taller than its contents
2724
2725         * platform/ScrollBar.cpp:
2726         (WebCore::Scrollbar::setValue): Cleaned up a little.
2727         (WebCore::Scrollbar::scroll): Changed to apply the minimum and maximum constraints
2728         in the right order, and cleaned up a little.
2729
2730 2007-03-31  Mitz Pettel  <mitz@webkit.org>
2731
2732         Reviewed by Darin.
2733
2734         - fix http://bugs.webkit.org/show_bug.cgi?id=13242
2735           REGRESSION: Repro crash when specifying the content property for an image
2736
2737         Test: fast/images/text-content-crash.html
2738
2739         * html/HTMLImageElement.cpp:
2740         (WebCore::HTMLImageElement::parseMappedAttribute): Added a check that the
2741         renderer is an image.
2742         (WebCore::HTMLImageElement::attach): Ditto.
2743
2744 2007-03-31  Mark Rowe  <mrowe@apple.com>
2745
2746         Reviewed by Darin.
2747
2748         A more correct fix for http://bugs.webkit.org/show_bug.cgi?id=13129
2749         Bug 13129: Democracy Player dies in NSException from WebScriptObject on startup
2750
2751         The previous attempt at a fix in r20343 attempted to conditionally expose the 'count'
2752         method.  It did not work which resulted in 'count' always being hidden.  This change
2753         disables -[WebScriptObject count] completely until it can be determined whether it is
2754         needed and how to support it without breaking third-party applications.
2755
2756         * bindings/objc/WebScriptObject.mm:
2757         (-[WebScriptObject count]):
2758         * bindings/objc/WebScriptObjectPrivate.h:
2759
2760 2007-03-31  Nicholas Shanks  <webkit@nickshanks.com>
2761
2762         Reviewed by Adele.
2763
2764         http://bugs.webkit.org/show_bug.cgi?id=13184
2765         HTMLImageElement longdesc should be complete resolved URL
2766
2767         Test: fast/dom/HTMLImageElement/image-longdesc-absolute-url.html
2768
2769         * html/HTMLImageElement.cpp:
2770         (WebCore::HTMLImageElement::longDesc): Return absolute URL.
2771         Behaviour now matches Firefox and Opera.
2772
2773 2007-03-31  Mitz Pettel  <mitz@webkit.org>
2774
2775         Reviewed by Hyatt.
2776
2777         - fix http://bugs.webkit.org/show_bug.cgi?id=13209
2778           REGRESSION (r18756-18765): Incomplete list marker repaint when resizing list item
2779
2780         Test: fast/repaint/list-marker-2.html
2781
2782         A list marker can increase the horizontal overflow after layoutInlineChildren(),
2783         so made that function return only the vertical bounds of the repaint rect. As the
2784         horizontal bounds, made layoutBlock() just use the overflow bounds after layout.
2785
2786         * rendering/RenderBlock.cpp:
2787         (WebCore::RenderBlock::layoutBlock):
2788         * rendering/RenderBlock.h:
2789         * rendering/bidi.cpp:
2790         (WebCore::RenderBlock::layoutInlineChildren):
2791
2792 2007-03-31  Mitz Pettel  <mitz@webkit.org>
2793
2794         Reviewed by Hyatt.
2795
2796         - http://bugs.webkit.org/show_bug.cgi?id=13178
2797           Helvetica zero-width space has non-zero width
2798
2799         Test: fast/text/wide-zero-width-space.html
2800
2801         * platform/FontData.cpp:
2802         (WebCore::FontData::FontData): Force the ZERO WIDTH SPACE glyph to have width
2803         0, unless the SPACE character maps to the same glyph.
2804
2805 2007-03-31  Mitz Pettel  <mitz@webkit.org>
2806
2807         Reviewed by Darin.
2808
2809         - fix http://bugs.webkit.org/show_bug.cgi?id=8016
2810           REPRO: Safari hangs loading 18 MB page (deeply nested DOM tree)
2811
2812         Test: fast/tokenizer/lessthan-terminates-tags-and-attrs.html
2813
2814         * html/HTMLTokenizer.cpp:
2815         (WebCore::HTMLTokenizer::parseTag): Made "<" terminate tag and attribute
2816         names. This matches Firefox.
2817
2818 2007-03-31  Alexey Proskuryakov  <ap@webkit.org>
2819
2820         Debug build fix.
2821
2822         * xml/XPathValue.cpp:
2823         (WebCore::XPath::): Define Value::adopt.
2824
2825 2007-03-30  Alexey Proskuryakov  <ap@webkit.org>
2826
2827         Reviewed by Darin.
2828
2829         http://bugs.webkit.org/show_bug.cgi?id=13021
2830         XPath can be very slow
2831
2832         This patch finally makes us faster than Firefox 2.0 on this test case.
2833
2834         * xml/XPathFunctions.cpp:
2835         (WebCore::XPath::FunConcat::evaluate): Use a Vector buffer for faster appending.
2836         (WebCore::XPath::FunId::evaluate): Move the result NodeSet into Value instead of copying it.
2837         (WebCore::XPath::FunLocalName::evaluate): Cosmetic changes.
2838         (WebCore::XPath::FunNamespaceURI::evaluate): Ditto.
2839         (WebCore::XPath::FunName::evaluate): Ditto.
2840         (WebCore::XPath::FunNormalizeSpace::evaluate): Ditto.
2841
2842         * xml/XPathValue.cpp:
2843         (WebCore::XPath::Value::toNodeSet):
2844         (WebCore::XPath::Value::modifiableNodeSet):
2845         (WebCore::XPath::Value::toBoolean):
2846         (WebCore::XPath::Value::toNumber):
2847         (WebCore::XPath::Value::toString):
2848         * xml/XPathValue.h:
2849         (WebCore::XPath::ValueData::ValueData):
2850         (WebCore::XPath::Value::Value):
2851         Made Value copying faster by putting large data members into a separate refcounted ValueData class.
2852         Added provisions for moving a NodeSet in and out of Value without copying.
2853         Made construction safer by moving bool version to a template constructor.
2854         Removed an (almost) unused default constructor.
2855
2856         * xml/XPathPredicate.h: Store a Value for literal string and number expressions to avoid 
2857         constructing one each time.
2858
2859         * xml/XPathPath.cpp:
2860         (WebCore::XPath::Filter::evaluate):
2861         (WebCore::XPath::LocationPath::evaluate):
2862         (WebCore::XPath::Path::evaluate):
2863         * xml/XPathPath.h:
2864         * xml/XPathPredicate.cpp:
2865         (WebCore::XPath::NumericOp::evaluate):
2866         (WebCore::XPath::Union::evaluate):
2867         * xml/XPathResult.cpp:
2868         (WebCore::XPathResult::snapshotItem):
2869         * xml/XPathStep.cpp:
2870         (WebCore::XPath::Step::evaluate):
2871         (WebCore::XPath::Step::nodesInAxis):
2872         * xml/XPathStep.h:
2873         Got rid of unnecessary NodeSet copying in many cases.
2874
2875 2007-03-30  Justin Garcia  <justin.garcia@apple.com>
2876
2877         Reviewed by john
2878
2879         <rdar://problem/5076323> Only one To Do can be created by a selection in a message
2880
2881         When Mail's ToDoify operation called moveToEndOfDocument: 
2882         with a selection that started just before a ToDo, we'd 
2883         move them to the end of the document, not to the end
2884         of the editable root, because we incorrectly checked
2885         for the editability of positions before ToDos.  Then Mail
2886         would refuse to create a ToDo because the selection was 
2887         outside of the region where they allowed editing.
2888
2889         * editing/SelectionController.cpp:
2890         (WebCore::SelectionController::modifyExtendingRightForward):
2891         Check the position for editability, not the position's node,
2892         since there are editable positions of the form [node, offset]
2893         where node is contenteditable=false.
2894         Re-use pos.  Nothing that happens after it's created can invalidate
2895         it or the position and affinity used to create it.
2896         (WebCore::SelectionController::modifyMovingRightForward): Ditto.
2897         (WebCore::SelectionController::modifyExtendingLeftBackward): Ditto.
2898         (WebCore::SelectionController::modifyMovingLeftBackward): Ditto.
2899         * rendering/RenderBlock.cpp:
2900         (WebCore::RenderBlock::paintCaret): Ditto.
2901
2902 2007-03-30  Adele Peterson  <adele@apple.com>
2903
2904         Reviewed by Darin.
2905
2906         Added DeleteWordBackward and DeleteWordForward to execCommand.
2907
2908         * editing/Editor.cpp:
2909         (WebCore::execDeleteWordBackward):
2910         (WebCore::execDeleteWordForward):
2911         (WebCore::CommandEntry::):
2912
2913 2007-03-30  Simon Hausmann  <hausmann@kde.org>
2914
2915         Reviewed by Zack
2916
2917         * WebCore.pro: Fix release Qt builds.
2918
2919 2007-03-30  Antti Koivisto  <antti@apple.com>
2920
2921         Reviewed by bdash.
2922
2923         Spotted an int that should be float in previous patch.
2924
2925         * platform/Font.cpp:
2926         (WebCore::WidthIterator::advance):
2927
2928 2007-03-30  Antti Koivisto  <antti@apple.com>
2929
2930         Reviewed by Hyatt.
2931
2932         Render tree memory savings, part 1
2933         
2934         - Eliminate caching of monospace char width from RenderText. This optimization is not needed
2935           anymore since Font already caches space width (RenderText -4 bytes)
2936         - Eliminate caching of tab width from RenderBlock. Similary this optimization has become
2937           obsolete (RenderBlock -4 bytes)
2938
2939         * platform/Font.cpp:
2940         (WebCore::WidthIterator::advance):
2941         (WebCore::Font::spaceWidth):
2942         * platform/Font.h:
2943         (WebCore::Font::tabWidth):
2944         * platform/TextStyle.h:
2945         (WebCore::TextStyle::TextStyle):
2946         (WebCore::TextStyle::allowTabs):
2947         * rendering/InlineTextBox.cpp:
2948         (WebCore::InlineTextBox::selectionRect):
2949         (WebCore::InlineTextBox::paint):
2950         (WebCore::InlineTextBox::paintSelection):
2951         (WebCore::InlineTextBox::paintMarkedTextBackground):
2952         (WebCore::InlineTextBox::paintSpellingOrGrammarMarker):
2953         (WebCore::InlineTextBox::paintTextMatchMarker):
2954         (WebCore::InlineTextBox::offsetForPosition):
2955         (WebCore::InlineTextBox::positionForOffset):
2956         * rendering/RenderBlock.cpp:
2957         (WebCore:::RenderFlow):
2958         (WebCore::RenderBlock::setStyle):
2959         * rendering/RenderBlock.h:
2960         * rendering/RenderObject.cpp:
2961         * rendering/RenderObject.h:
2962         * rendering/RenderText.cpp:
2963         (WebCore::RenderText::RenderText):
2964         (WebCore::RenderText::setStyle):
2965         (WebCore::RenderText::widthFromCache):
2966         (WebCore::RenderText::trimmedMinMaxWidth):
2967         (WebCore::RenderText::calcMinMaxWidthInternal):
2968         (WebCore::RenderText::setTextInternal):
2969         (WebCore::RenderText::width):
2970         * rendering/RenderText.h:
2971         (WebCore::RenderText::allowTabs):
2972         * rendering/bidi.cpp:
2973
2974 2007-03-30  David Hyatt  <hyatt@apple.com>
2975
2976         Fix (take 2) for bug 4334, flickering when floating elements gain/lose transparency.
2977
2978         Reviewed by mitz
2979
2980         * rendering/RenderBlock.cpp:
2981         * rendering/RenderBlock.h:
2982         * rendering/RenderBox.cpp:
2983         (WebCore::RenderBox::setStyle):
2984
2985 2007-03-29  Mitz Pettel  <mitz@webkit.org>
2986
2987         Reviewed by Darin.
2988
2989         - fix http://bugs.webkit.org/show_bug.cgi?id=13166
2990           REGRESSION (2005-10-16 - 2005-10-19): Ampersands showing up in the last column of the Gmail contacts table
2991
2992         Test: fast/tokenizer/write-partial-entity.html
2993
2994         * html/HTMLTokenizer.cpp:
2995         (WebCore::HTMLTokenizer::parseTag): Reordered to avoid resetting the buffer position
2996         after script execution which can write to the buffer.
2997
2998 2007-03-29  Justin Garcia  <justin.garcia@apple.com>
2999
3000         Reviewed by john
3001
3002         <rdar://problem/5099303> Deleting after a ToDo puts the caret in the wrong position
3003         
3004         We were failing to create the correct selection 
3005         for DeleteSelectionCommand because the selection extension 
3006         operations don't skip over non-editable content for editable 
3007         selections.
3008
3009         * editing/SelectionController.cpp:
3010         (WebCore::SelectionController::modifyExtendingRightForward):
3011         When extending an editable selection, don't extend into
3012         non-editable content.
3013         (WebCore::SelectionController::modifyExtendingLeftBackward):
3014         Ditto.
3015
3016 2007-03-29  Patti Hoa  <patti@apple.com>
3017
3018         Reviewed by harrison.
3019
3020         <rdar://problem/4918397> Exception raise inspecting note contents in the background
3021         * WebCore.xcodeproj/project.pbxproj:
3022         * bridge/mac/WebCoreAXObject.mm:
3023         (-[WebCoreAXObject subrole]):
3024         (-[WebCoreAXObject title]):
3025         Check that attachment supports the attribute before requesting it.
3026
3027 2007-03-29  Justin Garcia  <justin.garcia@apple.com>
3028
3029         Reviewed by john
3030
3031         <rdar://problem/5032066> Delete should work between ToDos
3032         
3033         Stop selecting the table when the user attempts to delete
3034         the line break just after it, instead, extend the selection
3035         into the last table cell.
3036         Let deletion merge content into table cells (as long as 
3037         its not from another table cell).  
3038         Start calling shouldInsertNode:replacingDOMRange:givenAction: 
3039         when moving content with moveParagraphs, so that Mail can 
3040         modify content before it is moved into a ToDo during a delete.
3041
3042         * editing/CompositeEditCommand.cpp:
3043         (WebCore::CompositeEditCommand::moveParagraphs): Ask the
3044         delegate before performing the move.  This will let Mail
3045         prevent styles from entering a ToDo.
3046         Added a FIXME about adding a new WebViewInsertAction
3047         * editing/DeleteSelectionCommand.cpp:
3048         (WebCore::DeleteSelectionCommand::initializePositionData):
3049         Allow merging into table cells from content not in a table.
3050         * editing/SelectionController.cpp:
3051         (WebCore::SelectionController::modifyExtendingRightForward):
3052         Don't select the table when extending by character/word from
3053         just before it.  This code was here to make it easier to select
3054         tables in order to delete them, but the deletion UI makes it 
3055         largely unnecessary.
3056         (WebCore::SelectionController::modifyExtendingLeftBackward):
3057         Ditto.
3058         * editing/TypingCommand.cpp:
3059         (WebCore::isFirstPositionAfterTable): Added.
3060         (WebCore::isLastPositionBeforeTable): Ditto.
3061         (WebCore::TypingCommand::deleteKeyPressed): When pressing
3062         the delete key with a caret at the beginning of a paragraph
3063         just after a table, move the paragraph into the last table
3064         cell.
3065         Do not do this if it would mean moving a block table.
3066         Removed some old irrelevant comments.
3067         * editing/htmlediting.cpp: Removed unused functions.
3068         * editing/htmlediting.h:
3069
3070 2007-03-29  Adam Treat  <adam@staikos.net>
3071
3072         Reviewed and committed by George Staikos.
3073
3074         Remove redundant line.
3075
3076         * platform/qt/FontDataQt.cpp:
3077         (WebCore::FontData::platformInit):
3078
3079 2007-03-29  Adam Treat  <adam@staikos.net>
3080
3081         Reviewed by David Hyatt, committed by George Staikos.
3082
3083         Test: fast/text/justified-selection.html
3084
3085         Take into account the entire run length to get a proper selection.
3086
3087         * platform/Font.cpp:
3088         (WebCore::WidthIterator::WidthIterator):
3089
3090 2007-03-29  David Hyatt  <hyatt@apple.com>
3091
3092         Fix for <rdar://problem/4545060>, technorati and arstechnica fail because of getComputedStyle not
3093         reporting display:none properly when it is set.  This is bugzilla bug 13103.
3094
3095         Reviewed by mitz
3096
3097         * css/CSSComputedStyleDeclaration.cpp:
3098         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
3099
3100 2007-03-28  Oliver Hunt  <oliver@apple.com>
3101
3102         Reviewed by Hyatt.
3103
3104         Rename DocLoader::setPasteInProgress, etc to more generic 
3105         setAllowStaleResources, etc
3106
3107         * editing/Editor.cpp:
3108         (WebCore::Editor::paste):
3109         * loader/DocLoader.cpp:
3110         (WebCore::DocLoader::DocLoader):
3111         (WebCore::DocLoader::checkForReload):
3112         * loader/DocLoader.h:
3113         (WebCore::DocLoader::setAllowStaleResources):
3114         * page/DragController.cpp:
3115         (WebCore::DragController::concludeDrag):
3116
3117 2007-03-28  Oliver Hunt  <oliver@apple.com>
3118
3119         Reviewed by Anders and Steve.
3120
3121         Add a flag to DocLoader to prevent it from reloading 
3122         when performing a paste or drop operation.
3123         
3124         Remove m_cachePolicy from CachedResource as it is never used
3125         
3126         Fixes rdar://problem/5044366 : REGRESSION: Repro ASSERT failures 
3127         dragging image into GMail message in _web_writeImage and 
3128         documentFragmentFromDragData
3129
3130         * editing/Editor.cpp:
3131         (WebCore::Editor::paste):
3132           prevent the docloader from reloading resources on paste
3133         * html/HTMLImageLoader.cpp:
3134         (WebCore::HTMLImageLoader::updateFromElement):
3135         * loader/Cache.cpp:
3136         (WebCore::createResource):
3137         * loader/CachedCSSStyleSheet.cpp:
3138         (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
3139         * loader/CachedCSSStyleSheet.h:
3140         * loader/CachedImage.cpp:
3141         (WebCore::CachedImage::CachedImage):
3142         * loader/CachedImage.h:
3143         * loader/CachedResource.cpp:
3144         (WebCore::CachedResource::CachedResource):
3145         * loader/CachedResource.h:
3146         * loader/CachedScript.cpp:
3147         (WebCore::CachedScript::CachedScript):
3148         * loader/CachedScript.h:
3149         * loader/CachedXBLDocument.cpp:
3150         (WebCore::CachedXBLDocument::CachedXBLDocument):
3151         * loader/CachedXBLDocument.h:
3152         * loader/CachedXSLStyleSheet.cpp:
3153         (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
3154         * loader/CachedXSLStyleSheet.h:
3155         * loader/DocLoader.cpp:
3156         (WebCore::DocLoader::DocLoader):
3157            Tidy up constructor initialise new field
3158         (WebCore::DocLoader::checkForReload):
3159            Prevent reload when pasting
3160         * loader/DocLoader.h:
3161         (WebCore::DocLoader::setPasteInProgress):
3162           new field and setter
3163         * page/DragController.cpp:
3164         (WebCore::DragController::concludeDrag):
3165           prevent the docloader from reloading resources on drop
3166
3167 2007-03-27  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
3168
3169         Not reviewed - fix typo in gdk build.
3170
3171         * platform/gdk/ScrollViewGdk.cpp:
3172         (WebCore::ScrollView::contentsToWindow):
3173
3174 2007-03-28  Maciej Stachowiak  <mjs@apple.com>
3175         
3176         Reviewed by Darin.
3177         
3178         - fixed <rdar://problem/4820817> Autoscroll is broken in Mail.app (message jumps around when trying to select text)
3179                 
3180         Handle scrolling external scrollviews around the webview during
3181         autoscroll or when scrolling into view.
3182         
3183         This should also restore performance on BenchJS test 6 lost due to Tim's partial fix.
3184
3185         * page/FrameView.cpp:
3186         (WebCore::FrameView::scrollRectIntoViewRecursively):
3187         * page/FrameView.h:
3188         * platform/ScrollView.h:
3189         * platform/gdk/ScrollViewGdk.cpp:
3190         (WebCore::ScrollView::visibleContentRectConsideringExternalScrollers):
3191         (WebCore::ScrollView::scrollRectIntoViewRecursively):
3192         * platform/mac/ScrollViewMac.mm:
3193         (WebCore::ScrollView::visibleContentRect):
3194         (WebCore::ScrollView::visibleContentRectConsideringExternalScrollers):
3195         (WebCore::ScrollView::scrollRectIntoViewRecursively):
3196         (WebCore::ScrollView::updateContents):
3197         * platform/qt/ScrollViewQt.cpp:
3198         (WebCore::ScrollView::visibleContentRectConsideringExternalScrollers):
3199         (WebCore::ScrollView::scrollRectIntoViewRecursively):
3200         * platform/win/ScrollViewWin.cpp:
3201         (WebCore::ScrollView::visibleContentRectConsideringExternalScrollers):
3202         * platform/win/TemporaryLinkStubs.cpp:
3203         (WebCore::ScrollView::scrollRectIntoViewRecursively):
3204         * rendering/RenderLayer.cpp:
3205         (WebCore::RenderLayer::scrollRectToVisible):
3206        
3207 2007-03-28  Jungshik Shin  <jungshik.shin@gmail.com>
3208
3209         Reviewed  and landed by Darin
3210
3211         Get rid of some misuses of |islower| and |tolower| for non-ASCII characters.
3212         http://bugs.webkit.org/show_bug.cgi?id=13138
3213
3214         * platform/StringImpl.cpp:
3215         (WebCore::StringImpl::isLower):
3216         (WebCore::StringImpl::lower):
3217         (WebCore::StringImpl::equalIgnoringCase):
3218
3219 2007-03-28  Antti Koivisto  <antti@apple.com>
3220
3221         Reviewed by Hyatt.
3222
3223         Fix <rdar://problem/5092653>
3224         REGRESSION: Image decoding making scrolling slow
3225         
3226         If decoder gave back a null frame (which I think happens regularly if you don't have full frame 
3227         data yet for image that does not decode incrementally) m_decodedSize was incremented anyway. This
3228         led to massive growth in calculated image size and eventually made cache prune constantly. 
3229         
3230         No test, I don't know how to make one for this.
3231
3232         * platform/graphics/BitmapImage.cpp:
3233         (WebCore::BitmapImage::cacheFrame):
3234
3235 2007-03-28  Adele Peterson  <adele@apple.com>
3236
3237         Reviewed by Kevin M.
3238
3239         WebCore part of fix for <rdar://problem/5095515> VitalSource Bookshelf should not pass return statements into stringByEvaluatingJavaScriptFromString
3240
3241         * page/mac/WebCoreFrameBridge.mm: (-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
3242         Convert return value to a string.  This matches the behavior in Safari 2.0.
3243
3244 2007-03-28  Alexey Proskuryakov  <ap@webkit.org>
3245
3246         Reviewed by Darin.
3247
3248         http://bugs.webkit.org/show_bug.cgi?id=13190
3249         XPath incorrectly handles namespaces on attributes
3250
3251         * xml/XPathStep.cpp:
3252         (WebCore::XPath::Step::nodesInAxis): Added a special case for faster attribute lookup; gives a slight but 
3253         measurable performance improvement for bug 13021.
3254         (WebCore::XPath::Step::nodeMatches): Fixed NameTest for attribute nodes.
3255
3256         * xml/XPathStep.h:
3257         (WebCore::XPath::Step::NodeTest::NodeTest):
3258         (WebCore::XPath::Step::NodeTest::namespaceURI):
3259         (WebCore::XPath::Step::nodeTest):
3260         (WebCore::XPath::Step::setNodeTest):
3261         Move m_namespaceURI to NodeTest, where it belongs. Removed unused m_nodeTestData (oops!).
3262
3263         * xml/XPathGrammar.y:
3264         * xml/XPathPath.cpp:
3265         (WebCore::XPath::LocationPath::optimizeStepPair):
3266         Accounted for the above change.
3267
3268 2007-03-28  Oliver Hunt  <oliver@apple.com>
3269
3270         rs=Hyatt.
3271
3272         Rollout local changes :-/
3273
3274         * loader/Cache.cpp:
3275         (WebCore::Cache::pruneAllResources):
3276         (WebCore::Cache::remove):
3277
3278 2007-03-28  Oliver Hunt  <oliver@apple.com>
3279
3280         Reviewed by Hyatt.
3281
3282         Roll out r20511 due to incredible badness
3283
3284         * loader/Cache.cpp:
3285         (WebCore::Cache::pruneAllResources):
3286         (WebCore::Cache::remove):
3287
3288 2007-03-27  Oliver Hunt  <oliver@apple.com>
3289
3290         Reviewed by Adam.
3291
3292         Don't enforce text-selection drag delay when we are
3293         going to drag an image anyway.
3294
3295         Fixes rdar://problem/4668935
3296
3297         * page/EventHandler.cpp:
3298         (WebCore::EventHandler::handleDrag):
3299
3300 2007-03-27  Justin Garcia  <justin.garcia@apple.com>
3301
3302         Build fix
3303         
3304         * editing/markup.cpp:
3305         (WebCore::startMarkup):
3306
3307 2007-03-27  Justin Garcia  <justin.garcia@apple.com>
3308
3309         Reviewed by darin
3310         
3311         <rdar://problem/5091898> REGRESSION: GMail Editor: A line of underlined text copied with Select All pastes with wrong font family
3312         
3313         createMarkup skipped elements if they were blocks
3314         when called from moveParagraphs (because that function 
3315         must receive only inline content).  This patch adds 
3316         code to inline these blocks instead of skipping them 
3317         so that we don't lose any of the style that they 
3318         contribute to the copied markup.
3319
3320         * editing/markup.cpp:
3321         (WebCore::startMarkup): Add an inlineBlocks option.
3322         Make sure to overwrite display:block coming from
3323         a style sheet or the inline style declaration.
3324         (WebCore::createMarkup): Don't refuse to include a 
3325         specialCommonAncestor that's a block if we were asked 
3326         to include only inline content, since we can now inline 
3327         block elements in startMarkup.
3328
3329 2007-03-27  Adele Peterson  <adele@apple.com>
3330
3331         Reviewed by Hyatt.
3332
3333         Fix for <rdar://problem/5026141> REGRESSION: Aperture Viewer Flashes when switching from Index Page to Detail page in Web Gallery
3334
3335         This disables the paint that occurs after WebCore finishes loading the document.  We should reenable this when we
3336         move the dispatchDidFinishLoad delegate callback to happen around the same time as the JS onload call.  See <rdar://problem/5092361>.
3337
3338         * dom/Document.cpp: (WebCore::Document::implicitClose):
3339
3340 2007-03-26  Justin Garcia  <justin.garcia@apple.com>
3341
3342         Reviewed by darin
3343         
3344         <rdar://problem/5065910> REGRESSION: In Mail and GMail, Can't apply color to pasted line of text
3345         <rdar://problem/5084241> After deleting a paragraph of colored text, can't change text color
3346         <rdar://problem/5065605> REGRESSION: Text copied with Select All + Copy loses color on Paste
3347         <rdar://problem/4916887> GMAIL: Can't apply color to text once it becomes indented
3348
3349         * css/CSSComputedStyleDeclaration.cpp:
3350         (WebCore::CSSComputedStyleDeclaration::copyInheritableProperties):
3351         If a node's text fill color is invalid, then its children use 
3352         their font-color as their text fill color (they don't inherit 
3353         it).  Likewise for stroke color.
3354
3355 2007-03-27  Anders Carlsson  <acarlsson@apple.com>
3356
3357         * platform/ScrollBar.h:
3358         Use wtf/MathExtras.h instead of math.h
3359
3360 2007-03-27  Zack Rusin  <zrusin@trolltech.com>
3361
3362         Fix the compile - when using math.h functions
3363         actually include the header with them.
3364
3365         * platform/ScrollBar.h:
3366
3367 2007-03-27  Oliver Hunt  <oliver@apple.com>
3368
3369         Reviewed by Maciej.
3370
3371         The WebArchiver needs all the subresources of a document to be accessible
3372         through the DocLoader, so we can't remove a CachedResource simultaneously
3373         from the global Cache and all DocLoaders, just because it needs to be 
3374         reloaded in one.
3375
3376         Fixes rdar://problem/5044366
3377
3378         * loader/Cache.cpp:
3379         (WebCore::Cache::remove):
3380            Don't evict the resource from all DocLoaders
3381         * manual-tests/test-iframes-loading-the-same-resource.html: Added.
3382            Alas it wasn't possible to make a nice layout test, even this manual test
3383            is not entirely deterministic
3384
3385 2007-03-27  Mark Rowe  <mrowe@apple.com>
3386
3387         Build fix.
3388
3389         * platform/GlyphBuffer.h:
3390         (WebCore::GlyphBuffer::clear):
3391
3392 2007-03-27  Dave Hyatt  <hyatt@apple.com>
3393
3394         Add support for glyph offsets to the GlyphBuffer.
3395        
3396         Reviewed by olliej
3397
3398         * platform/Font.cpp:
3399         (WebCore::Font::drawGlyphBuffer):
3400         * platform/GlyphBuffer.h:
3401         (WebCore::GlyphBuffer::clear):
3402         (WebCore::GlyphBuffer::swap):
3403         (WebCore::GlyphBuffer::offsetAt):
3404         (WebCore::GlyphBuffer::add):
3405
3406 2007-03-27  Antti Koivisto  <antti@apple.com>
3407
3408         Keep buildbot happy.
3409
3410         * platform/mac/PlatformScrollBarMac.mm:
3411         (WebCore::PlatformScrollbar::scrollbarHit):
3412
3413 2007-03-26  Antti Koivisto  <antti@apple.com>
3414
3415         Reviewed by Darin.
3416         
3417         On Mac, support fine grained wheel events generated by trackpad and Mighty Mouse.
3418         http://bugs.webkit.org/show_bug.cgi?id=13134
3419         <rdar://problem/5076249?
3420
3421         * WebCore.exp:
3422             Export _wkGetWheelEventDeltas
3423         * page/EventHandler.cpp:
3424         (WebCore::EventHandler::handleWheelEvent):
3425             Remove (0, 0) scroll event hack, it is not needed anymore.
3426             Do per-pixel scrolling for fine grained events.
3427         * platform/PlatformWheelEvent.h:
3428         (WebCore::PlatformWheelEvent::isContinuous):
3429             Add new m_isContinuous boolean to indicate fine grained wheel events.
3430         * platform/ScrollBar.cpp:
3431         (WebCore::Scrollbar::Scrollbar):
3432         (WebCore::Scrollbar::setValue):
3433         (WebCore::Scrollbar::setSteps):
3434         (WebCore::Scrollbar::scroll):
3435         * platform/ScrollBar.h:
3436         (WebCore::Scrollbar::value):
3437             Use float to represent current position to support finer grained scrolling.
3438             Add ScrollByPixel, remove ScrollByWheel (which was same as ScrollByLine anyway)
3439         * platform/ScrollTypes.h:
3440         (WebCore::):
3441         * platform/gdk/WheelEventGdk.cpp:
3442         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3443             Initalize m_isContinuous
3444         * platform/mac/WebCoreSystemInterface.h:
3445         * platform/mac/WebCoreSystemInterface.mm:
3446             Add wkGetWheelEventDeltas for getting fine grained wheel events
3447         * platform/mac/WheelEventMac.mm:
3448         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3449             Get the wheel deltas using new wkGetWheelEventDeltas interface
3450         * platform/qt/WheelEventQt.cpp:
3451         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3452             Initalize m_isContinuous
3453         * rendering/RenderListBox.cpp:
3454         (WebCore::RenderListBox::calcHeight):
3455             Pass item height to scrollbar
3456
3457 2007-03-26  Geoffrey Garen  <ggaren@apple.com>
3458
3459         Reviewed by Darin Adler.
3460
3461         Fixed <rdar://problem/5088234> REGRESSION: Crash occurs at WebCore::Node::
3462         createRendererIfNeeded() when changing map views with MS Virtual Earth 
3463         (http://www.ziprealty.com/)
3464         
3465         The cause of the crash was the insertion of a <script> element whose
3466         script removed it from the document. The <script> element would then be 
3467         garbage when the insertion routine went on to attach() it.
3468         
3469         The solution here is to check that an element is still your child before
3470         trying to attach() it. This matches the style of checks we do elsewhere
3471         in the node insertion and removal code.
3472
3473         * dom/ContainerNode.cpp:
3474         (WebCore::ContainerNode::insertBefore):
3475         (WebCore::ContainerNode::replaceChild):
3476         (WebCore::ContainerNode::appendChild):
3477
3478 2007-03-26  David Carson  <dacarson@gmail.com>
3479
3480         Reviewed by Darin, landed by Anders.
3481
3482         Manual test case for: REGRESSION (r19559): Java applet crash
3483         http://bugs.webkit.org/show_bug.cgi?id=13142
3484         <rdar://problem/5080340>
3485
3486         * manual-tests/liveconnect-applet-get-boolean.html: Added.
3487         * manual-tests/resources/CheckerApplet.class: Added.
3488         * manual-tests/resources/CheckerApplet.java: Added.
3489
3490 2007-03-26  Mitz Pettel  <mitz@webkit.org>
3491
3492         Reviewed and landed by Darin.
3493
3494         - fix http://bugs.webkit.org/show_bug.cgi?id=13194
3495           <rdar://problem/5087738>
3496           REGRESSION: Selection rects are wrong for images in search results from images.google.com
3497
3498         Test: fast/replaced/selection-rect-in-table-cell.html
3499
3500         * rendering/RenderReplaced.cpp:
3501         (WebCore::RenderReplaced::selectionRect):
3502
3503 2007-03-26  Geoffrey Garen  <ggaren@apple.com>
3504
3505         Removed now-stale #includes of <assert.h>.
3506         
3507         * WebCorePrefix.h:
3508         * config.h:
3509         * css/CSSGrammar.y:
3510         * platform/Arena.cpp:
3511         * platform/KURL.cpp:
3512         * platform/SegmentedString.h:
3513         * rendering/DataRef.h:
3514         * rendering/RenderArena.cpp:
3515
3516 2007-03-26  Geoffrey Garen  <ggaren@apple.com>
3517
3518         Reviewed by Kevin McCulough.
3519
3520         Global replace of "assert(" with "ASSERT(" to assist debugging. Removed
3521         one instance of commented-out code containing "assert(" instead of replacing it.
3522
3523 2007-03-25  Antti Koivisto  <antti@apple.com>
3524
3525         Reviewed by Adam.
3526
3527         Fix <rdar://problem/5049842>
3528         Gmail Editor: Dragging message text in the message body results in a crash at WebCore::Frame::eventHandler()
3529
3530         Null check frame in m_dragTarget, it might be gone already.
3531
3532         * page/EventHandler.cpp:
3533         (WebCore::EventHandler::updateDragAndDrop):
3534         (WebCore::EventHandler::cancelDragAndDrop):
3535         (WebCore::EventHandler::performDragAndDrop):
3536
3537 2007-03-25  Alexey Proskuryakov  <ap@webkit.org>
3538
3539         Reviewed by Darin.
3540
3541         A partial fix for http://bugs.webkit.org/show_bug.cgi?id=13021
3542         XPath can be very slow
3543
3544         * xml/XPathExpression.cpp:
3545         (WebCore::XPathExpression::evaluate): Reset a reference to the context node, as this may prevent the whole document
3546         from being destroyed in time.
3547
3548         * dom/Attr.cpp:
3549         (WebCore::Attr::createTextChild): Instead of calling appendChild(), just do the few operations it really needs to perform.
3550         * dom/ContainerNode.h:
3551         (WebCore::ContainerNode::fastSetFirstChild):
3552         (WebCore::ContainerNode::fastSetLastChild):
3553         Added operations that let Attr hack internal ContainerNode data (evil, but fast!).
3554
3555         * xml/XPathStep.cpp:
3556         (WebCore::XPath::Step::evaluate):
3557         (WebCore::XPath::Step::nodesInAxis):
3558         (WebCore::XPath::Step::nodeMatches):
3559         * xml/XPathStep.h:
3560         Merged node testing into axis enumeration. This saves a lot of Vector resizing and passing, and is necessary for future 
3561         optimizations (sometimes, we can just pick the single result node instead of enumerating and filtering the whole axis).
3562
3563 2007-03-24  Mitz Pettel  <mitz@webkit.org>
3564
3565         Reviewed by Darin.
3566
3567         - fix http://bugs.webkit.org/show_bug.cgi?id=13156
3568           REGRESSION (r19621): Pasting breakable content where wrapped line is too long to fit in a textarea fails to draw a horizontal scrollbar
3569
3570         Test: fast/text/midword-break-after-breakable-char.html
3571
3572         Breaking in the middle of the word
3573         is allowed only if no breaking opportunity between words has occurred yet. The
3574         first position on the line should not be considered "between words" even if
3575         it is a breaking opportunity.
3576         
3577         * rendering/bidi.cpp:
3578         (WebCore::RenderBlock::findNextLineBreak): Changed according to the above. Also
3579         cleaned up a couple of lines.
3580
3581 2007-03-24  David Hyatt  <hyatt@apple.com>
3582
3583         Fix for bugzilla bug 13187, place a hard limit on the amount of decoded data that WebCore will keep
3584         around even on live pages (pages being displayed in tabs/windows or in the back/forward cache).
3585         Images will decode to paint and once the decoded data exceeds the cache size, the decoded data will be
3586         tossed.
3587
3588         Refine the flushing algorithm to apply the two-pass decode/evict model to each LRU-SP queue individually, rather
3589         than to all the lists at once.  This allows the cache to evict large encoded resources before flushing small
3590         or frequently accessed decoded onces.
3591
3592         Added information on live/decoded data to the cache statistics.
3593
3594         Reviewed by darin
3595
3596         * loader/Cache.cpp:
3597         (WebCore::Cache::Cache):
3598         (WebCore::Cache::pruneLiveResources):
3599         (WebCore::Cache::pruneAllResources):
3600         (WebCore::Cache::setMaximumSize):
3601         (WebCore::Cache::remove):
3602         (WebCore::Cache::lruListFor):
3603         (WebCore::Cache::removeFromLRUList):
3604         (WebCore::Cache::insertInLRUList):
3605         (WebCore::Cache::liveLRUListFor):
3606         (WebCore::Cache::removeFromLiveResourcesList):
3607         (WebCore::Cache::insertInLiveResourcesList):
3608         (WebCore::Cache::addToLiveResourcesSize):
3609         (WebCore::Cache::removeFromLiveResourcesSize):
3610         (WebCore::Cache::adjustSize):
3611         (WebCore::Cache::getStatistics):
3612         * loader/Cache.h:
3613         (WebCore::Cache::TypeStatistic::TypeStatistic):
3614         * loader/CachedImage.cpp:
3615         (WebCore::CachedImage::decodedSizeWillChange):
3616         (WebCore::CachedImage::decodedSizeChanged):
3617         * loader/CachedImage.h:
3618         * loader/CachedResource.cpp:
3619         (WebCore::CachedResource::CachedResource):
3620         (WebCore::CachedResource::ref):
3621         (WebCore::CachedResource::deref):
3622         (WebCore::CachedResource::setEncodedSize):
3623         (WebCore::CachedResource::liveResourceAccessed):
3624         * loader/CachedResource.h:
3625         (WebCore::CachedResource::liveAccessCount):
3626         (WebCore::CachedResource::resetLiveAccessCount):
3627         (WebCore::CachedResource::increaseLiveAccessCount):
3628         * platform/graphics/BitmapImage.cpp:
3629         (WebCore::BitmapImage::destroyDecodedData):
3630         (WebCore::BitmapImage::cacheFrame):
3631         * platform/graphics/ImageObserver.h:
3632         * rendering/RenderBox.cpp:
3633         (WebCore::RenderBox::paintBackgroundExtended):
3634         * rendering/RenderImage.cpp:
3635         (WebCore::RenderImage::paint):
3636         * rendering/RenderListMarker.cpp:
3637         (WebCore::RenderListMarker::paint):
3638         * rendering/RenderObject.cpp:
3639         (WebCore::RenderObject::paintBorderImage):
3640
3641 2007-03-24  Darin Adler  <darin@apple.com>
3642
3643         Reviewed by Mitz.
3644
3645         - fix http://bugs.webkit.org/show_bug.cgi?id=13123
3646           CSS selectors that use :lang, :not, and namespaces do not serialize correctly
3647
3648         Test: fast/css/css-selector-text.html
3649
3650         * css/CSSSelector.cpp: (WebCore::CSSSelector::selectorText): Add the namespace
3651         prefix for tag or attribute names, the sub-selector for :not, and the argument
3652         for :lang.
3653
3654 2007-03-24  Brady Eidson  <beidson@apple.com>
3655
3656         Reviewed by Adam
3657
3658         <rdar://problem/5086210> - Move RetainPtr to WTF
3659
3660         * ForwardingHeaders/wtf/RetainPtr.h: Added.
3661         * WebCore.xcodeproj/project.pbxproj: Removed WebCore/RetainPtr.h
3662         
3663         * history/HistoryItem.h: Changed #include to <wtf/RetainPtr.h>
3664         * history/PageCache.h: Ditto
3665         * page/mac/WebCoreFrameBridge.mm: Ditto
3666         * platform/ContextMenu.h: Ditto
3667         * platform/ContextMenuItem.h: Ditto
3668         * platform/DragImage.h: Ditto
3669         * platform/FileChooser.h: Ditto
3670         * platform/PlatformKeyboardEvent.h: Ditto
3671         * platform/PopupMenu.h: Ditto
3672         * platform/SharedBuffer.h: Ditto
3673         * platform/cf/RetainPtr.h: Removed.
3674         * platform/graphics/Icon.h: Changed #include
3675         * platform/mac/ClipboardMac.h: Ditto
3676         * platform/mac/PasteboardMac.mm: Ditto
3677         * platform/mac/WidgetMac.mm: Ditto
3678         * platform/network/AuthenticationChallenge.h: Ditto
3679         * platform/network/ResourceError.h: Ditto
3680         * platform/network/ResourceHandle.h: Ditto
3681         * platform/network/ResourceRequest.h: Ditto
3682         * platform/network/ResourceResponse.h: Ditto
3683         * rendering/RenderThemeMac.mm: Ditto
3684
3685 2007-03-24  Mitz Pettel  <mitz@webkit.org>
3686
3687         Fix for <rdar://problem/5086797>, layoutPending is now reporting incorrect results, which will lead
3688         to all sorts of layout issues.  This is in bugzilla as 13179.
3689
3690         Reviewed by hyatt
3691
3692         - fix http://bugs.webkit.org/show_bug.cgi?id=13179
3693           REGRESSION (r20410): In debug builds, loading a certain page is suspended until redisplay is forced
3694
3695         Moved the root->needsLayout() check from layoutPending() to needsLayout()
3696         to restore the behavior before r20324.
3697
3698         * page/FrameView.cpp:
3699         (WebCore::FrameView::layoutPending):
3700         (WebCore::FrameView::needsLayout):
3701
3702 2007-03-24  Mitz Pettel  <mitz@webkit.org>
3703
3704         Reviewed by Adele.
3705
3706         - fix http://bugs.webkit.org/show_bug.cgi?id=13180
3707               <rdar://problem/5084478>
3708           Another debug build crash from ASSERTION FAILED: !needsLayout()
3709
3710         No test possible because updateRendering() is always called after script
3711         execution.
3712
3713         * page/FrameView.cpp:
3714         (WebCore::FrameView::layout): Get the layout root after calling recalcStyle()
3715         since a style recalc may result in needing to do start layout at the root.
3716
3717 2007-03-24  Nikolas Zimmermann  <zimmermann@kde.org>
3718
3719         Not reviewed. Build fix.
3720
3721         Fix FloatRect vs. IntRect confusion.
3722
3723         * rendering/RenderSVGImage.cpp:
3724         (WebCore::RenderSVGImage::nodeAtPoint):
3725
3726 2007-03-25  Mark Rowe  <mrowe@apple.com>
3727
3728         Fix incorrect radar number.
3729
3730         * platform/network/mac/ResourceHandleMac.mm:
3731         (-[WebCoreResourceHandleAsDelegate connection:willCacheResponse:]):
3732
3733 2007-03-23  Nikolas Zimmermann  <zimmermann@kde.org>
3734
3735         Reviewed by Oliver.
3736
3737         Fix all known RenderSVGImage problems.
3738
3739         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12126 (RenderSVGImage seems to suffer from integer overflow)
3740         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12442 (raster images disappearing during script execution (SVG))
3741         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12572 (WebKit does not properly invalidate image region after image load)
3742
3743         Added test: svg/custom/scrolling-embedded-svg-file-image-repaint-problem.html
3744
3745         In RenderSVGImage::paint, do not call shouldPaint() as this will never work properly for SVG renderers, as shouldPaint
3746         doesn't take into account any special SVG transformation (localTransform/absoluteTransform). Just remove the call.
3747
3748         Fix hit detection on RenderSVGImage - it didn't work properly at all. No idea why I didn't notice before.
3749         Thanks Andreas Neumann once again for writing excellent bug reports and pointing me to them :-)
3750
3751         The carto.net navigation tools work as expected now, and also the "dock like" image effect example.
3752
3753         * rendering/RenderSVGImage.cpp:
3754         (WebCore::RenderSVGImage::paint):
3755         (WebCore::RenderSVGImage::nodeAtPoint):
3756
3757 2007-03-24  Mitz Pettel  <mitz@webkit.org>
3758
3759         Reviewed by Dave Hyatt.
3760
3761         - http://bugs.webkit.org/show_bug.cgi?id=13177
3762           Suppress control characters in the ATSUI code path
3763
3764         * platform/mac/FontMac.mm:
3765         (WebCore::overrideLayoutOperation):
3766         (WebCore::ATSULayoutParameters::initialize):
3767
3768 2007-03-24  David Hyatt  <hyatt@apple.com>
3769
3770         Fix for <rdar://problem/5086400>, images scrolled offscreen continue to animate.  Safari 2 would
3771         halt animations when images were no longer visible.
3772
3773         Reviewed by mjs, olliej
3774
3775         * platform/graphics/BitmapImage.cpp:
3776         (WebCore::BitmapImage::advanceAnimation):
3777
3778 2007-03-24  David Hyatt  <hyatt@apple.com>
3779
3780         Fix for <rdar://problem/508328>, sluggish text entry in search field.  Make sure
3781         our size actually changed before we decide to do a full repaint because of background/border
3782         complexities.
3783
3784         Reviewed by aroben
3785
3786         * rendering/RenderObject.cpp:
3787         (WebCore::RenderObject::repaintAfterLayoutIfNeeded):
3788
3789 2007-03-23  Dave Hyatt  <hyatt@apple.com>
3790
3791         Fix for <rdar://problem/5048219>, spurious glyphs in gmail.   This is bugzilla bug 13136, which
3792         will remain open to cover patching the complex text path.
3793         
3794         Reviewed by aroben
3795
3796         * platform/Font.cpp:
3797         (WebCore::Font::glyphDataForCharacter):
3798         * platform/Font.h:
3799         (WebCore::Font::treatAsZeroWidthSpace):
3800         * platform/GlyphPageTreeNode.cpp:
3801         (WebCore::GlyphPageTreeNode::initializePage):
3802
3803 2007-03-23  Mitz Pettel  <mitz@webkit.org>
3804
3805         Reviewed by Adele.
3806
3807         - fix http://bugs.webkit.org/show_bug.cgi?id=13153
3808           REGRESSION: Visual highlighting of pre-populated blank line in textarea is broken
3809
3810         - fix a bug where selecting across a soft line break did not highlight to
3811           the end of the first line if it contained skipped whitespace
3812
3813         Test: fast/text/selection-hard-linebreak.html
3814
3815         * rendering/InlineTextBox.cpp:
3816         (WebCore::InlineTextBox::selectionState): Changed to treat a selection that ends on the
3817         end of a hard line break as if it ends after the line break. Fixed the case of a selection
3818         that starts and ends in the same text object as the box but does not intersect it
3819         to return SelectionNone instead of selectionBoth.
3820
3821 2007-03-23  Mitz Pettel  <mitz@webkit.org>
3822
3823         Reviewed by Adele.
3824
3825         - fix http://bugs.webkit.org/show_bug.cgi?id=13124
3826           REGRESSION: Reproducible crash in Widget::getView
3827
3828         Test: fast/frames/hover-timer-crash.html
3829
3830         * page/Frame.cpp:
3831         (WebCore::Frame::setView): Added a call to EventHandler::clear().
3832
3833 2007-03-23  Justin Garcia  <justin.garcia@apple.com>
3834
3835         Reviewed by adele
3836
3837         <rdar://problem/5078739> 
3838         Crash in in ReplaceSelectionCommand if the fragment contains only a style span
3839
3840         * editing/ReplaceSelectionCommand.cpp:
3841         (WebCore::ReplaceSelectionCommand::doApply): Check 
3842         for an empty fragment after removing a redundant
3843         style span instead of before.
3844
3845 2007-03-23  David Hyatt  <hyatt@apple.com>
3846
3847         <rdar://problem/5085063>
3848
3849         Fix non-looping animation on cuteoverload.com. Just always flush
3850         decoded data for large animated images to avoid our cache getting
3851         out of sync with the image source.
3852
3853         Reviewed by ggaren
3854
3855         * platform/graphics/BitmapImage.cpp:
3856         (WebCore::BitmapImage::advanceAnimation):
3857
3858 2007-03-23  Adele Peterson  <adele@apple.com>
3859
3860         Reviewed by Darin.
3861
3862         Fix for <rdar://problem/5061024> REGRESSION: Returning false from onkeypress event on Input is ignored when key is Tab
3863         http://bugs.webkit.org/show_bug.cgi?id= 13020
3864
3865         No known way to add a layout test for this.  We would need a way to know exactly how the event was consumed.
3866
3867         * page/EventHandler.cpp: (WebCore::EventHandler::defaultKeyboardEventHandler):
3868           If the keypress event has its default behavior prevented, then we should consider the keydown event handled.
3869
3870 2007-03-23  Justin Garcia  <justin.garcia@apple.com>
3871
3872         Reviewed by darin
3873
3874         <rdar://problem/5080333> 
3875         REGRESSION: Selection changes when changing the alignment of an image
3876         
3877         Regression occurred when we started using moveParagraphs
3878         to move content in applyBlockStyle.  moveParagraphs 
3879         moves by copying, deleting and reinserting content, and
3880         so must be accompanied by selection preservation code.
3881         That code uses rangeFromLocationAndLength and rangeLength,
3882         which use TextIterators, which don't emit anything for images 
3883         and other replaced elements, causing this bug.
3884
3885         * editing/ApplyStyleCommand.cpp:
3886         (WebCore::ApplyStyleCommand::applyBlockStyle): Ask rangeLength 
3887         and rangeFromLocationAndLength to request that their
3888         TextIterators emit spaces for replaced elements.
3889         Use rangeCompliantEquivalent()s when creating a Range from
3890         VisiblePositions, since some VisiblePositions have illegal
3891         deepEquivalent()s.
3892         * editing/CompositeEditCommand.cpp:
3893         (WebCore::CompositeEditCommand::moveParagraphs): Ditto.
3894         * editing/TextIterator.cpp:
3895         (WebCore::TextIterator::TextIterator):
3896         (WebCore::TextIterator::handleReplacedElement): Emit
3897         a space if requested.
3898         (WebCore::TextIterator::representNodeOffsetZero): Emit
3899         ranges before m_node, not around m_lastTextNode.  These
3900         ranges should represent the part of the document associated
3901         with the emitted character. 
3902         (WebCore::TextIterator::rangeLength): Take in the new bool.
3903         (WebCore::TextIterator::rangeFromLocationAndLength): Ditto.
3904         Also, don't loop an extra time after finding the end of the
3905         range when we're looking for zero length ranges.  This appeared
3906         to be a workaround for the bugs fixed in representNodeOffsetZero
3907         in this patch.
3908         * editing/TextIterator.h:
3909
3910 2007-03-24  Mark Rowe  <mrowe@apple.com>
3911
3912         Rubber-stamped by Darin.
3913
3914         * Configurations/WebCore.xcconfig: Remove unnecessary INFOPLIST_PREPROCESS.
3915
3916 2007-03-23  Darin Adler  <darin@apple.com>
3917
3918         * html/HTMLBodyElement.cpp: Fix comment typo.
3919
3920 2007-03-23  Adam Treat  <adam@staikos.net>
3921
3922         Reviewed and committed by George.
3923
3924         Patch from Adam Treat to make the Qt build work without SVG and XSLT.
3925         XMLNames is required in any case.
3926
3927         * WebCore.pro:
3928
3929 2007-03-23  Darin Adler  <darin@apple.com>
3930
3931         Reviewed by Hyatt.
3932
3933         - <rdar://problem/5074439> handle margins on frame and iframe elements
3934           without involving FrameView, FrameLoader, etc.
3935
3936         * html/HTMLBodyElement.cpp: (WebCore::HTMLBodyElement::insertedIntoDocument):
3937         Grab the margin from the frame directly here. There was no real benefit
3938         to doing this via FrameView. Later we can delete quite a bit of unneeded code
3939         here and in WebKit that exists only to set up the margin values in FrameView,
3940         which are now unused.
3941
3942 2007-03-23  Adele Peterson  <adele@apple.com>
3943
3944         Reviewed by Darin.
3945
3946         Fix for <rdar://problem/5080428> REGRESSION: getting value for hidden input element fails after the fix for Bug 11866
3947         http://bugs.webkit.org/show_bug.cgi?id=13121
3948
3949         Rolled out the change for 11866 that made hidden input elements store the value separately from the value attribute.
3950         Added an m_originalValue field that gets set when the element is done being parsed (in closeRenderer).  In reset,
3951         use the m_originalValue for hidden input elements.
3952
3953         * html/HTMLInputElement.cpp:
3954         (WebCore::HTMLInputElement::closeRenderer):
3955         (WebCore::HTMLInputElement::reset):
3956         (WebCore::HTMLInputElement::setValue):
3957         (WebCore::HTMLInputElement::storesValueSeparateFromAttribute):
3958         * html/HTMLInputElement.h:
3959
3960 2007-03-23  Mitz Pettel  <mitz@webkit.org>
3961
3962         Reviewed by Dave Hyatt.
3963
3964         - fix http://bugs.webkit.org/show_bug.cgi?id=13157
3965               <rdar://problem/5083995>
3966           List markers positioned incorrectly and don't repaint properly on Oxford homepage
3967
3968         Test: fast/lists/marker-image-error.html
3969
3970         * rendering/RenderListMarker.cpp:
3971         (WebCore::RenderListMarker::imageChanged): Mark ourselves for relayout if
3972         the image failed to load, since that means we will use a bullet instead.
3973
3974 2007-03-23  Zack Rusin  <zrusin@trolltech.com>
3975
3976         Fix the compile.
3977
3978         * platform/graphics/qt/ImageSourceQt.cpp:
3979
3980 2007-03-22  Dave Hyatt  <hyatt@apple.com>
3981
3982         Fix for <rdar://problem/5083072>.
3983
3984         * page/Frame.cpp:
3985         (WebCore::Frame::setPrinting):
3986         (WebCore::Frame::forceLayoutWithPageWidthRange):
3987         * page/Frame.h:
3988         * page/mac/WebCoreFrameBridge.mm:
3989         (-[WebCoreFrameBridge forceLayoutWithMinimumPageWidth:maximumPageWidth:adjustingViewSize:]):
3990
3991 2007-03-22  Anders Carlsson  <acarlsson@apple.com>
3992
3993         Reviewed by Ada.
3994
3995         <rdar://problem/5074974>
3996         CrashTracer: [USER] repro crash in Safari at com.apple.WebCore: WebCore::FrameLoader::activeDocumentLoader const + 6
3997         
3998         * loader/mac/NetscapePlugInStreamLoaderMac.mm:
3999         (WebCore::NetscapePlugInStreamLoader::didReceiveResponse):
4000         Don't use ResourceResponse:isHTTP here since that only looks at the protocol instead of if the response came from a 
4001         HTTP server (and not a web archive).
4002
4003 2007-03-22  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
4004
4005         Not reviewed - gdk build fix.
4006
4007         * platform/graphics/cairo/ImageSourceCairo.cpp:
4008
4009 2007-03-22  Dave Hyatt  <hyatt@apple.com>
4010
4011         Fix for <rdar://problem/5083473>.  Make sure wheeling still forwards to the frame view even
4012         when no node is hit.  Technically not ever hitting a node is a regression from the RenderView
4013         size changes (making it be the size of the initial containing block according to CSS2.1), but
4014         we should still handle this case gracefully in case it comes up again.
4015        
4016         Reviewed by olliej
4017
4018         * page/EventHandler.cpp:
4019         (WebCore::EventHandler::handleWheelEvent):
4020
4021 2007-03-22  Justin Garcia  <justin.garcia@apple.com>
4022
4023         Reviewed by kevin
4024
4025         <rdar://problem/5081257> 
4026         REGRESSION: New Mail signatures start out empty
4027
4028         * editing/VisiblePosition.cpp:
4029         (WebCore::VisiblePosition::canonicalPosition): Allow
4030         descent from positions inside the document into an 
4031         editable body.
4032
4033 2007-03-22  Brady Eidson  <beidson@apple.com>
4034
4035         Reviewed by Adele and John
4036
4037         <rdar://5043528> - Prepare for new API
4038         
4039         * platform/network/ResourceHandle.cpp:
4040         (WebCore::ResourceHandle::clearAuthentication): Clear CF type
4041
4042 2007-03-22  Beth Dakin  <bdakin@apple.com>
4043
4044         Patch by Hyatt, reviewed and committed by me.
4045
4046         Does not reproduce consistently, so a layout test does not seem 
4047         possible.
4048
4049         Fix for <rdar://problem/5082421> Constantly hitting ASSERT(!
4050         needsLayout()) in RenderView::paint()
4051
4052         * page/FrameView.cpp:
4053         (WebCore::FrameView::layoutPending): It is not enough to ask if the 
4054         layout timer is active. There may be times that we don't have a 
4055         body yet so we cannot schedule layout yet, but the root still needs 
4056         layout.  
4057
4058 2007-03-22  John Sullivan  <sullivan@apple.com>
4059
4060         Reviewed by Darin
4061         
4062         Followup for recent fix to 5079700, found by assertion added to Safari.
4063
4064         * page/mac/FrameMac.mm:
4065         (WebCore::Frame::searchForLabelsBeforeElement):
4066         Fixed another place in this method where an empty NSString was being returned instead of nil.
4067         Cleaned up the style a little too.
4068
4069 2007-03-22  David Hyatt  <hyatt@apple.com>
4070
4071         Remove unnecessary destroyFrameAtIndex call.  Now that we throw away
4072         the image source, it is no longer needed.
4073
4074         Reviewed by beth
4075
4076         * platform/graphics/BitmapImage.cpp:
4077         (WebCore::BitmapImage::destroyDecodedData):
4078
4079 2007-03-22  David Harrison  <harrison@apple.com>
4080
4081         Reviewed by Geoff, Darin.
4082
4083         <rdar://problem/5077892> In RapidWeaver 3.5.1, a crash occurs when attempting to load Safari Bookmarks in iMedia Browser
4084         
4085         * platform/mac/ThreadCheck.mm:
4086         (WebCore::_WebCoreThreadViolationCheck):
4087         Change default on Tiger to NSLog rather than raise an exception.
4088
4089 2007-03-22  Darin Adler  <darin@apple.com>
4090
4091         Reviewed by Brady.
4092
4093         - use binary_search instead of hash table; slightly better performance and
4094           less memory use
4095
4096         * platform/network/ResourceHandle.cpp: (WebCore::ResourceHandle::portAllowed):
4097         Use binary_search.
4098
4099 2007-03-22  Darin Adler  <darin@apple.com>
4100
4101         Reviewed by Adele.
4102
4103         - fix <rdar://problem/5074630> detachChildren call should move from WebKit to WebCore
4104
4105         * loader/FrameLoader.cpp: (WebCore::FrameLoader::setDocumentLoader):
4106         Add a call to detachChildren() after the call to prepareForDataSourceReplacement().
4107         There was no reason for this crucial loading step to be left to the client.
4108
4109 2007-03-22  David Hyatt  <hyatt@apple.com>
4110
4111         Minor refactoring and cleanup of the bridge calls that want to control layout settings on the RenderView.
4112         Have the bridge talk through the FrameView instead of just asking for the RenderView directly.
4113
4114         Add an assert to help catch situations where the RenderView needs layout at paint time, since this is a known
4115         catastrophic scenario that will (much of the time) result in a crash in RenderTableSection::paint.
4116
4117         Reviewed by aroben
4118
4119         * page/FrameView.cpp:
4120         (WebCore::FrameView::adjustViewSize):
4121         (WebCore::FrameView::needsLayout):
4122         (WebCore::FrameView::setNeedsLayout):
4123         * page/FrameView.h:
4124         * page/mac/WebCoreFrameBridge.mm:
4125         (-[WebCoreFrameBridge needsLayout]):
4126         (-[WebCoreFrameBridge setNeedsLayout]):
4127         * rendering/RenderView.cpp:
4128         (WebCore::RenderView::paint):
4129
4130 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
4131
4132         Reviewed by Beth Dakin.
4133         
4134         Re-worked the fix in r20375. 'M' and 'm' are not the only commands that
4135         accept "extra" coordinates -- virtually all commands accept them.
4136
4137         * ksvg2/svg/SVGParserUtilities.cpp:
4138         (WebCore::SVGPathParser::parseSVG):
4139
4140 2007-03-21  David Harrison  <harrison@apple.com>
4141
4142         Reviewed by hyatt.
4143
4144         <rdar://problem/5072460> CrashTracer: [USER] 1 crashes in Xcode at com.apple.ImageIO.framework: getBandProcPNG + 168
4145
4146         An NSData object was being alloc/init'd, then returned callers who cast the pointer as a
4147         CFDataRef, including calling CFRelease on it. The problem is that under garbage collection, the NS
4148         retain count is ignored (it's always 0), but the CFRetain and CFRelease are not ignored. This
4149         caused the object to be over-released. The solution that works in both GC and non-GC is to "transfer"
4150         the initial NS retain count to the CF retain count, using HardRetainWithNSRelease.
4151         
4152         The creator of the NSData was SharedBuffer::createNSData. The callers were PDFDocumentImage::dataChanged()
4153         and ImageSource::setData(). This particular crash involved the ImageSource::setData() case.
4154
4155         * platform/SharedBuffer.h:
4156         Declare createCFData().
4157         
4158         * platform/graphics/cg/ImageSourceCG.cpp:
4159         (WebCore::ImageSource::setData):
4160         Call createCFData instead of createNSData.
4161         
4162         * platform/graphics/cg/PDFDocumentImage.cpp:
4163         (WebCore::PDFDocumentImage::dataChanged):
4164         Call createCFData instead of createNSData.
4165         
4166        * platform/mac/SharedBufferMac.mm:
4167         (WebCore::SharedBuffer::createCFData):
4168         Implement createCFData(). Use HardRetainWithNSRelease for gc safety.
4169         
4170 2007-03-21  Mitz Pettel  <mitz@webkit.org>
4171
4172         Reviewed by Darin.
4173
4174         - fix http://bugs.webkit.org/show_bug.cgi?id=13145
4175           Regression: Scrollbar not resizing after display none
4176
4177         Test: fast/dynamic/view-overflow.html
4178
4179         * rendering/RenderView.cpp:
4180         (WebCore::RenderView::layout): Reset overflowHeight() and overflowWidth()
4181         before calling docHeight() and docWidth(), since the former act as a lower
4182         bound for the latter.
4183
4184 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
4185
4186         Reviewed by Beth Dakin.
4187         
4188         A little cleanup based work I've been doing on the SVG parsers.
4189
4190         * ksvg2/svg/SVGParserUtilities.h:
4191         (WebCore::skipString):
4192         * ksvg2/svg/SVGPreserveAspectRatio.cpp: Moved checkString into
4193         SVGParserUtilities.h, so it could be with all its friends. Renamed 
4194         "checkString" to "skipString" to match the rest of the code and to be 
4195         clear about which functions move the buffer pointer.
4196         (WebCore::SVGPreserveAspectRatio::parsePreserveAspectRatio):
4197         * ksvg2/svg/SVGTransformable.cpp:
4198         (WebCore::SVGTransformable::parseTransformAttribute): Changed gotos into 
4199         returns. Removed unnecessary magic number.
4200
4201 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
4202
4203         Reviewed by Beth Dakin.