WebCore:
[WebKit-https.git] / WebCore / ChangeLog
1 2006-04-24  Maciej Stachowiak  <mjs@apple.com>
2
3         Reviewed by Darin.
4
5         - move more code from WebFrameBridge to WebCoreFrameBridge
6
7         * bridge/mac/WebCoreFrameBridge.h:
8         * bridge/mac/WebCoreFrameBridge.mm:
9         (-[WebCoreFrameBridge domain]):
10         (-[WebCoreFrameBridge canTargetLoadInFrame:]):
11         (-[WebCoreFrameBridge fini]):
12         (-[WebCoreFrameBridge dealloc]):
13         (-[WebCoreFrameBridge finalize]):
14         (_getPreSmartSet):
15         (_getPostSmartSet):
16         (-[WebCoreFrameBridge isCharacterSmartReplaceExempt:isPreviousCharacter:]):
17         (-[WebCoreFrameBridge _retrieveKeyboardUIModeFromPreferences:]):
18         (-[WebCoreFrameBridge keyboardUIMode]):
19
20 2006-04-24  Adele Peterson  <adele@apple.com>
21
22         Reviewed by Tim O.
23
24         Fix to send textFieldDidBeginEditing on the first editing change instead of on focus.
25         This matches our old behavior.
26
27         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::dispatchFocusEvent):
28         * rendering/RenderTextField.cpp: (WebCore::RenderTextField::subtreeHasChanged):
29
30 2006-04-24  Beth Dakin  <bdakin@apple.com>
31
32         Reviewed by Eric.
33
34         Fix for <rdar://problem/4513383> REGRESSION: Crash in 
35         WebCore::shouldEmitTabBeforeNode() when iterating through document 
36         text
37
38         * editing/TextIterator.cpp:
39         (WebCore::shouldEmitTabBeforeNode): Need to nil-check the renderer.
40
41 2006-04-23  Geoffrey Garen  <ggaren@apple.com>
42
43         Reviewed by Maciej.
44
45         * bindings/scripts/CodeGeneratorJS.pm: Removed confusing 'JS' prefix
46         from string descriptions of DOM prototypes, so the prototype for, e.g.,
47         Document serializes as 'Document,' not 'JSDocument.'
48
49 2006-04-23  Geoffrey Garen  <ggaren@apple.com>
50
51         Reviewed by Darin.
52
53         - Took the larger snippets of C++ in the code generator and broke
54         them into HERE documents in the hopes of improving readability.
55         
56         * bindings/scripts/CodeGeneratorJS.pm: I indented variable names
57         level with their corresponding HERE documents to clearly
58         "sandwich" the HERE documents between opening and closing EOF
59         statements.
60
61 2006-04-23  Maciej Stachowiak  <mjs@apple.com>
62
63         Reviewed by Darin.
64         
65         - push WebFileButton and WebStringTruncator code down to WebCore
66         http://bugzilla.opendarwin.org/show_bug.cgi?id=8552
67
68         * WebCore.exp:
69         * WebCore.xcodeproj/project.pbxproj:
70         * bridge/mac/WebCoreFrameBridge.h:
71         * bridge/mac/WebCoreStringTruncator.h: Added.
72         * bridge/mac/WebCoreStringTruncator.mm: Added.
73         (stringWidth):
74         (truncateString):
75         (+[WebCoreStringTruncator widthOfString:font:]):
76         * bridge/mac/WebCoreViewFactory.h:
77         * kwq/KWQFileButton.h:
78         * kwq/KWQFileButton.mm:
79         (-[WebFileChooserButton initWithWidget::]):
80         (-[WebCoreFileButton positionButton]):
81         (-[WebCoreFileButton initWithWidget:]):
82         (-[WebCoreFileButton initWithFrame:]):
83         (-[WebCoreFileButton dealloc]):
84         (-[WebCoreFileButton isFlipped]):
85         (-[WebCoreFileButton drawRect:]):
86         (-[WebCoreFileButton updateLabel]):
87         (-[WebCoreFileButton setFilename:]):
88         (-[WebCoreFileButton filename]):
89         (-[WebCoreFileButton setFrameSize:]):
90         (-[WebCoreFileButton bestVisualFrameSizeForCharacterCount:]):
91         (-[WebCoreFileButton visualFrame]):
92         (-[WebCoreFileButton setVisualFrame:]):
93         (-[WebCoreFileButton baseline]):
94         (-[WebCoreFileButton beginSheet]):
95         (-[WebCoreFileButton chooseFilename:]):
96         (-[WebCoreFileButton cancel]):
97         (-[WebCoreFileButton chooseButtonPressed:]):
98         (-[WebCoreFileButton mouseDown:]):
99         (-[WebCoreFileButton acceptsFirstResponder]):
100         (-[WebCoreFileButton becomeFirstResponder]):
101         (-[WebCoreFileButton nextKeyView]):
102         (-[WebCoreFileButton previousKeyView]):
103         (-[WebCoreFileButton nextValidKeyView]):
104         (-[WebCoreFileButton previousValidKeyView]):
105         (-[WebCoreFileButton performClick]):
106         (-[WebFileChooserButton initWithWidget:]):
107         (-[WebFileChooserButton nextValidKeyView]):
108         (-[WebFileChooserButton previousValidKeyView]):
109         (-[WebFileChooserButton resignFirstResponder]):
110         (KWQFileButton::KWQFileButton):
111         (KWQFileButton::setFilename):
112         (KWQFileButton::click):
113         (KWQFileButton::sizeForCharacterWidth):
114         (KWQFileButton::frameGeometry):
115         (KWQFileButton::setFrameGeometry):
116         (KWQFileButton::baselinePosition):
117         (KWQFileButton::filenameChanged):
118
119 2006-04-23  Maciej Stachowiak  <mjs@apple.com>
120
121         Reviewed by Eric.
122
123         - remove WebCoreCookieAdapter, instead make mac implementation of
124         CookieJar use Foundation directly.
125
126         * WebCore.exp:
127         * WebCore.xcodeproj/project.pbxproj:
128         * platform/mac/CookieJar.mm:
129         (WebCore::cookies):
130         (WebCore::setCookies):
131         (WebCore::cookiesEnabled):
132         * platform/mac/WebCoreCookieAdapter.h: Removed.
133         * platform/mac/WebCoreCookieAdapter.m: Removed.
134
135 2006-04-21  Rob Buis  <buis@kde.org>
136
137         Reviewed by hyatt.  Landed by eseidel.
138
139         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8170:
140         SVG CSS property values with extra items do not get treated
141         as invalid (they should)
142
143         Fixes the handling of invalid svg css properties similar
144         to how invalid html css properties are handled, ie. discard
145         the property if there are more values in the value list than
146         expected.
147
148         Test: svg/custom/invalid-css.svg
149
150         * ksvg2/css/SVGCSSParser.cpp:
151         (WebCore::CSSParser::parseSVGValue):
152
153 2006-04-23  Michael Emmel  <mike.emmel@gmail.com>
154
155         Reviewed by mjs.  Landed by eseidel.
156
157         http://bugzilla.opendarwin.org/show_bug.cgi?id=8517
158         No test necessary, no functional change.
159
160         * DerivedSources.make: use VPATH more consistently.
161
162 2006-04-23  Jon Shier  <jshier@iastate.edu>
163         
164         Reviewed by ggaren.  Landed by eseidel.
165         
166         - Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8511
167         onerror JS property does not register listener properly
168
169         Test: fast/dom/onerror-img.html       
170  
171         * bindings/js/kjs_dom.cpp:  
172         (KJS::DOMEventTargetNode::getValueProperty): changed khtmlErrorEvent to errorEvent.
173         (KJS::DOMEventTargetNode::putValueProperty): ditto.
174         * bindings/js/kjs_window.cpp:
175         (KJS::Window::getValueProperty): ditto.
176         (KJS::Window::put):
177         * dom/EventNames.h: Removed khtmlError macro.
178         
179 2006-04-23  Eric Seidel  <eseidel@apple.com>
180
181         Reviewed by hyatt.
182
183         Reproducible crasher with <li value=1234567890 type=A>
184         http://bugzilla.opendarwin.org/show_bug.cgi?id=8542
185
186         Fixed our alphabetical list generation to match WinIE (not FireFox)
187         Previously our alphabetical lists were completely wrong past 26 items.
188
189         Tests:
190         * fast/lists/alpha-list-wrap.html
191         * fast/lists/li-style-alpha-huge-value-crash.html
192
193         * rendering/render_list.cpp:
194         (WebCore::toLetterString):
195         (WebCore::toHebrew):
196         (WebCore::RenderListMarker::calcMinMaxWidth):
197
198 2006-04-22  Geoffrey Garen  <ggaren@apple.com>
199
200         Reviewed by Darin.
201
202         - Finished autogeneration of Element
203
204         * bindings/js/kjs_dom.cpp: Removed DOMElement class
205         * bindings/js/kjs_dom.h: ditto
206         * bindings/scripts/CodeGeneratorJS.pm: added support for special
207         attribute lookup that elements do
208         * dom/Element.idl: added new attribute, 
209         "IncludeAttributesInPropertyLookup," which tells the code generator 
210         to include HTML element attributes in property lookup
211
212 2006-04-22  Michael Emmel  <mike.emmel@gmail.com>
213
214         Reviewed by Maciej.
215
216         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8529
217           Extra Qaulification in header
218         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8530
219           Missing assert.h include
220
221         * rendering/RenderObject.h: Removed erroneous RenderObject::
222         prefix from a member function name.
223         * rendering/RenderText.h: Removed erroneous RenderText::
224         prefix from a member function name.
225
226         * platform/Arena.cpp: Added <assert.h> to list of includes.
227         * platform/KURL.cpp: Ditto.
228         * platform/StringImpl.cpp: Ditto.
229         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: Ditto.
230         * platform/image-decoders/png/PNGImageDecoder.cpp: Ditto.
231
232 2006-04-22  Darin Adler  <darin@apple.com>
233
234         * doc: Added.
235
236 2006-04-22  Maciej Stachowiak  <mjs@apple.com>
237
238         Reviewed by Eric.
239
240         - push down a bunch of WebCoreFrameBridge code to C++ (plus some reformatting)
241
242         * bridge/mac/WebCoreFrameBridge.mm:
243         (-[WebCoreFrameBridge isDescendantOfFrame:]):
244         (-[WebCoreFrameBridge traverseNextFrameStayWithin:]):
245         (-[WebCoreFrameBridge nextFrameWithWrap:]):
246         (-[WebCoreFrameBridge previousFrameWithWrap:]):
247         (+[WebCoreFrameBridge bridgeForDOMDocument:]):
248         (-[WebCoreFrameBridge parent]):
249         (-[WebCoreFrameBridge addData:]):
250         (-[WebCoreFrameBridge didNotOpenURL:pageCache:]):
251         (-[WebCoreFrameBridge restoreDocumentState]):
252         (-[WebCoreFrameBridge _stringWithDocumentTypeStringAndMarkupString:]):
253         (-[WebCoreFrameBridge nodesFromList:]):
254         (-[WebCoreFrameBridge markupStringFromNode:nodes:]):
255         (-[WebCoreFrameBridge markupStringFromRange:nodes:]):
256         (-[WebCoreFrameBridge rangeByExpandingSelectionWithGranularity:]):
257         (-[WebCoreFrameBridge rangeByAlteringCurrentSelection:direction:granularity:]):
258         (-[WebCoreFrameBridge alterCurrentSelection:direction:granularity:]):
259         (-[WebCoreFrameBridge rangeByAlteringCurrentSelection:verticalDistance:]):
260         (-[WebCoreFrameBridge alterCurrentSelection:verticalDistance:]):
261         (-[WebCoreFrameBridge replaceMarkedTextWithText:]):
262         (-[WebCoreFrameBridge replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]):
263         (-[WebCoreFrameBridge increaseSelectionListLevel]):
264         (-[WebCoreFrameBridge decreaseSelectionListLevel]):
265         (-[WebCoreFrameBridge insertLineBreak]):
266         (-[WebCoreFrameBridge insertParagraphSeparator]):
267         (-[WebCoreFrameBridge insertParagraphSeparatorInQuotedContent]):
268         (-[WebCoreFrameBridge insertText:selectInsertedText:]):
269         (-[WebCoreFrameBridge deleteSelectionWithSmartDelete:]):
270         (-[WebCoreFrameBridge ensureSelectionVisible]):
271         (-[WebCoreFrameBridge RenderObject::nodeInfoAtPoint:allowShadowContent:]):
272         * page/Frame.cpp:
273         (WebCore::Frame::nodeInfoAtPoint):
274         (WebCore::Frame::hasSelection):
275         (WebCore::Frame::documentTypeString):
276         * page/Frame.h:
277         * page/FrameTree.cpp:
278         (WebCore::FrameTree::traverseNextWithWrap):
279         (WebCore::FrameTree::traversePreviousWithWrap):
280         (WebCore::FrameTree::deepLastChild):
281         * page/FrameTree.h:
282
283 2006-04-22  Beth Dakin  <bdakin@apple.com>
284
285         Reviewed by Hyatt.
286
287         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=6141 
288         DOMCSSPrimitiveValue is always returning values in pixels when 
289         using getComputedStyle:
290
291         getFloatValue() took a unit type as a parameter, ignored it, and 
292         returned m_value.num. This patch writes a second version of the 
293         function that actually converts m_value.num to the specified unites 
294         before returning it. Where a conversion is not required, I removed 
295         the unit type from the caller so that it would go directly to the 
296         inline version of the function.
297
298         * css/css_valueimpl.cpp:
299         (WebCore::CSSPrimitiveValue::computeLengthFloat): Remove type 
300         parameter since a conversion is not needed.
301         (WebCore::scaleFactorForConversion): Helper function for 
302         conversion.
303         (WebCore::CSSPrimitiveValue::getFloatValue): This version of 
304         getFloatValue() takes a unit type parameter and converts 
305         m_value.num.
306         * css/css_valueimpl.h:
307         (WebCore::CSSPrimitiveValue::getFloatValue): This version does not 
308         take a parameter and just returns m_value.num.
309         * css/cssparser.cpp:
310         (WebCore::BorderImageParseContext::commitBorderImage): Remove type 
311         parameter since a conversion is not needed.
312         * css/cssstyleselector.cpp:
313         (WebCore::convertToLength): Same.
314         (WebCore::CSSStyleSelector::applyProperty): Same.
315         (WebCore::CSSStyleSelector::mapBackgroundSize): Same.
316         (WebCore::CSSStyleSelector::mapBackgroundXPosition): Same.
317         (WebCore::CSSStyleSelector::mapBackgroundYPosition): Same.
318         * editing/ApplyStyleCommand.cpp:
319         (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange): Same.
320         * ksvg2/css/SVGCSSStyleSelector.cpp:
321         (WebCore::CSSStyleSelector::applySVGProperty): Same.
322         * ksvg2/misc/KCanvasRenderingStyle.cpp:
323         (WebCore::KSVGPainterFactory::cssPrimitiveToLength): Same.
324
325 2006-04-21  Geoffrey Garen  <ggaren@apple.com>
326
327         Reviewed by John.
328
329         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=8509
330         javascript:document.importNode(null)
331         
332         * dom/Document.cpp:
333         (WebCore::Document::importNode): Throw an error if the node is null.
334         This happens when the object provided in the JavaScript call is not
335         a node.
336         (WebCore::Document::adoptNode): Set the DOM exception code in all error
337         cases instead of just a few, because that's what the spec requires.
338
339 2006-04-21  Geoffrey Garen  <ggaren@apple.com>
340
341         Reviewed by John.
342
343         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=8510
344         submit event doesn't bubble - it's supposed to.
345
346         * html/HTMLElement.cpp:
347         (WebCore::HTMLElement::parseMappedAttribute): Added recognition for the
348         onsubmit attribute, so elements can use it
349         * html/HTMLFormElement.cpp:
350         (WebCore::HTMLFormElement::prepareSubmit): Changed bubbling attribute
351         to 'true'
352
353 2006-04-21  Geoffrey Garen  <ggaren@apple.com>
354
355         Reviewed by TimO.
356
357         - Fixed: error event does not bubble
358
359         I discovered this bug while working on the "submit event does not
360         bubble" bug. The DOM spec says the event should bubble, and that's how
361         it works in Firefox.
362
363         The DOM Spec also says that the error event is "valid for
364         OBJECT elements, BODY elements, and FRAMESET element." But it doesn't
365         say "valid ONLY." Firefox supports it on all elements and web
366         developers tend to think it will work for things like <img> and
367         <script>, so I went whole hog here.
368
369         * html/HTMLElement.cpp:
370         (WebCore::HTMLElement::parseMappedAttribute): Make onerror a mapped
371         attribute for all elements, so containing elements can register for
372         the event.
373         * html/HTMLTokenizer.cpp:
374         (WebCore::HTMLTokenizer::notifyFinished): make onerror bubble
375         * html/html_headimpl.cpp:
376         (WebCore::HTMLScriptElement::parseMappedAttribute): Remove special
377         case for onerror because HTMLElement will take care of it
378         (WebCore::HTMLScriptElement::notifyFinished): make onerror bubble
379         * html/html_imageimpl.cpp:
380         (WebCore::HTMLImageElement::parseMappedAttribute): Remove special
381         case for onerror because HTMLElement will take care of it
382
383 2006-04-21  Adele Peterson  <adele@apple.com>
384
385         Test for: http://bugzilla.opendarwin.org/show_bug.cgi?id=8181
386         REGRESSION: After tabbing in page's field, attempting to tab from Google toolbar search to page fails on first try
387
388         * manual-tests/tabbing-input-google.html: Added.
389
390 2006-04-21  Kevin M. Ollivier  <kevino@theolliviers.com>
391
392         Reviewed by Darin.
393
394         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8507
395           Compilation fixes for building on gcc 4.0.2, and without precomp headers
396
397         * platform/Cursor.h: Created a fallback case that typedefs PlatformCursor
398         to void * if it isn't defined to anything else. (Useful to help get new ports
399         initially compiling.)
400         
401         * bindings/js/kjs_window.cpp:
402         * rendering/RenderTextField.cpp:
403         * rendering/RenderBox.cpp:
404         Add missing headers to resolve issues when compiling without precompiled
405         headers.
406         
407         * rendering/RenderText.h: Declare the InlineTextBox class before 
408         friend declaration to resolve compilation issues with gcc 4.0.2.
409         
410 2006-04-21  Adele Peterson  <adele@apple.com>
411
412         Reviewed by Darin.
413
414         Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=8213
415         REGRESSION: Can't tab out of text field if iframe comes after it
416
417         Test: fast/forms/tabbing-input-iframe.html
418
419         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::nextKeyViewInFrame):
420           If the next focusable node is a RenderWidget without a view, then continue in the loop.  We used to break out in this case. 
421           I also made some formatting changes and reorganized the function to make it easier to read.
422
423 2006-04-21  Adele Peterson  <adele@apple.com>
424
425         Reviewed by Beth.
426
427         Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=8496
428         REGRESSION: Dragging to select text around a text field causes the text field to scroll.
429
430         Test: manual-tests/text-field-autoscroll.html
431
432         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::handleMouseMoveEvent): Start the frame's autoscroll timer
433         even when we're calling over the bridge to handle the autoscroll.
434         * page/Frame.cpp: (WebCore::Frame::stopAutoscrollTimer): Clear out pointer to layer.
435
436 2006-04-21  Geoffrey Garen  <ggaren@apple.com>
437
438         - And again.
439
440         * WebCore.vcproj/WebCore/WebCore.vcproj:
441
442 2006-04-21  Geoffrey Garen  <ggaren@apple.com>
443
444         - Futile attempt to fix Windows build.
445         
446         * WebCore.vcproj/WebCore/WebCore.vcproj:
447
448 2006-04-20  Geoffrey Garen  <ggaren@apple.com>
449
450         Reviewed by Maciej.
451
452         - Added autogeneration of JS bindings for CSSRule, CSSValue,
453         Event, and NodeFilter.  
454
455         - Made related prototype objects hold the relevant constants, to
456         match Mozilla and the DOM 2 spec. (Previously, only the related
457         constructor objects held those constants, in accordance with the
458         DOM 3 spec.)
459
460         - Fixed up remaining Windows build issues.
461
462         * DerivedSources.make: Added new autogenerated files
463         * WebCore.xcodeproj/project.pbxproj: ditto
464         * bindings/js/kjs_css.cpp:
465         (KJS::DOMCSSRule::classInfo):
466         (KJS::DOMCSSRule::getOwnPropertySlot): scope call to classInfo()
467         because it's virtual and DOMCSSRule has a derrived class now.
468         (KJS::DOMCSSRule::put): ditto
469         (KJS::DOMCSSRuleFunc::callAsFunction):
470         (KJS::toJS):
471         * bindings/js/kjs_css.h:
472         * bindings/js/kjs_events.cpp:
473         (KJS::toJS):
474         * bindings/js/kjs_events.h:
475         * bindings/js/kjs_html.cpp:
476         (KJS::OptionConstructorImp::OptionConstructorImp):
477         * bindings/js/kjs_traversal.cpp:
478         (KJS::toJS):
479         * bindings/js/kjs_traversal.h:
480         * bindings/js/kjs_window.cpp: 
481         (KJS::Window::getValueProperty): added CSSValue global object
482         * bindings/js/kjs_window.h:
483         (KJS::Window::):
484         * bindings/scripts/CodeGeneratorJS.pm: Changed generator to write
485         constants to prototype objects (previously only wrote constants to
486         constructor objects)
487         * css/CSSPrimitiveValue.idl: Removed LegacyParent since CSSValue now
488         exists in IDL
489         * css/CSSRule.idl: Added.
490         * css/CSSValue.idl: Added.
491         * css/css_ruleimpl.h:
492         (WebCore::CSSRule::):
493         * css/css_valueimpl.h:
494         * dom/Event.idl: Added.
495         * dom/MutationEvent.idl: Removed LegacyParent since Event now exists
496         in IDL
497         * dom/NodeFilter.idl: Added.
498         * dom/UIEvent.idl: Removed LegacyParent since event now exists in IDL
499         * dom/dom2_eventsimpl.h:
500         (WebCore::Event::):
501
502 2006-04-21  Darin Adler  <darin@apple.com>
503
504         - one more attempt to fix Windows build
505
506         * platform/cairo/GraphicsContextCairo.cpp:
507         (WebCore::GraphicsContext::fillRect): Update to use Color and match
508         the similar function on GraphicsContextMac.
509
510 2006-04-21  Beth Dakin  <bdakin@apple.com>
511
512         Reviewed by Hyatt.
513
514         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8495 
515         REGRESSION: Sidebar on cnn.com is hosed
516
517         * platform/mac/ImageMac.mm:
518         (WebCore::Image::drawTiled): Use the size of the destination rect, 
519         not the oneTileRect in the no-pattern case.
520         * rendering/RenderBox.cpp:
521         (WebCore::RenderBox::paintBackgroundExtended): Initialize 
522         scaledWidth and scaledHeight to the appropriate value (was wrong in 
523         scroll case), adjust position at appropriate times, and take out 
524         no-repeat clause for now since we don't have enough test cases yet 
525         to be sure we won't cause massive regressions. 
526
527 2006-04-21  Darin Adler  <darin@apple.com>
528
529         - attempt to fix Windows build after my last check-in
530
531         * WebCore.vcproj/Image Viewer/ImageView.cpp: Changed calls to use the
532         new IntRect-based API.
533
534         * html/CanvasPattern.cpp: (WebCore::CanvasPattern::CanvasPattern):
535         Put appropriate ifdefs around the m_platformImage initializer.
536
537         * page/Frame.cpp: Make Frame::adjustPageHeight Mac-OS-X-only for now
538         since it's used for printing and we don't have printing going on any
539         other platforms yet.
540
541         * platform/cairo/GraphicsContextCairo.cpp: Take out constructor that
542         takes only the "for printing" boolean for now.
543
544         * platform/cairo/ImageCairo.cpp: Include the GraphicsContext.h header.
545
546         * platform/win/TemporaryLinkStubs.cpp: (GraphicsContext::setShadow):
547         Fix up this stub and remove the GraphicsContext empty constructor stub.
548
549 2006-04-21  Darin Adler  <darin@apple.com>
550
551         - fix build
552
553         * WebCore.xcodeproj/project.pbxproj: Replaced absolute path on my system
554         with a build-result-relative path; also removed some source files from the
555         list of resources to install!
556
557 2006-04-20  Darin Adler  <darin@apple.com>
558
559         Reviewed by Hyatt.
560
561         - make <canvas> element and related API behave more like the draft of
562           the WhatWG Web Application specification, checking parameter validity
563           and raising exceptions
564         - changed HTMLCanvasElement bindings to be auto-generated, fixing all
565           issues so we can generate bindings for classes drived from HTMLElement
566         - change GraphicsContext API to use IntRect/Point/Size in more cases
567         - change GraphicsContext so it is closer to truly wrapping a graphics
568           context rather than representing the current NSGraphicsContext; there
569           are still some things like text and rectangle fills that are tied to
570           NSGraphicsContext, but we're most of the way there
571         - removed Brush class since it just amounted to a color, using an RGBA32
572           instead where we used to use a Brush
573
574         * DerivedSources.make: Added JSHTMLCanvasElement.h.
575         * WebCore.xcodeproj/project.pbxproj: Added new files.
576
577         * bindings/js/JSCanvasRenderingContext2DBase.h: Added toJS.
578         * bindings/js/JSCanvasRenderingContext2DBase.cpp:
579         (WebCore::JSCanvasRenderingContext2DBaseProtoFunc::callAsFunction):
580         Added exception code handling for strokeRect, drawImage, and createPattern.
581         Added version of createPattern that takes a canvas. Use TYPE_MISMATCH_ERR
582         instead of JavaScript TypeError when parameter is neither an image or canvas
583         element. Adapt for new HTMLCanvasElement binding.
584         (WebCore::toJS): Added. Converts context object to JS wrapper.
585
586         * bindings/js/JSHTMLElementWrapperFactory.h: Added.
587         * bindings/js/JSHTMLElementWrapperFactory.cpp: Added. Creates a JavaScript
588         wrapper for an arbitrary HTML element. Better than putting this all in the
589         DOM node class toJS function.
590
591         * bindings/js/JSXMLSerializer.cpp: Tweaked to make it build.
592         * bindings/js/kjs_dom.cpp: (KJS::toJS): Changed to call the
593         JSHTMLElementWrapperFactory function createJSWrapper, instead
594         of always creating a JSHTMLElement.
595
596         * bindings/js/kjs_html.h: Removed canvas-related stuff. Added HTMLElement
597         prototype.
598         * bindings/js/kjs_html.cpp:
599         (KJS::JSHTMLElement::classInfo): Removed canvas element.
600         (KJS::JSHTMLElement::accessors): Ditto.
601         (KJS::JSHTMLElementProtoFunc::callAsFunction): Added, to help the auto-binding
602         machiner cope with HTMLElement.
603         (KJS::HTMLElementFunction::callAsFunction): Removed canvas element.
604
605         * bindings/scripts/CodeGeneratorJS.pm: Added types needed for HTMLCanvasElement.
606
607         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::setDisplaysWithFocusAttributes):
608         Changed to create a GraphicsContext with the new constructor that takes
609         a CGContextRef.
610         * bridge/mac/WebCoreFrameBridge.mm: (-[WebCoreFrameBridge drawRect:]):
611         Changed to create a GraphicsContext with the new constructor that takes
612         a NSGraphicsContext.
613         * page/Frame.cpp: (WebCore::Frame::adjustPageHeight): Changed to create a
614         GraphicsContext with the new constructor that takes a CGContextRef.
615
616         * editing/SelectionController.cpp: (WebCore::SelectionController::paintCaret):
617         Eliminated a use of obsolete class Brush.
618
619         * html/CanvasPattern.h:
620         * html/CanvasPattern.cpp:
621         (WebCore::CanvasPattern::parseRepetitionType): Added. Parses a repetition
622         type. Different from the old logic in that it is case-sensitive and rejects
623         anything other than null, empty string, or the four repeat types.
624         (WebCore::CanvasPattern::CanvasPattern): Added constructor that takes
625         a CGImageRef. Changed constructor to take two booleans instead of the repetition
626         type string. It's the caller's responsibility to parse the string.
627         (WebCore::CanvasPattern::~CanvasPattern): Release the CGImage.
628         (WebCore::patternCallback): Handle the CGImage case. Also changed the code
629         to create a GraphicsContext as needed and call the image drawing code with that.
630         (WebCore::CanvasPattern::createPattern): Handle both the image element case and
631         the canvas element case.
632         
633         * html/CanvasRenderingContext2D.h:
634         * html/CanvasRenderingContext2D.cpp:
635         (WebCore::CanvasRenderingContext2D::State::State): Change line cap, line join,
636         and global composite to store enum values instead of strings.
637         (WebCore::CanvasRenderingContext2D::setLineWidth): Do nothing if width is NaN
638         or <= 0.
639         (WebCore::CanvasRenderingContext2D::lineCap): Return a string based on a
640         stored enum, rather than returning a stored string.
641         (WebCore::CanvasRenderingContext2D::setLineCap): Do nothing if the string is
642         not one of the standard line cap types. Also case sensitive and stores enum
643         rather than the string.
644         (WebCore::CanvasRenderingContext2D::lineJoin): Return a string based on a
645         stored enum, rather than returning a stored string.
646         (WebCore::CanvasRenderingContext2D::setLineJoin): Do nothing if the string is
647         not one of the standard line join types. Also case sensitive and stores enum
648         rather than the string.
649         (WebCore::CanvasRenderingContext2D::setMiterLimit): Do nothing if limit is NaN
650         or <= 0.
651         (WebCore::CanvasRenderingContext2D::setGlobalAlpha): Do nothing if alpha is NaN
652         or < 0 or > 1.
653         (WebCore::CanvasRenderingContext2D::globalCompositeOperation): Return a string
654         based on a stored enum, rather than returning a stored string.
655         (WebCore::CanvasRenderingContext2D::setGlobalCompositeOperation): Do nothing if
656         the string is not one of the standard compositing modes. Also case sensitive and
657         stores enum rather than the string.
658         (WebCore::CanvasRenderingContext2D::arcTo): Generate INDEX_SIZE_ERR exception
659         if radius is NaN or <= 0.
660         (WebCore::CanvasRenderingContext2D::arc): Ditto.
661         (WebCore::CanvasRenderingContext2D::rect): Generate INDEX_SIZE_ERR exception
662         if width or height is NaN or <= 0.
663         (WebCore::CanvasRenderingContext2D::clearRect): Ditto.
664         (WebCore::CanvasRenderingContext2D::fillRect): Ditto.
665         (WebCore::CanvasRenderingContext2D::strokeRect): Ditto, same for line width.
666         Changed the case where the line width is not specified to share code with the
667         case where it is.
668         (WebCore::size): Renamed from imageSize, since C++ overloads based on parameter
669         types anyway.
670         (WebCore::CanvasRenderingContext2D::drawImage): Generate INDEX_SIZE_ERR exception
671         if the source rect is not entirely inside the image rect, or if the width or height
672         of either the source or destination rect is NaN or <= 0. Changed image drawing
673         code to be platform-independent for the image element case, but not yet for the
674         canvas case.
675         (WebCore::CanvasRenderingContext2D::drawImageFromRect): Change code to parse the
676         composite operation to use the new code shared with Image.
677         (WebCore::CanvasRenderingContext2D::createPattern): Added code to parse the
678         repetition type separately before creating the pattern. Added an overload for
679         canvas elements.
680         (WebCore::CanvasRenderingContext2D::drawingContext): Changed to return a
681         GraphicsContext*.
682         (WebCore::CanvasRenderingContext2D::platformContext): Added. Now does what
683         drawingContext used to do.
684
685         * html/CanvasRenderingContext2D.idl: Added exception declarations as needed
686         for changes above.
687
688         * html/HTMLCanvasElement.h:
689         * html/HTMLCanvasElement.cpp:
690         (WebCore::HTMLCanvasElement::HTMLCanvasElement): Changed m_drawingContext
691         to be a GraphicsContext instead of a CGContextRef.
692         (WebCore::HTMLCanvasElement::~HTMLCanvasElement): Ditto.
693         (WebCore::HTMLCanvasElement::getContext): Removed special cases for null
694         and empty string. Only give a 2D graphics context if the string is "2d".
695         (WebCore::HTMLCanvasElement::reset): Updated for change to GraphicsContext
696         from CGContextRef.
697         (WebCore::HTMLCanvasElement::paint): Ditto.
698         (WebCore::HTMLCanvasElement::createDrawingContext): Changed to create a
699         GraphicsContext* instead of a CGContextRef.
700         (WebCore::HTMLCanvasElement::drawingContext): Changed to return a
701         GraphicsContext* instead of a CGContextRef.
702         (WebCore::HTMLCanvasElement::createPlatformImage): Updated for changes above.
703
704         * html/HTMLCanvasElement.idl: Added.
705
706         * html/HTMLParser.h:
707         * html/HTMLParser.cpp:
708         (WebCore::HTMLParser::canvasCreateErrorCheck): Added. An attempt to implement the
709         fallback behavior for canvas elements when JavaScript is off.
710         (WebCore::HTMLParser::getNode): Sorted list of functions. Added case for canvas.
711
712         * html/html_imageimpl.h:
713         * html/html_imageimpl.cpp:
714         (WebCore::HTMLImageElement::HTMLImageElement): Changed m_compositeOperator to be
715         an enum instead of a string.
716         (WebCore::HTMLImageElement::parseMappedAttribute): Parse the enum here.
717
718         * kcanvas/KCanvasResources.h:
719         * kcanvas/KCanvasResources.cpp: (WebCore::KCanvasMarker::draw): Changed to take a
720         GraphicsContext parameter.
721
722         * kcanvas/RenderPath.h: Added GraphicsContext parameter to drawMarkersIfNeeded.
723
724         * kcanvas/RenderPath.cpp: (WebCore::RenderPath::paint):
725         * kcanvas/RenderSVGImage.cpp: (WebCore::RenderSVGImage::paint):
726         * kcanvas/RenderSVGText.cpp: (WebCore::RenderSVGText::paint):
727         Changed to generate and use an appropriate GraphicsContext.
728
729         * kcanvas/device/quartz/KCanvasItemQuartz.h: Added GraphicsContext parameter to
730         drawMarkersIfNeeded.
731         * kcanvas/device/quartz/KCanvasItemQuartz.mm:
732         (WebCore::DrawMarkersData::DrawMarkersData): Added GraphicsContext*.
733         (WebCore::drawMarkerWithData): Pass along a GraphicsContext*.
734         (WebCore::drawStartAndMidMarkers): Ditto.
735         (WebCore::KCanvasItemQuartz::drawMarkersIfNeeded): Pass a long a GraphicsContext*.
736
737         * kcanvas/device/KRenderingDevice.h: Added a pure virtual createGraphicsContext
738         to bridge back to a GraphicsContext. Long term that class will replace this one.
739         * kcanvas/device/quartz/KRenderingDeviceQuartz.h:
740         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
741         (WebCore::KRenderingDeviceContextQuartz::createGraphicsContext): Added.
742
743         * ksvg2/svg/SVGMaskElement.cpp: (WebCore::SVGMaskElement::drawMaskerContent):
744         Create and pass a GraphicsContext -- old code used the default constructor for
745         GraphicsContext which meant "current context", and that no longer exists.
746         * ksvg2/svg/SVGPatternElement.cpp:
747         (WebCore::SVGPatternElement::drawPatternContentIntoTile): Ditto.
748
749         * platform/Brush.h: Removed.
750         * platform/CompositeOperator.h: Added.
751         * platform/CompositeOperator.cpp: Added.
752
753         * platform/Font.h: Changed calls to use IntPoint instead of pairs of ints.
754         Also removed the const from all the uses of GraphicsContext*.
755
756         * platform/GraphicsContext.h: Eliminated default constructor and constructor
757         that takes only a boolean. Replaced with constructors that take platform
758         graphics contexts only. Replaced brush-related calls with fill color calls.
759         Replaced use of Brush with use of Color. Changed Image::CompositeOperator to
760         just plain CompositeOperator. Changed tuples of ints into IntRect and IntPoint.
761         Moved setFocusRingClip and clearFocusRingClip out of ifdefs. Removed unused
762         getCompositeOperation and string-based setCompositeOperation. Moved
763         currentCGContext and the other setCompositeOperation out of the GraphicsContext
764         class and made them global functions. Fixed platformContext so it won't always
765         return the CGContextRef of the current NSGraphicsContext. Instead, it will
766         return the appropriate CGContextRef for the GraphicsContext. This eliminates
767         the need to use void* for the image-drawing functions.
768
769         * platform/GraphicsContext.cpp:
770         (WebCore::GraphicsContextState::GraphicsContextState): Replaced Brush with
771         an RGBA fill color.
772         (WebCore::GraphicsContext::setFillColor): Renamed from setBrush.
773         (WebCore::GraphicsContext::fillColor): Renamed from brush.
774         (WebCore::GraphicsContext::drawImage): Changed to use IntRect.
775         (WebCore::GraphicsContext::drawTiledImage): Moved here from GraphicsContextMac.mm.
776         (WebCore::GraphicsContext::drawText): Changed to use IntPoint.
777         (WebCore::GraphicsContext::drawHighlightForText): Ditto.
778         (WebCore::GraphicsContext::drawLineForText): Ditto.
779         (WebCore::GraphicsContext::drawLineForMisspelling): Ditto.
780
781         * platform/Image.h: Removed CompositeOperator and related functions.
782         Removed void* context parameters from draw functions.
783
784         * platform/Image.cpp: Removed compositeOperatorFromString.
785
786         * platform/Widget.h: Added a GraphicsContext* return value from lockDrawingFocus
787         that you pass back to unlockDrawingFocus (for deletion).
788
789         * platform/mac/FontMac.mm:
790         (WebCore::Font::selectionRectForText): Changed parameter to point and removed
791         const on GraphicsContext* parameter.
792         (WebCore::Font::drawText): Ditto.
793         (WebCore::Font::drawHighlightForText): Ditto.
794         (WebCore::Font::drawLineForText): Ditto.
795         (WebCore::Font::drawLineForMisspelling): Ditto.
796         (WebCore::Font::misspellingLineThickness): Removed const.
797
798         * platform/mac/GraphicsContextMac.mm:
799         (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
800         Added fields to store a CGContextRef and an NSGraphicsContext.
801         (WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate):
802         Release both the CGContextRef and the NSGraphicsContext.
803         (WebCore::GraphicsContext::GraphicsContext): Implement to set up both the
804         CGContextRef and the NSGraphicsContext in one case, and only the CGContextRef
805         in the other.
806         (WebCore::GraphicsContext::savePlatformState): Implement for the CGContext-only
807         case.
808         (WebCore::GraphicsContext::restorePlatformState): Ditto.
809         (WebCore::GraphicsContext::drawRect): Assert that the NS context is present
810         and 
811         (WebCore::GraphicsContext::setColorFromFillColor): Renamed from
812         setColorFromBrush.
813         (WebCore::GraphicsContext::setColorFromPen): Added assertion.
814         (WebCore::GraphicsContext::drawLine): Added assertion.
815         (WebCore::GraphicsContext::drawEllipse): Get CGContext from the platformContext
816         function instead of currentCGContext, and changed to use fillColor.
817         (WebCore::GraphicsContext::drawArc): Ditto.
818         (WebCore::GraphicsContext::drawConvexPolygon): Ditto.
819         (WebCore::setCompositeOperation): Changed to global function and also changed
820         to do the work here -- no need to use WebCoreImageRendererFactory.
821         (WebCore::GraphicsContext::drawImage): Move most of this into GraphicsContext.cpp.
822         Remove the void* context parameter. Changed to take rects instead of separate coordinates.
823         (WebCore::GraphicsContext::fillRect): Changed to take color instead of Brush.
824         (WebCore::GraphicsContext::addClip): Added assertion.
825         (WebCore::GraphicsContext::addRoundedRectClip): Get CGContextRef from the platformContext
826         function instead of currentCGContext.
827         (WebCore::GraphicsContext::createRenderingDeviceContext): Ditto.
828         (WebCore::GraphicsContext::beginTransparencyLayer): Ditto.
829         (WebCore::GraphicsContext::endTransparencyLayer): Ditto.
830         (WebCore::GraphicsContext::setShadow): Change to take size instead of x,y. Also get
831         CGCOntextRef from the platformContext function instead of currentCGContext.
832         (WebCore::GraphicsContext::clearShadow): Get CGContextRef from the platformContext
833         function instead of currentCGContext.
834         (WebCore::GraphicsContext::platformContext): Added. Returns m_data->m_cgContext.
835
836         * platform/mac/ImageMac.mm:
837         (WebCore::fillSolidColorInRect): Updated for change in CompositeOperator type.
838         (WebCore::Image::checkForSolidColor): Ditto.
839         (WebCore::Image::draw): Removed void* context parameter and replaced it with
840         a GraphicsContext* parameter. Renamed from drawInRect.
841         (WebCore::Image::drawTiled): Ditto. Renamed from tileInRect and scaleAndTileInRect.
842
843         * platform/mac/PDFDocumentImage.h: Updated for change in CompositeOperator type.
844         * platform/mac/PDFDocumentImage.mm: (WebCore::PDFDocumentImage::draw): Ditto.
845
846         * platform/mac/WidgetMac.mm:
847         (WebCore::Widget::lockDrawingFocus): Changed to return a GraphicsContext*.
848         (WebCore::Widget::unlockDrawingFocus): Changed to take a GraphicsContext*.
849
850         * rendering/InlineTextBox.cpp:
851         (WebCore::InlineTextBox::selectionRect): Changed to pass IntPoint.
852         (WebCore::InlineTextBox::paint): Changed to pass IntSize.
853         (WebCore::InlineTextBox::paintSelection): More of the same.
854         (WebCore::InlineTextBox::paintMarkedTextBackground): Ditto.
855         (WebCore::InlineTextBox::paintDecoration): Ditto.
856         (WebCore::InlineTextBox::paintSpellingMarker): Ditto.
857         (WebCore::InlineTextBox::paintTextMatchMarker): Ditto.
858         (WebCore::InlineTextBox::paintMarkedTextUnderline): Ditto.
859         (WebCore::InlineTextBox::positionForOffset): Ditto.
860         * rendering/RenderBlock.cpp:
861         (WebCore::RenderBlock::fillHorizontalSelectionGap): Ditto.
862         (WebCore::RenderBlock::fillVerticalSelectionGap): Ditto.
863         (WebCore::RenderBlock::fillLeftSelectionGap): Ditto.
864         (WebCore::RenderBlock::fillRightSelectionGap): Ditto.
865         * rendering/RenderBox.cpp:
866         (WebCore::RenderBox::paintBackgroundExtended): Ditto.
867         (WebCore::RenderBox::outlineBox): Ditto.
868         * rendering/RenderImage.cpp:
869         (WebCore::RenderImage::paint): Ditto.
870         * rendering/RenderLayer.cpp:
871         (WebCore::setClip): Take out ifdefs. We'll do that inside GraphicsContext instead.
872         (WebCore::restoreClip): Ditto.
873         * rendering/RenderObject.cpp:
874         (WebCore::RenderObject::drawBorder): More of the same.
875         (WebCore::RenderObject::paintBorderImage): Ditto.
876         * rendering/render_line.cpp:
877         (WebCore::InlineFlowBox::paintDecorations): Ditto.
878         (WebCore::EllipsisBox::paint): Ditto.
879         * rendering/render_list.cpp:
880         (WebCore::RenderListMarker::paint): Ditto.
881
882         * rendering/render_frames.cpp: (WebCore::RenderFrameSet::userResize): Set up a graphics
883         context by calling lockDrawingFocus. Also changed a color here to be a constant.
884
885         * platform/cairo/GraphicsContextCairo.cpp:
886         (WebCore::GraphicsContext::drawImage): Update for parameter type changes.
887         (WebCore::GraphicsContext::drawScaledAndTiledImage):
888         (WebCore::GraphicsContext::setFocusRingClip):
889         (WebCore::GraphicsContext::clearFocusRingClip):
890         * platform/cairo/ImageCairo.cpp:
891         (WebCore::setCompositingOperation):
892         (WebCore::Image::tileInRect):
893         (WebCore::Image::scaleAndTileInRect):
894
895 2006-04-20  Mitz Pettel  <opendarwin.org@mitzpettel.com>
896
897         Reviewed by Darin.
898
899         WebCore part of:
900         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8276
901           REGRESSION (NativeTextField): Pasting a Finder item into a text field results in
902             a file: URL being pasted instead of just the file name
903         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8283
904           REGRESSION: File's path doesn't appear after dragging file into input field
905
906         * bridge/mac/WebCoreFrameBridge.h:
907         * bridge/mac/WebCoreFrameBridge.mm:
908         (-[WebCoreFrameBridge isDragCaretRichlyEditable]): Added.
909         * manual-tests/plain-text-paste.html: Added.
910         * manual-tests/resources/plain-text-paste: Added.
911         * manual-tests/resources/plain-text-paste/1.textClipping: Added.
912         * manual-tests/resources/plain-text-paste/2.textClipping: Added.
913         * manual-tests/resources/plain-text-paste/3.gif: Added.
914         * manual-tests/resources/plain-text-paste/4.txt: Added.
915         * manual-tests/resources/plain-text-paste/5.webloc: Added.
916
917 2006-04-20  Darin Adler  <darin@apple.com>
918
919         Reviewed by Adele.
920
921         - WebCore part of http://bugzilla.opendarwin.org/show_bug.cgi?id=8505
922           eliminate WebCoreGraphics bridge, demonstrate new SystemInterface technique
923
924         * platform/mac/WebCoreGraphicsBridge.h: Removed.
925         * platform/mac/WebCoreGraphicsBridge.m: Removed.
926         * platform/mac/WebCoreSystemInterface.h: Added.
927         * platform/mac/WebCoreSystemInterface.mm: Added.
928
929         * WebCore.exp: Add new SystemInterface globals, remove WebCoreGraphicsBridge.
930
931         * WebCore.xcodeproj/project.pbxproj: Updated for removed and added files.
932         Sorted files.
933
934         * bridge/mac/FrameMac.mm: Removed unneeded include of WebCoreGraphicsBridge.h.
935
936         * platform/mac/ClipboardMac.mm: (WebCore::ClipboardMac::setDragImage):
937         Moved code from WebGraphicsBridge here, using WebCoreSystemInterface so we can
938         call wkSetDragImage.
939
940         * platform/mac/GraphicsContextMac.mm: (WebCore::GraphicsContext::drawFocusRing):
941         Moved code from WebGraphicsBridge here, using WebCoreSystemInterface so we can
942         call wkDrawFocusRing.
943
944         * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintTextField):
945         Call wkDrawBezeledTextFieldCell from WebCoreSystemInterface instead of using
946         WebGraphicsBridge to do the same thing.
947
948 2006-04-20  Adele Peterson  <adele@apple.com>
949
950         Reviewed by Hyatt.
951
952         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8273
953         REGRESSION: Read only input text field renders at the wrong height when value attribute is not present
954
955         Test: fast/forms/input-readonly-empty.html
956
957         * rendering/RenderBlock.h: Added hasLineIfEmpty.
958         * rendering/RenderBlock.cpp:
959         (WebCore::RenderBlock::hasLineIfEmpty): Added.  Checks for rootEditableElement as well as 
960          a shadowNode who has an input element as a parent.
961         (WebCore::RenderBlock::getBaselineOfLastLineBox): Calls hasLineIfEmpty instead of just checking for the rootEditableElement.
962         * rendering/bidi.cpp: (WebCore::RenderBlock::layoutInlineChildren): ditto.
963
964 2006-04-20  Darin Adler  <darin@apple.com>
965
966         Reviewed by Timothy.
967
968         Removed TO_NODE_OFFSET and TO_NODE_ADDRESS macros. These can just be done inline with pointer math.
969
970         * platform/DeprecatedString.cpp:
971         (allocateNode):
972         (freeHandle):
973
974 2006-04-19  Adele Peterson  <adele@apple.com>
975
976         Rubber-stamped by Darin.
977
978         Removed optimizations recently added in setInnerHTML and setInnerText.  The setInnerHTML change broke a first-letter style test.
979         The setInnerText change caused an empty text node to get added when setting inner text to an empty string.  The bug that this
980         change went in with remains fixed.
981
982         * html/HTMLElement.cpp:
983         (WebCore::HTMLElement::setInnerHTML):
984         (WebCore::HTMLElement::setInnerText):
985
986 2006-04-19  Mitz Pettel  <opendarwin.org@mitzpettel.com>
987
988         Reviewed by Haytt.
989
990         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6770
991           REGRESSION: Incomplete repaint when block with clipping grows
992
993         * manual-tests/repaint-resized-overflow.html: Added.
994         * rendering/RenderLayer.cpp:
995         (WebCore::RenderLayer::RenderLayer):
996         (WebCore::RenderLayer::computeRepaintRects): Set the m_repaintOverflowOnResize
997         flag to true if our object itself needs layout or if we're an overflow
998         and have a normal child that needs layout, in which case if we end up
999         resizing it will be because of the child, and that child might have not repainted
1000         itself correctly during its own layout.
1001         (WebCore::RenderLayer::updateLayerPositions): Do a full repaint if
1002         m_repaintOverflowOnResize is set and we resized but didn't move.
1003         * rendering/RenderLayer.h:
1004
1005 2006-04-19  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1006
1007         Reviewed by Hyatt.
1008
1009         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8352
1010           CSS text-shadow does not repaint completely when changed
1011
1012         * manual-tests/dynamic-shadow.html: Added.
1013         * rendering/render_style.cpp:
1014         (WebCore::RenderStyle::diff): Changed to return Layout when text-shadow
1015         changes.
1016
1017 2006-04-19  Adele Peterson  <adele@apple.com>
1018
1019         Reviewed by Darin.
1020
1021         Added readOnly methods for HTMLInputElement and HTMLTextAreaElement so the DOM bindings can call
1022         a method with the same name.  This will make it easier to autogenerate the DOM bindings in the future.
1023  
1024         * html/HTMLInputElement.h: (WebCore::HTMLInputElement::readOnly): Added. Calls isReadOnlyControl.
1025         * html/HTMLTextAreaElement.h: (WebCore::HTMLTextAreaElement::readOnly): ditto.
1026         * bindings/js/kjs_html.cpp:
1027         (KJS::JSHTMLElement::inputGetter): Calls readOnly instead of isReadOnlyControl.
1028         (KJS::JSHTMLElement::textAreaGetter): ditto.
1029         * bindings/objc/DOMHTML.mm:
1030         (-[DOMHTMLInputElement readOnly]): ditto.
1031         (-[DOMHTMLTextAreaElement readOnly]): Calls readOnly instead of getting the attribute directly.
1032         (-[DOMHTMLTextAreaElement setReadOnly:]): Calls setReadOnly instead of setting the attribute directly.
1033
1034 2006-04-19  Adele Peterson  <adele@apple.com>
1035
1036         Reviewed by Hyatt.
1037
1038         Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=8297
1039         REGRESSION: Input element extends outside of DIV element at http://www.macdock.com/
1040
1041         * platform/Font.h: Added runRounding parameter to floatWidth.
1042         * platform/mac/FontMac.mm: (WebCore::Font::floatWidth): ditto.
1043         * platform/win/FontWin.cpp: (WebCore::Font::floatWidth): ditto.
1044         * rendering/RenderTextField.cpp: (WebCore::RenderTextField::calcMinMaxWidth):
1045           Use new floatWidth parameter to turn off run rounding.
1046
1047 2006-04-19  Adele Peterson  <adele@apple.com>
1048
1049         Reviewed by Beth.
1050
1051         Fix for Windows build.
1052
1053         * rendering/RenderThemeWin.cpp: (WebCore::RenderThemeWin::determineState):
1054         Use isReadOnlyControl instead of isReadOnly.
1055
1056  2006-04-19  Adele Peterson  <adele@apple.com>
1057  
1058          Reviewed by Beth.
1059  
1060          Fix to make readonly text fields have dimmed borders to match AppKit behavior.
1061  
1062          Test: fast/forms/input-readonly-dimmed.html
1063  
1064          * dom/Node.h: (WebCore::Node::isReadOnlyControl): Changed from const version of isReadOnly.
1065          * dom/Node.cpp:
1066          (WebCore::Node::isReadOnlyNode): Changed from isReadOnly.
1067          (WebCore::Node::setNodeValue): Uses isReadOnlyNode instead of isReadOnly.
1068          (WebCore::Node::checkSetPrefix): ditto.
1069          (WebCore::Node::checkAddChild): ditto.
1070          * dom/Attr.cpp: (WebCore::Attr::setValue): ditto.
1071          * dom/CharacterData.cpp:
1072          (WebCore::CharacterData::setData): ditto.
1073          (WebCore::CharacterData::appendData): ditto.
1074          (WebCore::CharacterData::checkCharDataOperation): ditto.
1075          * dom/ContainerNode.cpp: (WebCore::ContainerNode::removeChild): ditto.
1076          * dom/Element.cpp: (WebCore::Element::setAttribute): ditto.
1077          * dom/NamedAttrMap.cpp:
1078          (WebCore::NamedAttrMap::setNamedItem): ditto.
1079          (WebCore::NamedAttrMap::removeNamedItem): ditto.
1080          * dom/NamedAttrMap.h: (WebCore::NamedAttrMap::isReadOnlyNode): ditto.
1081          * dom/NamedNodeMap.h: (WebCore::NamedNodeMap::isReadOnlyNode): ditto.
1082          * dom/Range.cpp:
1083          (WebCore::Range::checkDeleteExtract): ditto.
1084          (WebCore::Range::containedByReadOnly): ditto.
1085          * dom/Text.cpp: (WebCore::Text::splitText): ditto.
1086          * dom/dom_xmlimpl.cpp: (WebCore::ProcessingInstruction::setData): ditto.
1087  
1088          * bindings/js/kjs_html.cpp:
1089          (KJS::JSHTMLElement::inputGetter): Uses isReadOnlyControl instead of isReadOnly.
1090          (KJS::JSHTMLElement::textAreaGetter): ditto.
1091          * bindings/objc/DOMHTML.mm: (-[DOMHTMLInputElement readOnly]): ditto.
1092          * rendering/render_form.cpp:
1093          (WebCore::RenderLineEdit::updateFromElement): ditto.
1094          (WebCore::RenderTextArea::updateFromElement): ditto.
1095          * rendering/RenderTextField.cpp:
1096          (WebCore::RenderTextField::createDivStyle): ditto.
1097          (WebCore::RenderTextField::updateFromElement): ditto.
1098  
1099          * html/HTMLGenericFormElement.cpp: (WebCore::HTMLGenericFormElement::parseMappedAttribute): 
1100            When readonly attribute changes, update the theme so the control will repaint.
1101          * html/HTMLGenericFormElement.h: (WebCore::HTMLGenericFormElement::isReadOnlyControl): Renamed from readOnly.
1102          * html/HTMLInputElement.h: Removed isReadOnly, since isReadOnlyControl now exists on HTMLGenericFormElement.
1103          * rendering/RenderTheme.cpp: (WebCore::RenderTheme::isReadOnlyControl): Renamed from isReadOnly.
1104          * rendering/RenderTheme.h: (WebCore::): Added ReadOnlyState to ControlState enum.
1105          * rendering/RenderThemeMac.h: Removed NSTextFieldCell since it was only being used to store the enabled state.
1106            Removed setTextFieldState since it was updating the enabled state of the cell, which is only used in one place.
1107          * rendering/RenderThemeMac.mm:
1108          (WebCore::RenderThemeMac::RenderThemeMac): No longer initialized the NSTextFieldCell.
1109          (WebCore::RenderThemeMac::adjustRepaintRect): No longer calls setTextFieldState.
1110          (WebCore::RenderThemeMac::paintTextField): Uses the enabled state and the readonly state to determine whether to draw
1111           a dimmed version of the aqua border.
1112  
1113 2006-04-19  Beth Dakin  <bdakin@apple.com>
1114
1115         Reviewed by Hyatt.
1116
1117         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8467 Block 
1118         with percentage background-size doesn't repaint properly when it 
1119         grows
1120
1121         * manual-tests/backgroundSizeRepaint.html: Added.
1122         * manual-tests/resources/apple.jpg: Added.
1123         * rendering/RenderObject.cpp:
1124         (WebCore::RenderObject::mustRepaintBackgroundOrBorder): We must 
1125         return true if we have a percentage background-size.
1126
1127 2006-04-19  David Hyatt  <hyatt@apple.com>
1128
1129         Fix for a regression in the new text fields.  Don't allow the repaint
1130         rect created by dynamic line layout changes to spill out of an overflow
1131         area's clip region.
1132
1133         (There is no test, since we have no way of testing cases where we repaint
1134          too much rather than too little.)
1135
1136         Reviewed by darin
1137
1138         * rendering/bidi.cpp:
1139         (WebCore::RenderBlock::layoutInlineChildren):
1140
1141 2006-04-19  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1142
1143         Fix for bug 8449, incomplete repaint of table cell that moved.  This
1144         fix also solves some of the textfield repainting problems (e.g., on
1145         google.com and lxr.mozilla.org).
1146
1147         Reviewed by hyatt
1148
1149         * manual-tests/table-cell-move.html: Added.
1150         * rendering/RenderCanvas.cpp:
1151         (WebCore::RenderCanvas::repaintViewRectangle):
1152         * rendering/RenderTableSection.cpp:
1153         (WebCore::RenderTableSection::layoutRows):
1154
1155 2006-04-19  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1156
1157         Reviewed by Eric, landed by ap.
1158
1159         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8469
1160           CRASH: WebCore::CSSParser::parseDashboardRegions when attr() is passed
1161
1162         Test: fast/css/dashboard-regions-attr-crash.html
1163
1164         * css/cssparser.cpp:
1165         (WebCore::CSSParser::parseDashboardRegions): Added null check for args.
1166
1167 2006-04-18  Rob Buis  <buis@kde.org>
1168
1169         Reviewed by eseidel & darin.  Landed by eseidel.
1170
1171         No automated tests possible (from javascript).
1172
1173         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=6664:
1174         Inspector does not highlight SVG elements properly
1175
1176         Make sure RenderObject::absoluteBoundingBoxRect works for
1177         svg specific render objects by overriding absoluteRects.
1178         This fixes highlighting in the Inspector of svg shapes, paths,
1179         images and text.
1180
1181         * kcanvas/RenderPath.cpp:
1182         (WebCore::RenderPath::absoluteRects):
1183         * kcanvas/RenderPath.h:
1184         * kcanvas/RenderSVGImage.cpp:
1185         (WebCore::RenderSVGImage::getAbsoluteRepaintRect):
1186         (WebCore::RenderSVGImage::absoluteRects):
1187         * kcanvas/RenderSVGImage.h:
1188         * kcanvas/RenderSVGText.cpp:
1189         (WebCore::RenderSVGText::absoluteRects):
1190         * kcanvas/RenderSVGText.h:
1191
1192 2006-04-17  Rob Buis  <buis@kde.org>
1193
1194         Reviewed by eseidel.  Landed by eseidel.
1195
1196         Test: svg/custom/tref-update.svg
1197
1198         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=6427:
1199         <tref> element not implemented
1200
1201         Implementation of <tref> element.
1202
1203         * WebCore.xcodeproj/project.pbxproj:
1204         * ksvg2/svg/SVGTRefElement.cpp: Added.
1205         (SVGTRefElement::SVGTRefElement):
1206         (SVGTRefElement::~SVGTRefElement):
1207         (SVGTRefElement::parseMappedAttribute):
1208         (SVGTRefElement::closeRenderer):
1209         (SVGTRefElement::childShouldCreateRenderer):
1210         (SVGTRefElement::createRenderer):
1211         * ksvg2/svg/SVGTRefElement.h: Added.
1212         (WebCore::SVGTRefElement::rendererIsNeeded):
1213         * ksvg2/svg/SVGTSpanElement.cpp:
1214         (SVGTSpanElement::childShouldCreateRenderer):
1215         * ksvg2/svg/SVGTextElement.cpp:
1216         (WebCore::SVGTextElement::childShouldCreateRenderer):
1217         * ksvg2/svg/svgtags.in:
1218
1219 2006-04-18  Darin Adler  <darin@apple.com>
1220
1221         * rendering/render_form.cpp: (WebCore::RenderSelect::updateFromElement):
1222         Roll out accidentally-landed change for bug 8398.
1223
1224 2006-04-18  Beth Dakin  <bdakin@apple.com>
1225
1226         Reviewed by Darin.
1227
1228         Fix for a leak exposed by background-size and detected by the 
1229         layout tests.
1230
1231         * css/css_valueimpl.cpp:
1232         (WebCore::CSSPrimitiveValue::cleanup): We must deref pairs.
1233
1234 2006-04-18  Beth Dakin  <bdakin@apple.com>
1235
1236         Reviewed by Eric.
1237
1238         Build fix for Windows. Just a few typos from background-size patch.
1239
1240         * platform/cairo/GraphicsContextCairo.cpp:
1241         (WebCore::GraphicsContext::drawTiledImage):
1242         * platform/cairo/ImageCairo.cpp:
1243         (WebCore::Image::tileInRect):
1244
1245 2006-04-18  Beth Dakin  <bdakin@apple.com>
1246
1247         Reviewed by Hyatt.
1248
1249         Implementation of CSS3 background-size property. See 
1250         http://bugzilla.opendarwin.org/show_bug.cgi?id=8353 for details.
1251
1252         * Viewer/ImageView.cpp: Adjust parameters to drawTiledImage()
1253         * css/CSSComputedStyleDeclaration.cpp: Add background-size
1254         * css/CSSPropertyNames.in: Same.
1255         * css/css_valueimpl.h: Add a constructor for Pair that takes the 
1256         two halves of the pair.
1257         * css/cssparser.cpp: Parse background-size. Still need to take care 
1258         of parsing the shorthand.
1259         * css/cssparser.h: Same.
1260         * css/cssstyleselector.cpp: Address background-size.
1261         * css/cssstyleselector.h: Same.
1262         * platform/GraphicsContext.h: drawTiledImage() now takes the 
1263         tileSize so that it can appropriately scale.
1264         * platform/Image.h: Same as above, but for tileInRect()
1265         * platform/cairo/GraphicsContextCairo.cpp:
1266         (WebCore::GraphicsContext::drawTiledImage):
1267         * platform/cairo/ImageCairo.cpp:
1268         (WebCore::Image::tileInRect): Take care of scaling image in 
1269         necessary in Cairo.
1270         * platform/mac/GraphicsContextMac.mm:
1271         (WebCore::GraphicsContext::drawTiledImage): 
1272         * platform/mac/ImageMac.mm:
1273         (WebCore::Image::tileInRect): Take care of scaling image if 
1274         necessary in CG.
1275         * rendering/RenderBox.cpp:
1276         (WebCore::RenderBox::paintBackgroundExtended): Compute appropriate 
1277         scale if background-size is set. If no-repeat is set, just call 
1278         drawImage() directly.
1279         * rendering/render_style.cpp: Add background-size to the style.
1280         (WebCore::m_next):
1281         (WebCore::BackgroundLayer::BackgroundLayer):
1282         (WebCore::BackgroundLayer::operator=):
1283         (WebCore::BackgroundLayer::operator==):
1284         (WebCore::BackgroundLayer::fillUnsetProperties):
1285         (WebCore::BackgroundLayer::cullEmptyLayers):
1286         * rendering/render_style.h: Same.
1287         (WebCore::BackgroundLayer::backgroundSize):
1288         (WebCore::BackgroundLayer::isBackgroundSizeSet):
1289         (WebCore::BackgroundLayer::setBackgroundSize):
1290         (WebCore::BackgroundLayer::clearBackgroundSize):
1291         (WebCore::RenderStyle::backgroundSize):
1292         (WebCore::RenderStyle::initialBackgroundSize):
1293
1294 2006-04-17  Justin Garcia  <justin.garcia@apple.com>
1295
1296         Reviewed by harrison
1297
1298         * editing/CompositeEditCommand.cpp:
1299         (WebCore::CompositeEditCommand::moveParagraph): The placeholder that's inserted 
1300         to keep content from collapsing due to pruning was inserted at the position after 
1301         the moved paragraph.  That's only appropriate when moving the paragraph backward 
1302         into the previous paragraph.
1303         
1304         * editing/ReplaceSelectionCommand.cpp:
1305         (WebCore::ReplaceSelectionCommand::doApply): The last paragraph of the incoming
1306         fragment should be merged with the paragraph after the end of the selection being pasted
1307         into even if the incoming fragment has only one block.   This fixes a bug and gets
1308         rid of a use of the info gathered during the test insertion.
1309
1310 2006-04-17  Adele Peterson  <adele@apple.com>
1311
1312         Reviewed by Darin.
1313
1314         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8407
1315         REGRESSION (NativeTextField): Leading and trailing spaces trimmed from text field value attribute
1316
1317         Test: fast/forms/input-spaces.html
1318
1319         * rendering/RenderTextField.cpp: (WebCore::RenderTextField::createDivStyle): 
1320         Use white-space:pre for the inner div to avoid collapsing spaces in the text field.
1321
1322 2006-04-18  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1323
1324         Reviewed by Darin.
1325
1326         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8437
1327           iExploder(#293): Crash in StringImpl::hash()
1328
1329         * manual-tests/applet-param-no-name.html: Added.
1330         * rendering/RenderApplet.cpp:
1331         (WebCore::RenderApplet::createWidgetIfNecessary): Skip param elements with
1332         empty name.
1333
1334 2006-04-18  Darin Adler  <darin@apple.com>
1335
1336         - try to fix the Windows build
1337
1338         * platform/cairo/GraphicsContextCairo.cpp: (WebCore::setColor):
1339         Update for changes to getRGBA.
1340
1341 2006-04-17  Alexey Proskuryakov  <ap@nypop.com>
1342
1343         Reviewed by Darin.
1344
1345         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8440
1346         iExploder(#3327): Crash in StringImpl::initWithQChar()
1347
1348         Test: fast/parser/number-sign-in-map-name.html
1349
1350         * html/html_imageimpl.cpp:
1351         (WebCore::HTMLMapElement::parseMappedAttribute): Fixed handling of names starting with a '#'.
1352
1353 2006-04-17  Adele Peterson  <adele@apple.com>
1354
1355         Reviewed by Darin.
1356
1357         Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=8269
1358         REGRESSION: disabled text field does not display greyed-out text
1359
1360         * rendering/RenderTextField.cpp: (WebCore::RenderTextField::createDivStyle): 
1361         For disabled text fields, lighten or darken text color based on background color.
1362         Tries to get as close as possible to logic in AppKit for old text fields.
1363         * platform/Color.h: Removed hsv and setHsv since they were just used within Color.cpp.
1364         * platform/Color.cpp:
1365         (WebCore::parseHexColor): Cleanup.
1366         (WebCore::differenceSquared): Added. Returns the difference squared of two colors.
1367         (WebCore::convertRGBToHSV): Added static function. Replaces hsv and setHSV, and fixes bug in old implementation of the algorithm.
1368         (WebCore::convertHSVToRGB): ditto.
1369         (WebCore::Color::light): No longer takes in a factor, since all callers use the same factor.  Uses new conversion functions.
1370         (WebCore::Color::dark): ditto.
1371         * rendering/InlineTextBox.cpp: Removed simpleDifferenceBetweenColors.
1372         (WebCore::correctedTextColor):  Uses differenceSquared instead of simpleDifferenceBetweenColors.
1373
1374 2006-04-17  David Hyatt  <hyatt@apple.com>
1375
1376         Fix for bug 8270, text highlights outside of textfield when it shouldn't.
1377
1378         Reviewed by darin
1379
1380         Added fast/forms/input-double-click-selection-gap-bug.html
1381
1382         * rendering/RenderBlock.cpp:
1383         (WebCore::RenderBlock::fillInlineSelectionGaps):
1384
1385 2006-04-17  David Hyatt  <hyatt@apple.com>
1386
1387         Fix for bug 8848, caret off by 1 pixel on numerous pixel tests.
1388
1389         Reviewed by darin
1390
1391         * rendering/InlineTextBox.cpp:
1392         (WebCore::InlineTextBox::positionForOffset):
1393         * rendering/RenderText.cpp:
1394         (WebCore::RenderText::caretRect):
1395
1396 2006-04-17  Timothy Hatcher  <timothy@apple.com>
1397
1398         Reviewed by Darin.
1399
1400         <rdar://problem/4506601> TOT WebCore fails to build ppc64
1401
1402         Switch many CG calls to use CGFloat for colors and gradients
1403
1404         * bindings/objc/DOMCSS.mm:
1405         (-[DOMRGBColor dealloc]): cast _internal to uintptr_t
1406         (-[DOMRGBColor finalize]): cast _internal to uintptr_t
1407         (-[DOMRGBColor red]): cast _internal to uintptr_t
1408         (-[DOMRGBColor green]): cast _internal to uintptr_t
1409         (-[DOMRGBColor blue]): cast _internal to uintptr_t
1410         (-[DOMRGBColor alpha]): cast _internal to uintptr_t
1411         (-[DOMRGBColor _color]): cast _internal to uintptr_t
1412         * bridge/mac/FrameMac.mm:
1413         (WebCore::regExpForLabels): use CFIndex as the type returned from indexOfObject:
1414         * bridge/mac/WebCoreFrameBridge.mm:
1415         (-[WebCoreFrameBridge baseWritingDirectionForSelectionStart]): workaround for <rdar://problem/4509035>
1416         * config.h: define CGFloat if it isn't defined already
1417         * html/CanvasGradient.cpp:
1418         (WebCore::CanvasGradient::addColorStop):
1419         (WebCore::gradientCallback):
1420         (WebCore::CanvasGradient::platformShading):
1421         * html/CanvasRenderingContext2D.cpp:
1422         (WebCore::CanvasRenderingContext2D::setShadow):
1423         (WebCore::CanvasRenderingContext2D::applyShadow):
1424         (WebCore::CanvasRenderingContext2D::applyStrokePattern):
1425         (WebCore::CanvasRenderingContext2D::applyFillPattern):
1426         * html/CanvasStyle.cpp:
1427         (WebCore::CanvasStyle::applyStrokeColor):
1428         (WebCore::CanvasStyle::applyFillColor):
1429         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
1430         (WebCore::alphaImageForImage):
1431         (WebCore::KCanvasFEColorMatrixQuartz::getCIFilter):
1432         * kcanvas/device/quartz/KCanvasMaskerQuartz.mm:
1433         (WebCore::applyLuminanceToAlphaFilter):
1434         (WebCore::applyExpandAlphatoGrayscaleFilter):
1435         (WebCore::transformImageIntoGrayscaleMask):
1436         * kcanvas/device/quartz/KCanvasPathQuartz.mm:
1437         (WebCore::scratchContext):
1438         * kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm:
1439         (WebCore::cgGradientCallback):
1440         (WebCore::CGShadingRefForLinearGradient):
1441         (WebCore::CGShadingRefForRadialGradient):
1442         (WebCore::KRenderingPaintServerGradientQuartz::updateQuartzGradientStopsCache):
1443         * kcanvas/device/quartz/KRenderingPaintServerQuartz.h:
1444         (WebCore::):
1445         * kcanvas/device/quartz/KRenderingPaintServerQuartz.mm:
1446         (WebCore::KRenderingPaintServerPatternQuartz::setup):
1447         * kcanvas/device/quartz/QuartzSupport.mm:
1448         (WebCore::applyStrokeStyleToContext):
1449         * kwq/WebCoreAXObject.mm:
1450         (CreateCGColorIfDifferent):
1451         * platform/Color.cpp:
1452         (WebCore::Color::getRGBA): new name, was getRgbaF. getRGBA uses float and has a double overload
1453         * platform/Color.h:
1454         * platform/mac/ClipboardMac.h: no need to define NSDragOperation
1455         * platform/mac/ColorMac.mm:
1456         (+[WebCoreControlTintObserver WebCore]):
1457         * platform/mac/GraphicsContextMac.mm:
1458         (WebCore::GraphicsContext::drawLine):
1459         * platform/mac/ImageMac.mm:
1460         (WebCore::Image::checkForSolidColor):
1461         (WebCore::Image::tileInRect):
1462         (WebCore::Image::scaleAndTileInRect):
1463         * platform/mac/TextEncodingMac.cpp:
1464         (WebCore::TextEncoding::fromUnicode):
1465
1466 2006-04-17  Justin Garcia  <justin.garcia@apple.com>
1467
1468         Reviewed by darin
1469         
1470         <http://bugzilla.opendarwin.org/show_bug.cgi?id=8402>
1471         Fix interchange newline handling and avoid use of test rendering info
1472
1473         * editing/ReplaceSelectionCommand.cpp:
1474         (WebCore::ReplaceSelectionCommand::doApply):
1475         Fixed bugs in handling of interchange newlines at the end of incoming 
1476         fragments.  Removed the use of !fragment.isBlockFlow since it isn't 
1477         correct and relies on information gathered during the test insertion, which 
1478         we're trying to get rid of. 
1479         * editing/VisiblePosition.h:
1480         (WebCore::VisiblePosition::rootEditableElement): Added for convenience.
1481
1482 2006-04-16  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1483
1484         Reviewed by Darin.
1485
1486         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8408
1487           Paint the highlight behind selected list markers
1488
1489         Test: fast/lists/markers-in-selection.html
1490
1491         * rendering/RenderObject.h: Added selectionColorImageOverlayAlpha constant -
1492         the maximum opacity of the selection color when painted over images.
1493         * rendering/render_list.cpp:
1494         (WebCore::RenderListMarker::RenderListMarker):
1495         (WebCore::RenderListMarker::paint): Paint the selection highlight
1496         if selected: over the marker for image markers, under the marker for all other
1497         markers.
1498         (WebCore::RenderListMarker::setSelectionState): Added.
1499         (WebCore::RenderListMarker::selectionRect): Added.
1500         (WebCore::RenderListMarker::selectionColor): Added. Ensures that the selection
1501         color is transparent for image markers.
1502         * rendering/render_list.h:
1503         (WebCore::RenderListMarker::selectionState):
1504         (WebCore::RenderListMarker::canBeSelectionLeaf):
1505         * rendering/render_replaced.cpp
1506         (WebCore::RenderReplaced::selectionColor): Changed to use the selectionColorImageOverlayAlpha
1507         constant.
1508
1509 2006-04-16  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1510
1511         Reviewed by Darin.
1512
1513         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8420
1514           iExploder(#12): Assertion failure in RenderContainer::removeChildNode
1515
1516         Test: fast/forms/button-inner-block-reuse.html
1517
1518         Buttons have a distinguished anonymous child that holds all their other
1519         descendants. Descendants ended up in a sibling anonymous block as the
1520         initial anonymous child was being reused to hold the initial part of an
1521         inline that got split.
1522
1523         * rendering/RenderInline.cpp:
1524         (WebCore::RenderInline::splitFlow): Check if the anonymous block's parent
1525         allows us to reuse it.
1526         * rendering/RenderObject.h:
1527         (WebCore::RenderObject::allowsReusingAnonymousChild): Added. Returns true.
1528         * rendering/render_button.h:
1529         (WebCore::RenderButton::allowsReusingAnonymousChild): Added. Returns false.
1530
1531 2006-04-16  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1532
1533         Reviewed by Justin.
1534
1535         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8394
1536           Editable region does not accept dropped text if there is no selection
1537
1538         Test: editing/pasteboard/drop-text-without-selection.html
1539
1540         * bridge/mac/WebCoreFrameBridge.mm:
1541         (-[WebCoreFrameBridge documentFragmentWithText:]): Changed to allow
1542         creating a fragment regardless of the selection.
1543
1544 2006-04-16  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1545
1546         Reviewed by Darin.
1547
1548         - WebCore part of fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8324
1549           REGRESSION: textarea :focus not applied immediately
1550
1551         * bridge/mac/WebCoreFrameBridge.h:
1552         * kwq/KWQComboBox.mm:
1553         (-[KWQPopUpButton becomeFirstResponder]): Added call to formControlIsBecomingFirstResponder:.
1554         (-[KWQPopUpButton resignFirstResponder]): Cleaned up.
1555         * kwq/KWQListBox.mm: Ditto.
1556         (-[KWQTableView becomeFirstResponder]):
1557         (-[KWQTableView resignFirstResponder]):
1558         * kwq/KWQSlider.mm:
1559         (-[KWQSlider becomeFirstResponder]): Added call to formControlIsBecomingFirstResponder: and
1560         cleaned up.
1561         (-[KWQSlider resignFirstResponder]): Cleaned up.
1562         * platform/mac/WebCoreTextArea.mm:
1563         (-[WebCoreTextView becomeFirstResponder]): Added call to formControlIsBecomingFirstResponder:.
1564         (-[WebCoreTextView resignFirstResponder]): Cleaned up.
1565         * platform/mac/WebCoreTextField.mm:
1566         (-[KWQTextFieldController setHasFocus:]): Added call to formControlIsBecomingFirstResponder:.
1567         * manual-tests/textarea-focus.html: Added.
1568
1569 2006-04-16  Darin Adler  <darin@apple.com>
1570
1571         Reviewed by Adele and Justin.
1572
1573         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8298
1574           REGRESSION: Crash occurs when attempting to drag selection into
1575           Depart/Return input fields at http://www.travelocity.com/
1576         - remove the mutation event listener that's installed all the time,
1577           since it slows things down a bit
1578
1579         Calling SelectionController::nodeWillBeRemoved from Document::notifyBeforeNodeRemoval
1580         fixes the crash, which was happening because the call that was removing the text
1581         node, removeChildren, does not send a "node removed" mutation event (it sends a
1582         "subtree modified" mutation event instead). So this change alone fixes the crash.
1583
1584         But I also changed setInnerText to not blow away the text node each time the value
1585         is changed, and that makes the test case behave even better -- you don't even lose
1586         the selection; it works as it did with the NSTextField-based text field.
1587
1588         * manual-tests/input-empty-on-focus.html: Added.
1589
1590         * page/Frame.h: Tweaked a few comments and functions related to selection.
1591         * page/Frame.cpp: (WebCore::Frame::dragCaret): Made non-const.
1592
1593         * dom/Document.cpp: (WebCore::Document::notifyBeforeNodeRemoval):
1594         Call nodeWillBeRemoved on the two selection controllers before removing
1595         a node from the document.
1596
1597         * editing/SelectionController.h: Tweak formatting. Remove MutationListener
1598         class and m_mutationListener field.
1599         * editing/SelectionController.cpp:
1600         (WebCore::SelectionController::SelectionController): Remove code to set up
1601         the mutation event listener.
1602         (WebCore::SelectionController::setSelection): Remove code to maintain the
1603         mutation event listener.
1604
1605         * html/HTMLElement.cpp:
1606         (WebCore::HTMLElement::setInnerHTML): In cases where the container has only a
1607         single child use replaceChild, and in cases where the HTML being inserted
1608         also has only a single child and both are text nodes use setData. It's common
1609         to use setInnerHTML to set something that's just text.
1610         (WebCore::HTMLElement::setInnerText): Same as above, but simpler since the
1611         thing we're replacing with is always text.
1612
1613 2006-04-16  Kevin Ollivier  <kevino@theolliviers.com>
1614
1615         Reviewed by Darin.
1616
1617         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8417
1618           make-css-file-arrays.pl hangs when run on Linux
1619
1620         * css/make-css-file-arrays.pl: Remove the "-" parameter from the invocation of cpp,
1621         which means "send output to stdout". It's optional on Mac OS X, and is causing a
1622         hang on Linux.
1623         * rendering/RenderArena.cpp: Added a missing include of <assert.h>.
1624
1625 2006-04-15  Darin Adler  <darin@apple.com>
1626
1627         - removed references to a couple files that are obsolete
1628           but were still in the Windows project file
1629
1630         * WebCore.vcproj/WebCore/WebCore.vcproj: Remove kjs_views.h and .cpp.
1631
1632 2006-04-15  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1633
1634         Reviewed by Maciej.
1635
1636         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8405
1637           REGRESSION: Web Inspector's Style pane is blank
1638
1639         * bindings/js/kjs_window.cpp:
1640         (KJS::Window::isSafeScript): Use isEmpty() instead of isNull() for checking
1641         the domain to determine if the document in a local file. 
1642
1643 2006-04-14  David Hyatt  <hyatt@apple.com>
1644
1645         CSS vendor-specific property/value cleanup.  Properly qualify background-clip,
1646         background-origin, border-image and the border-radius properties.  Make sure
1647         our overflow extensions of marquee and overlay are qualified as well.  Rename
1648         the -khtml- extension to -webkit.
1649
1650         Reviewed by beth
1651
1652         * bindings/js/kjs_css.cpp:
1653         (KJS::cssPropertyName):
1654         * bindings/objc/DOMCSS.mm:
1655         (-[DOMCSSStyleDeclaration _fontSizeDelta]):
1656         (-[DOMCSSStyleDeclaration _setFontSizeDelta:]):
1657         * bindings/objc/DOMHTML.mm:
1658         (-[DOMHTMLInputElement _setAutofilled:]):
1659         * bridge/mac/FrameMac.h:
1660         * bridge/mac/FrameMac.mm:
1661         * css/CSSComputedStyleDeclaration.cpp:
1662         (WebCore::):
1663         (WebCore::valueForTextAlign):
1664         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
1665         * css/CSSGrammar.y:
1666         * css/CSSPropertyNames.in:
1667         * css/CSSValueKeywords.in:
1668         * css/css_base.cpp:
1669         (WebCore::CSSSelector::extractPseudoType):
1670         * css/css_valueimpl.cpp:
1671         (WebCore::):
1672         * css/css_valueimpl.h:
1673         * css/cssparser.cpp:
1674         (WebCore::CSSParser::parseRule):
1675         (WebCore::CSSParser::parseValue):
1676         (WebCore::CSSParser::parseColor):
1677         (WebCore::CSSParser::parseDeclaration):
1678         (WebCore::CSSParser::parseBackgroundShorthand):
1679         (WebCore::CSSParser::parseBackgroundColor):
1680         (WebCore::CSSParser::parseBackgroundProperty):
1681         (WebCore::CSSParser::parseFontFamily):
1682         (WebCore::CSSParser::parseShadow):
1683         * css/cssstyleselector.cpp:
1684         (WebCore::CSSStyleSelector::applyDeclarations):
1685         (WebCore::CSSStyleSelector::applyProperty):
1686         (WebCore::CSSStyleSelector::getColorFromPrimitiveValue):
1687         * css/cssstyleselector.h:
1688         * css/html4.css:
1689         * css/quirks.css:
1690         * css/tokenizer.flex:
1691         * editing/ApplyStyleCommand.cpp:
1692         (WebCore::StyleChange::init):
1693         (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
1694         (WebCore::ApplyStyleCommand::removeInlineStyle):
1695         * editing/CompositeEditCommand.cpp:
1696         (WebCore::blockPlaceholderClassString):
1697         * editing/JSEditor.cpp:
1698         * editing/ReplaceSelectionCommand.cpp:
1699         (WebCore::ReplaceSelectionCommand::fixupNodeStyles):
1700         (WebCore::styleForNode):
1701         * editing/htmlediting.cpp:
1702         (WebCore::rebalanceWhitespaceInTextNode):
1703         * html/HTMLElement.cpp:
1704         (WebCore::HTMLElement::addHTMLAlignment):
1705         (WebCore::HTMLElement::setContentEditable):
1706         * html/html_blockimpl.cpp:
1707         (WebCore::HTMLDivElement::parseMappedAttribute):
1708         (WebCore::HTMLParagraphElement::parseMappedAttribute):
1709         (WebCore::HTMLMarqueeElement::parseMappedAttribute):
1710         * html/html_inlineimpl.cpp:
1711         (WebCore::HTMLFontElement::parseMappedAttribute):
1712         * html/html_tableimpl.cpp:
1713         (WebCore::HTMLTablePartElement::parseMappedAttribute):
1714         (WebCore::HTMLTableCellElement::parseMappedAttribute):
1715         * page/Frame.cpp:
1716         (WebCore::Frame::canMouseDownStartSelect):
1717         * page/Frame.h:
1718         * rendering/RenderObject.cpp:
1719         (WebCore::RenderObject::draggableNode):
1720
1721 2006-04-14  Eric Seidel  <eseidel@apple.com>
1722
1723         Reviewed by beth.
1724
1725         Fix win32 build.
1726
1727         * WebCore.vcproj/WebCore/WebCore.vcproj:
1728         * page/FramePrivate.h:
1729
1730 2006-04-04  Eric Seidel  <eseidel@apple.com>
1731
1732         Reviewed by darin.
1733
1734         Fix build-warnings in cairo code.
1735         http://bugzilla.opendarwin.org/show_bug.cgi?id=8176
1736
1737         * platform/cairo/cairo/src/cairo-win32-surface.c:
1738         (_cairo_win32_print_gdi_error):
1739         (_cairo_win32_surface_create_for_dc):
1740         (_composite_alpha_blend):
1741         (cairo_win32_surface_create):
1742         * platform/cairo/pixman/src/iccolor.c:
1743         (pixman_pixel_to_color):
1744
1745 2006-04-14  David Hyatt  <hyatt@apple.com>
1746
1747         Fix for 8333, make sure newlines in whitespace:pre (and friends) get
1748         line boxes created for them.  This resolves all the weird selection/navigation
1749         issues that arise by not creating lines (and thus not having navigable positions
1750         on those lines).
1751
1752         This checkin is also removing all of the layout test hacks that have piled
1753         up, so layout test results are being regenerated completely.
1754
1755         Reviewed by eric
1756
1757         * dom/Position.cpp:
1758         (WebCore::Position::downstream):
1759         * editing/CompositeEditCommand.cpp:
1760         (WebCore::CompositeEditCommand::moveParagraph):
1761         * editing/DeleteSelectionCommand.cpp:
1762         (WebCore::DeleteSelectionCommand::doApply):
1763         * editing/visible_units.cpp:
1764         (WebCore::startOfParagraph):
1765         (WebCore::endOfParagraph):
1766         * kwq/RenderTreeAsText.cpp:
1767         (getTagName):
1768         (operator<<):
1769         * rendering/InlineTextBox.cpp:
1770         (WebCore::InlineTextBox::selectionState):
1771         (WebCore::InlineTextBox::isLineBreak):
1772         (WebCore::InlineTextBox::nodeAtPoint):
1773         (WebCore::InlineTextBox::paint):
1774         (WebCore::InlineTextBox::offsetForPosition):
1775         (WebCore::InlineTextBox::positionForOffset):
1776         * rendering/InlineTextBox.h:
1777         * rendering/RenderBR.cpp:
1778         * rendering/RenderBR.h:
1779         * rendering/RenderText.cpp:
1780         (WebCore::RenderText::atLineWrap):
1781         (WebCore::RenderText::caretRect):
1782         (WebCore::RenderText::height):
1783         (WebCore::RenderText::inlineBox):
1784         * rendering/bidi.cpp:
1785         (WebCore::RenderBlock::computeHorizontalPositionsForLine):
1786         (WebCore::RenderBlock::layoutInlineChildren):
1787         (WebCore::RenderBlock::findNextLineBreak):
1788         * rendering/render_line.h:
1789         (WebCore::InlineBox::isLineBreak):
1790
1791 2006-04-13  Darin Adler  <darin@apple.com>
1792
1793         Reviewed by Geoff.
1794
1795         - moved a few things out of kwq and cleaned up the
1796           Java-applet-related renderers
1797
1798         * WebCore.vcproj/WebCore/WebCore.vcproj: Updated for file location
1799         and name changes.
1800         * WebCore.xcodeproj/project.pbxproj: Ditto.
1801
1802         * kwq/JavaAppletWidget.h: Moved.
1803         * kwq/JavaAppletWidget.mm: Moved.
1804         * kwq/RegularExpression.cpp: Moved.
1805         * kwq/RegularExpression.h: Moved.
1806         * kwq/RenderTreeAsText.cpp: Moved.
1807         * kwq/RenderTreeAsText.h: Moved.
1808         * rendering/render_applet.cpp: Moved.
1809         * rendering/render_applet.h: Moved.
1810
1811         * bridge/JavaAppletWidget.h: Moved here.
1812         * bridge/mac/JavaAppletWidget.mm: Moved here.
1813         * platform/RegularExpression.cpp: Moved here.
1814         * platform/RegularExpression.h: Moved here.
1815         * rendering/RenderTreeAsText.cpp: Moved here.
1816         * rendering/RenderTreeAsText.h: Moved here.
1817
1818         * rendering/RenderApplet.h: Moved here and made changes.
1819         Removed unused element() function.
1820         * rendering/RenderApplet.cpp: Moved here and made changes.
1821         (WebCore::RenderApplet::RenderApplet): Changed parameter type to
1822         be more precise (HTMLAppletElement).
1823         (WebCore::RenderApplet::intrinsicWidth): Removed unnecessary type
1824         cast and simplified.
1825         (WebCore::RenderApplet::intrinsicHeight): Ditto.
1826         (WebCore::RenderApplet::createWidgetIfNecessary): Straightened out
1827         the if statements and changed to use node() instead of element().
1828         (WebCore::RenderApplet::layout): Removed unneeded check before
1829         calling createWidgetIfNecessary.
1830
1831         * rendering/RenderEmptyApplet.h: Moved here and made changes.
1832         Removed unneeded overrides of intrinsicWidth and intrinsicHeight.
1833         * rendering/RenderEmptyApplet.cpp: Moved here and made changes.
1834         (WebCore::RenderEmptyApplet::RenderEmptyApplet): Added code to
1835         set the intrinsic width and height.
1836
1837         * rendering/render_replaced.cpp:
1838         (WebCore::RenderWidget::RenderWidget): Initialize m_widget
1839         with contructor syntax.
1840         (WebCore::RenderWidget::paint): Changed _tx and _ty to be just
1841         tx and ty. Rearranged the code so the transparent wash will draw
1842         even if m_widget is 0.
1843
1844         * html/html_objectimpl.cpp: Update includes for new file names.
1845
1846 2006-04-12  Geoffrey Garen  <ggaren@apple.com>
1847
1848         Reviewed by Darin.
1849
1850         - Fixed <rdar://problem/4478467> document.defaultView should return 
1851         the window object
1852         
1853         Also made part of the window object autogenerated by IDL file.
1854         
1855         * DerivedSources.make: Added /page to IDL file search path, added
1856         JSDOMWindow.h, removed kjs_views.lut.h
1857         * WebCore.xcodeproj/project.pbxproj: Added missing files, removed
1858         obsolete files
1859         * bindings/js/kjs_dom.cpp:
1860         * bindings/js/kjs_events.cpp:
1861         * bindings/js/kjs_proxy.cpp:
1862         (WebCore::KJSProxy::initScriptIfNeeded):
1863         * bindings/js/kjs_views.cpp: Removed.
1864         * bindings/js/kjs_views.h: Removed.
1865         * bindings/js/kjs_window.cpp: Removed document property -- it now
1866         belongs to JSDOMWindow. Added toJS and toDOMWindow.
1867         (KJS::Window::Window):
1868         (KJS::Window::impl):
1869         (KJS::Window::getValueProperty):
1870         (KJS::Window::clear): Added call to setPrototype to ensure
1871         that the prototype gets cleared during navigation. (Previously
1872         this wasn't an issue because the window object had no real prototype.)
1873         (WebCore::toJS):
1874         (WebCore::toDOMWindow):
1875         * bindings/js/kjs_window.h:
1876         (KJS::Window::):
1877         * bindings/objc/DOMCSS.mm: Added NULL checks for the AbstractView
1878         (Presumably this is an issue after the window is closed.) Typedef-ed
1879         AbstractView as DOMWindow. I could have just replaced AbstractView
1880         with DOMWindow, but I think it's clearer to say, "There's this thing
1881         called the AbstractView, but really it's just the window."
1882         (-[DOMDocument getComputedStyle::]):
1883         (-[DOMDocument getMatchedCSSRules::]):
1884         * bindings/objc/DOMViews.mm:
1885         * bindings/objc/DOMViewsInternal.h:
1886         * bindings/scripts/CodeGeneratorJS.pm: Removed unused
1887         GetLegacyImplementationIncludes. Added support for DOMWindow and new
1888         "DoNotCache" attribute. Replaced C macros with text because (1) it
1889         makes the generated source easier to read and debug and (2) it made 
1890         it much easier to implement the DoNotCache attribute.
1891         * bindings/scripts/IDLParser.pm: Return a hash reference instead of
1892         a hash, because otherwise an interface with more than one attribute
1893         returns too many arguments to be processed.
1894         * bridge/mac/FrameMac.mm:
1895         * dom/AbstractView.cpp: Removed.
1896         * dom/AbstractView.h: Removed.
1897         * dom/Document.cpp:
1898         (WebCore::Document::Document):
1899         (WebCore::Document::defaultView):
1900         * dom/Document.h:
1901         * dom/Document.idl:
1902         * dom/KeyboardEvent.idl:
1903         * dom/MouseEvent.idl:
1904         * dom/Position.cpp:
1905         * dom/UIEvent.idl:
1906         * dom/dom2_eventsimpl.h:
1907         * page/DOMWindow.cpp: Added.
1908         (WebCore::DOMWindow::DOMWindow):
1909         (WebCore::DOMWindow::frame):
1910         (WebCore::DOMWindow::disconnectFrame):
1911         (WebCore::DOMWindow::document):
1912         (WebCore::DOMWindow::getComputedStyle):
1913         (WebCore::DOMWindow::getMatchedCSSRules):
1914         * page/DOMWindow.h: Added.
1915         * page/DOMWindow.idl: Added.
1916         * page/Frame.cpp:
1917         (WebCore::Frame::~Frame): Disconnect the new DOMWindow object in
1918         addition to the Window object. Maybe we can unify this in the future.
1919         (WebCore::Frame::tree):
1920         (WebCore::Frame::domWindow):
1921         * page/Frame.h:
1922         * page/FramePrivate.h:
1923
1924 2006-04-13  Alexey Proskuryakov  <ap@nypop.com>
1925
1926         Reviewed by Darin.
1927
1928         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7602
1929         Only use fixupChar for entities
1930
1931         * html/HTMLTokenizer.cpp: Only use fixUpChar() when handling entities.
1932         (WebCore::HTMLTokenizer::parseSpecial):
1933         (WebCore::HTMLTokenizer::parseText):
1934         (WebCore::HTMLTokenizer::parseTag):
1935         (WebCore::HTMLTokenizer::write):
1936         * platform/StreamingTextDecoder.cpp:
1937         (WebCore::StreamingTextDecoder::convert): Remove the special case for Latin-1, because it is already handled 
1938         via effectiveEncoding().
1939         * platform/StreamingTextDecoder.h: Remove convertLatin1().
1940
1941 2006-04-13  Darin Adler  <darin@apple.com>
1942
1943         * platform/mac/GraphicsContextMac.mm: Fix one no-SVG compile problem by adding
1944         a "using namespace std".
1945
1946 2006-04-12  Darin Adler  <darin@apple.com>
1947
1948         Rubber-stamped by Anders.
1949
1950         - fix Windows build
1951
1952         * WebCore.vcproj/Image\ Viewer/Image\ Viewer.vcproj: Add loader directory.
1953
1954         - use std::min/max exclusively intead of kMin/Max
1955         - eliminate KWQDef.h since all it had left in it was kMin/Max
1956
1957         * WebCore.vcproj/WebCore/WebCore.vcproj: Remove KWQDef.h.
1958         * WebCore.xcodeproj/project.pbxproj: Ditto.
1959
1960         * kwq/KWQDef.h: Removed.
1961
1962         * bridge/mac/FrameMac.mm:
1963         (WebCore::FrameMac::attributedString):
1964         * bridge/mac/WebCoreFrameBridge.mm:
1965         (-[WebCoreFrameBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
1966         * css/cssstyleselector.cpp:
1967         (WebCore::CSSStyleSelector::applyProperty):
1968         (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
1969         (WebCore::CSSStyleSelector::fontSizeForKeyword):
1970         * dom/Document.cpp:
1971         (WebCore::Document::minimumLayoutDelay):
1972         (WebCore::Document::addMarker):
1973         * dom/StyledElement.cpp:
1974         (WebCore::StyledElement::addCSSColor):
1975         * dom/xml_tokenizer.cpp:
1976         (WebCore::OffsetBuffer::readOutBytes):
1977         * editing/ApplyStyleCommand.cpp:
1978         (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
1979         * editing/CompositeEditCommand.cpp:
1980         (WebCore::CompositeEditCommand::deleteInsignificantText):
1981         * editing/TextIterator.cpp:
1982         (WebCore::TextIterator::handleTextNode):
1983         (WebCore::TextIterator::handleTextBox):
1984         (WebCore::CharacterIterator::string):
1985         (WebCore::findPlainText):
1986         * editing/htmlediting.cpp:
1987         (WebCore::rangeCompliantEquivalent):
1988         * editing/markup.cpp:
1989         (WebCore::renderedText):
1990         * editing/visible_units.cpp:
1991         (WebCore::startOfParagraph):
1992         * html/HTMLSelectElement.cpp:
1993         (WebCore::HTMLSelectElement::parseMappedAttribute):
1994         * html/HTMLTokenizer.cpp:
1995         (WebCore::HTMLTokenizer::parseComment):
1996         (WebCore::HTMLTokenizer::parseEntity):
1997         (WebCore::HTMLTokenizer::parseTag):
1998         (WebCore::HTMLTokenizer::enlargeBuffer):
1999         (WebCore::HTMLTokenizer::enlargeScriptBuffer):
2000         * html/html_imageimpl.cpp:
2001         (WebCore::HTMLAreaElement::getRegion):
2002         * html/html_tableimpl.cpp:
2003         (WebCore::HTMLTableElement::parseMappedAttribute):
2004         * ksvg2/css/SVGCSSParser.cpp:
2005         (WebCore::CSSParser::parseSVGPaint):
2006         (WebCore::CSSParser::parseSVGColor):
2007         * kwq/KWQComboBox.mm:
2008         (QComboBox::sizeHint):
2009         * kwq/KWQListBox.mm:
2010         (QListBox::sizeForNumberOfLines):
2011         * kwq/KWQSlider.mm:
2012         (QSlider::setValue):
2013         * loader/Cache.cpp:
2014         (WebCore::Cache::setSize):
2015         * page/Frame.cpp:
2016         (WebCore::Frame::forceLayoutWithPageWidthRange):
2017         * platform/DeprecatedPtrListImpl.h:
2018         * platform/DeprecatedString.cpp:
2019         (ucstrcmp):
2020         * platform/DeprecatedString.h:
2021         * platform/DeprecatedValueListImpl.h:
2022         * platform/mac/GraphicsContextMac.mm:
2023         (WebCore::GraphicsContext::addRoundedRectClip):
2024         * platform/mac/WebCoreTextArea.mm:
2025         (-[WebCoreTextView _trackResizeFromMouseDown:]):
2026         * rendering/InlineTextBox.cpp:
2027         (WebCore::InlineTextBox::isSelected):
2028         (WebCore::InlineTextBox::selectionRect):
2029         (WebCore::InlineTextBox::placeEllipsisBox):
2030         (WebCore::InlineTextBox::selectionStartEnd):
2031         (WebCore::InlineTextBox::paintMarkedTextBackground):
2032         (WebCore::InlineTextBox::paintSpellingMarker):
2033         (WebCore::InlineTextBox::paintTextMatchMarker):
2034         (WebCore::InlineTextBox::paintMarkedTextUnderline):
2035         * rendering/RenderBlock.cpp:
2036         (WebCore::RenderBlock::overflowRect):
2037         (WebCore::RenderBlock::layoutBlock):
2038         (WebCore::RenderBlock::collapseMargins):
2039         (WebCore::RenderBlock::clearFloatsIfNeeded):
2040         (WebCore::RenderBlock::estimateVerticalPosition):
2041         (WebCore::RenderBlock::determineHorizontalPosition):
2042         (WebCore::RenderBlock::setCollapsedBottomMargin):
2043         (WebCore::RenderBlock::handleBottomOfBlock):
2044         (WebCore::RenderBlock::layoutBlockChildren):
2045         (WebCore::RenderBlock::fillVerticalSelectionGap):
2046         (WebCore::RenderBlock::fillLeftSelectionGap):
2047         (WebCore::RenderBlock::fillRightSelectionGap):
2048         (WebCore::RenderBlock::positionNewFloats):
2049         (WebCore::RenderBlock::nearestFloatBottom):
2050         (WebCore::RenderBlock::lowestPosition):
2051         (WebCore::RenderBlock::rightmostPosition):
2052         (WebCore::RenderBlock::leftmostPosition):
2053         (WebCore::RenderBlock::getClearDelta):
2054         (WebCore::RenderBlock::calcMinMaxWidth):
2055         (WebCore::RenderBlock::calcInlineMinMaxWidth):
2056         (WebCore::RenderBlock::calcBlocminMaxWidth):
2057         * rendering/RenderBlock.h:
2058         * rendering/RenderBox.cpp:
2059         (WebCore::RenderBox::calcBorderBoxWidth):
2060         (WebCore::RenderBox::calcBorderBoxHeight):
2061         (WebCore::RenderBox::calcContentBoxWidth):
2062         (WebCore::RenderBox::calcContentBoxHeight):
2063         (WebCore::RenderBox::paintRootBoxDecorations):
2064         (WebCore::RenderBox::paintBoxDecorations):
2065         (WebCore::RenderBox::calcWidth):
2066         (WebCore::RenderBox::calcWidthUsing):
2067         (WebCore::RenderBox::calcHeight):
2068         (WebCore::RenderBox::calcPercentageHeight):
2069         (WebCore::RenderBox::calcReplacedWidth):
2070         (WebCore::RenderBox::calcReplacedHeight):
2071         (WebCore::RenderBox::calcAbsoluteHorizontalValues):
2072         (WebCore::RenderBox::calcAbsoluteVerticalValues):
2073         * rendering/RenderCanvas.cpp:
2074         (WebCore::RenderCanvas::layout):
2075         * rendering/RenderFlexibleBox.cpp:
2076         (WebCore::RenderFlexibleBox::calcMinMaxWidth):
2077         (WebCore::RenderFlexibleBox::layoutHorizontalBox):
2078         (WebCore::RenderFlexibleBox::layoutVerticalBox):
2079         (WebCore::RenderFlexibleBox::allowedChildFlex):
2080         * rendering/RenderFlow.cpp:
2081         (WebCore::RenderFlow::paintLines):
2082         (WebCore::RenderFlow::lowestPosition):
2083         (WebCore::RenderFlow::rightmostPosition):
2084         (WebCore::RenderFlow::leftmostPosition):
2085         (WebCore::RenderFlow::paintOutlineForLine):
2086         * rendering/RenderImage.cpp:
2087         (WebCore::RenderImage::imageChanged):
2088         (WebCore::RenderImage::calcReplacedWidth):
2089         (WebCore::RenderImage::calcReplacedHeight):
2090         * rendering/RenderLayer.cpp:
2091         (WebCore::RenderLayer::scrollRectToVisible):
2092         (WebCore::RenderLayer::computeScrollDimensions):
2093         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
2094         (WebCore::RenderLayer::absoluteBoundingBox):
2095         (WebCore::Marquee::marqueeSpeed):
2096         (WebCore::Marquee::computePosition):
2097         (WebCore::Marquee::timerFired):
2098         * rendering/RenderObject.cpp:
2099         (WebCore::RenderObject::drawBorder):
2100         (WebCore::RenderObject::paintBorderImage):
2101         (WebCore::RenderObject::paintBorder):
2102         (WebCore::RenderObject::repaintAfterLayoutIfNeeded):
2103         * rendering/RenderTable.cpp:
2104         (WebCore::RenderTable::calcWidth):
2105         (WebCore::RenderTable::layout):
2106         (WebCore::RenderTable::paintBoxDecorations):
2107         * rendering/RenderTableCell.cpp:
2108         (WebCore::RenderTableCell::paintBackgroundsBehindCell):
2109         * rendering/RenderTableSection.cpp:
2110         (WebCore::RenderTableSection::layoutRows):
2111         (WebCore::RenderTableSection::lowestPosition):
2112         (WebCore::RenderTableSection::rightmostPosition):
2113         (WebCore::RenderTableSection::leftmostPosition):
2114         * rendering/RenderText.cpp:
2115         (WebCore::RenderText::caretRect):
2116         (WebCore::RenderText::calcMinMaxWidth):
2117         (WebCore::RenderText::minXPos):
2118         (WebCore::RenderText::width):
2119         (WebCore::RenderText::caretMinOffset):
2120         (WebCore::RenderText::caretMaxOffset):
2121         * rendering/bidi.cpp:
2122         (WebCore::RenderBlock::computeHorizontalPositionsForLine):
2123         (WebCore::RenderBlock::layoutInlineChildren):
2124         (WebCore::RenderBlock::checkLinesForOverflow):
2125         * rendering/render_form.cpp:
2126         (WebCore::RenderLineEdit::setSelectionStart):
2127         (WebCore::RenderLineEdit::setSelectionEnd):
2128         (WebCore::RenderLineEdit::setSelectionRange):
2129         (WebCore::RenderFieldset::layoutLegend):
2130         (WebCore::RenderFieldset::paintBoxDecorations):
2131         (WebCore::RenderSelect::layout):
2132         (WebCore::RenderTextArea::calcMinMaxWidth):
2133         (WebCore::RenderSlider::updateFromElement):
2134         * rendering/render_frames.cpp:
2135         (WebCore::RenderFrameSet::layout):
2136         * rendering/render_line.cpp:
2137         (WebCore::InlineFlowBox::placeBoxesHorizontally):
2138         (WebCore::InlineFlowBox::verticallyAlignBoxes):
2139         (WebCore::InlineFlowBox::adjustMaxAscentAndDescent):
2140         (WebCore::InlineFlowBox::placeBoxesVertically):
2141         (WebCore::InlineFlowBox::paintBackgroundAndBorder):
2142         * rendering/render_line.h:
2143         (WebCore::RootInlineBox::selectionHeight):
2144         * rendering/render_list.cpp:
2145         (WebCore::RenderListItem::positionListMarker):
2146         * rendering/render_replaced.cpp:
2147         (WebCore::RenderReplaced::shouldPaint):
2148         * rendering/table_layout.cpp:
2149         (WebCore::FixedTableLayout::calcMinMaxWidth):
2150         (WebCore::AutoTableLayout::recalcColumn):
2151         (WebCore::AutoTableLayout::calcMinMaxWidth):
2152         (WebCore::AutoTableLayout::calcEffectiveWidth):
2153         (WebCore::AutoTableLayout::layout):
2154         Use min/max instead of kMin/kMax.
2155
2156 2006-04-12  Darin Adler  <darin@apple.com>
2157
2158         Rubber-stamped by Anders.
2159
2160         - get ready for some more de-KWQ-ing done by the renaming script in two ways
2161             1) stop using forwarding headers for things within WebCore
2162             2) remove a bit of unused stuff
2163
2164         * loader/CachedImage.h:
2165         * loader/CachedImage.cpp:
2166         * loader/DocLoader.cpp:
2167         * loader/DocLoader.h:
2168         * page/Frame.cpp:
2169         * xml/XSLTProcessor.cpp:
2170         Removed unused showAnimations functions and data. We can add back later if we need it.
2171         And if we do, we won't use a typedef from KHTMLSettings.
2172
2173         * ForwardingHeaders/java: Removed.
2174         * ForwardingHeaders/java/kjavaappletwidget.h: Removed.
2175         * ForwardingHeaders/khtml_settings.h: Removed.
2176         * ForwardingHeaders/kio: Removed.
2177         * ForwardingHeaders/kio/global.h: Removed.
2178         * ForwardingHeaders/ksslkeygen.h: Removed.
2179         * ForwardingHeaders/q3ptrlist.h: Removed.
2180         * ForwardingHeaders/q3valuelist.h: Removed.
2181         * ForwardingHeaders/qcombobox.h: Removed.
2182         * ForwardingHeaders/qfontmetrics.h: Removed.
2183         * ForwardingHeaders/qlineedit.h: Removed.
2184         * ForwardingHeaders/qmatrix.h: Removed.
2185         * ForwardingHeaders/qptrlist.h: Removed.
2186         * ForwardingHeaders/qptrqueue.h: Removed.
2187         * ForwardingHeaders/qregexp.h: Removed.
2188         * ForwardingHeaders/qscrollbar.h: Removed.
2189         * ForwardingHeaders/qtextedit.h: Removed.
2190         * ForwardingHeaders/qtextstream.h: Removed.
2191         * ForwardingHeaders/qvaluelist.h: Removed.
2192         * ForwardingHeaders/qwmatrix.h: Removed.
2193
2194         * WebCore+SVG/DOMList.h:
2195         * bindings/js/kjs_dom.cpp:
2196         * bindings/js/kjs_dom.h:
2197         * bindings/js/kjs_window.cpp:
2198         * css/css_stylesheetimpl.h:
2199         * css/css_valueimpl.cpp:
2200         * css/css_valueimpl.h:
2201         * css/cssstyleselector.cpp:
2202         * dom/CharacterData.cpp:
2203         * dom/Document.cpp:
2204         * dom/Document.h:
2205         * dom/EventTargetNode.cpp:
2206         * dom/Node.cpp:
2207         * editing/BreakBlockquoteCommand.h:
2208         * editing/htmlediting.cpp:
2209         * html/FormDataList.h:
2210         * html/HTMLKeygenElement.cpp:
2211         * html/HTMLTokenizer.h:
2212         * html/html_objectimpl.cpp:
2213         * kcanvas/KCanvasFilters.cpp:
2214         * kcanvas/KCanvasMatrix.cpp:
2215         * kcanvas/KCanvasMatrix.h:
2216         * kcanvas/KCanvasPath.cpp:
2217         * kcanvas/KCanvasPath.h:
2218         * kcanvas/KCanvasResources.cpp:
2219         * kcanvas/KCanvasTreeDebug.h:
2220         * kcanvas/RenderForeignObject.h:
2221         * kcanvas/RenderPath.h:
2222         * kcanvas/RenderSVGImage.h:
2223         * kcanvas/RenderSVGText.h:
2224         * kcanvas/device/KRenderingPaintServerGradient.cpp:
2225         * kcanvas/device/KRenderingPaintServerPattern.cpp:
2226         * kcanvas/device/KRenderingPaintServerSolid.cpp:
2227         * kcanvas/device/quartz/KCanvasItemQuartz.h:
2228         * kcanvas/device/quartz/KCanvasResourcesQuartz.h:
2229         * ksvg2/svg/SVGColor.cpp:
2230         * ksvg2/svg/SVGComponentTransferFunctionElement.cpp:
2231         * ksvg2/svg/SVGDocument.h:
2232         * ksvg2/svg/SVGFEBlendElement.cpp:
2233         * ksvg2/svg/SVGFEColorMatrixElement.cpp:
2234         * ksvg2/svg/SVGFEComponentTransferElement.cpp:
2235         * ksvg2/svg/SVGFECompositeElement.cpp:
2236         * ksvg2/svg/SVGFEDiffuseLightingElement.cpp:
2237         * ksvg2/svg/SVGFEDisplacementMapElement.cpp:
2238         * ksvg2/svg/SVGFEGaussianBlurElement.cpp:
2239         * ksvg2/svg/SVGFELightElement.cpp:
2240         * ksvg2/svg/SVGFEMergeElement.cpp:
2241         * ksvg2/svg/SVGFEOffsetElement.cpp:
2242         * ksvg2/svg/SVGFESpecularLightingElement.cpp:
2243         * ksvg2/svg/SVGFETileElement.cpp:
2244         * ksvg2/svg/SVGFETurbulenceElement.cpp:
2245         * ksvg2/svg/SVGFitToViewBox.cpp:
2246         * ksvg2/svg/SVGLengthList.cpp:
2247         * ksvg2/svg/SVGMatrix.h:
2248         * ksvg2/svg/SVGNumberList.cpp:
2249         * ksvg2/svg/SVGPreserveAspectRatio.cpp:
2250         * ksvg2/svg/SVGSVGElement.cpp:
2251         * ksvg2/svg/SVGStringList.cpp:
2252         * ksvg2/svg/SVGStyledElement.h:
2253         * ksvg2/svg/SVGStyledTransformableElement.cpp:
2254         * ksvg2/svg/SVGTransformable.cpp:
2255         * ksvg2/svg/SVGURIReference.h:
2256         * ksvg2/svg/svgpathparser.cpp:
2257         * kwq/KWQKHTMLSettings.h:
2258         * loader/Cache.h:
2259         * loader/CachedObject.h:
2260         * loader/Decoder.cpp:
2261         * loader/FormData.h:
2262         * loader/loader.h:
2263         * page/Frame.h:
2264         * page/FramePrivate.h:
2265         * platform/Font.cpp:
2266         * platform/SegmentedString.h:
2267         * platform/mac/FontMac.mm:
2268         * platform/mac/WebCoreTextField.mm:
2269         * rendering/RenderBlock.cpp:
2270         * rendering/RenderObject.cpp:
2271         * rendering/RenderTable.cpp:
2272         * rendering/RenderTableCell.cpp:
2273         * rendering/RenderTableCol.cpp:
2274         * rendering/RenderTableSection.cpp:
2275         * rendering/bidi.h:
2276         * rendering/break_lines.cpp:
2277         * rendering/render_applet.cpp:
2278         * rendering/render_form.cpp:
2279         * rendering/render_form.h:
2280         * rendering/render_frames.cpp:
2281         * rendering/render_style.h:
2282         * xml/xmlhttprequest.cpp:
2283         Updated includes.
2284
2285         * WebCore.xcodeproj/project.pbxproj: Resorted a couple things.
2286
2287 2006-04-12  Adele Peterson  <adele@apple.com>
2288
2289         Reviewed by Darin and Tim O.
2290
2291         WebCore part of fix for:
2292         http://bugzilla.opendarwin.org/show_bug.cgi?id=8061
2293         REGRESSION: New text fields need to send callbacks used by autocomplete
2294
2295         Fix for:
2296         http://bugzilla.opendarwin.org/show_bug.cgi?id=8156
2297         FrameMac::submitForm is busted after Vector changes
2298
2299         * bindings/objc/DOMHTML.mm:
2300         (-[DOMHTMLInputElement _rectOnScreen]): Use boundingBox method so this no longer relies on an NSTextField.  
2301         The old code is no longer needed because this method was used by autocomplete, and that was not enabled for password or search fields.
2302         (-[DOMHTMLInputElement _replaceCharactersInRange:withString:selectingFromIndex:]): New implementation that uses setValue and setSelectionRange
2303         instead of NSTextField specific code.
2304         (-[DOMHTMLInputElement _selectedRange]): Creates range by calling selectionStart and selectionEnd on the input element.
2305         (-[DOMHTMLInputElement _setAutofilled:]): Provides a way for the autofill code to set a flag on the input element so
2306          it knows when its value is set by autofill.  This is how we change the background color.
2307         * bindings/objc/DOMPrivate.h: Removed _displayedValue, _setDisplayedValue, _setBackgroundColor since these are no
2308          longer needed for the new text field implementation, and aren't used for remaining NSView-style password and search fields.
2309          Added _setAutofilled method.
2310         * bridge/mac/FrameMac.h: Added virtual clearRecordedFormValues and recordFormValue.  These were moved into Frame.cpp recently, which broke
2311         how Safari asked to add form values to the keychain.
2312
2313         * bridge/mac/FrameMac.mm:
2314         (WebCore::createNSDictionary): Added. Converts a hashmap to an NSDictionary for m_formValuesAboutToBeSubmitted.  This is needed to fix the submit form bug.
2315         (WebCore::selectorForKeyEvent): Added.  This helper function converts key events into selectors that the autocomplete code needs to know about.
2316         (WebCore::FrameMac::FrameMac):
2317         (WebCore::FrameMac::submitForm): Convert saved form and formValues into DOMElement and NSMutableDictionary.
2318         (WebCore::FrameMac::textFieldDidBeginEditing): Added so the input element can send this notification over the bridge.
2319         (WebCore::FrameMac::textFieldDidEndEditing): ditto.
2320         (WebCore::FrameMac::textDidChangeInTextField): ditto.
2321         (WebCore::FrameMac::doTextFieldCommandFromEvent): ditto. Also calls selectorForKeyEvent.
2322         (WebCore::FrameMac::textWillBeDeletedInTextField): ditto.
2323         * page/Frame.cpp:
2324         (WebCore::Frame::textFieldDidBeginEditing): ditto.
2325         (WebCore::Frame::textFieldDidEndEditing): ditto.
2326         (WebCore::Frame::textDidChangeInTextField): ditto.
2327         (WebCore::Frame::doTextFieldCommandFromEvent): ditto.
2328         (WebCore::Frame::textWillBeDeletedInTextField): ditto.
2329         * page/Frame.h: ditto.
2330         * platform/PlatformString.h: (WebCore::String::replace): Added to use an existing version of StringImpl::replace.
2331
2332         * rendering/RenderTextField.cpp:
2333         (WebCore::RenderTextField::setSelectionRange): Setting the selection here should close the typing command.
2334         (WebCore::RenderTextField::subtreeHasChanged): Calls textDidChangeInTextField.
2335
2336         * dom/Document.cpp: (WebCore::Document::setFocusNode): Calls dispatchFocusEvent and dispatchBlurEvent instead of directly dispatching the events.  This gives the node a chance to do other work before dispatching the event.
2337
2338         * dom/EventTargetNode.cpp:
2339         (WebCore:: EventTargetNode::dispatchFocusEvent): Added.
2340         (WebCore:: EventTargetNode::dispatchBlurEvent): Added.
2341         * dom/EventTargetNode.h:
2342
2343         * html/HTMLInputElement.cpp:
2344         (WebCore::HTMLInputElement::init): initializes m_autofilled.
2345         (WebCore::HTMLInputElement::dispatchFocusEvent): Calls textFieldDidBeginEditing and then calls up to the base class
2346         (WebCore::HTMLInputElement::dispatchBlurEvent): Calls textFieldDidEndEditing and then calls up to the base class
2347         (WebCore::HTMLInputElement::defaultEventHandler): For keypress events, calls doTextFieldCommandFromEvent so the form delegate will
2348         have a chance to say whether or not it is going to handle the event.
2349        (WebCore::HTMLInputElement::isKeyboardFocusable): Uses isNonWidgetTextField instead of checking the inputType.
2350         (WebCore::HTMLInputElement::isMouseFocusable): ditto.
2351         (WebCore::HTMLInputElement::focus): ditto.
2352         (WebCore::HTMLInputElement::constrainValue): Uses isTextField instead of checking inputType.
2353         * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::submit): ditto.
2354         * html/HTMLInputElement.h:
2355         (WebCore::HTMLInputElement::isTextField): Added. Checks for TEXT, PASSWORD, and SEARCH
2356         (WebCore::HTMLInputElement::isNonWidgetTextField): Added.  Checks for all converted controls.
2357         (WebCore::HTMLInputElement::autofilled): Added.
2358         (WebCore::HTMLInputElement::setAutofilled): Added.
2359         * html/HTMLTextFieldInnerElement.cpp: (WebCore::HTMLTextFieldInnerElement::defaultEventHandler): Uses isNonWidgetTextField instead of checking the inputType.
2360
2361         * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::doApply):
2362          If the deletion is occuring in a text field, call textWillBeDeletedInTextField so the frame can
2363          call across the bridge to notify the form delegate.
2364
2365         * css/css_base.cpp: (WebCore::CSSSelector::extractPseudoType): Added autofill string for "-khtml-autofill".
2366         * css/css_base.h: (WebCore::CSSSelector::): Added PseudoAutofill to enum.
2367         * css/cssstyleselector.cpp:
2368         (WebCore::CSSStyleSelector::checkOneSelector): Added case for PseudoAutofill that checks the input element's autofilled flag.
2369         (WebCore::CSSStyleSelector::getColorFromPrimitiveValue): Changed  -webkit-focus-ring-color to -khtml-focus-ring-color for consistency.
2370         * css/html4.css: Added background-color and background-image for input:-khtml-autofill style.
2371          Changed -webkit-focus-ring-color to -khtml-focus-ring-color for consistency.
2372         * css/CSSValueKeywords.in: ditto.
2373         * css/cssparser.cpp:
2374         (WebCore::CSSParser::parseValue): ditto.
2375         (WebCore::CSSParser::parseShadow): ditto.
2376
2377 2006-04-12  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2378  
2379          Reviewed by hyatt
2380  
2381          - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=4855
2382            List item's bullets fail to redraw correctly after their style is set with JavaScript
2383  
2384          * manual-tests/list-marker-repaint.html: Added.
2385          * rendering/RenderBlock.cpp:
2386          (WebCore::RenderBlock::layoutBlock): Call positionListMarker() after laying out
2387          the children.
2388          (WebCore::RenderBlock::calcInlineMinMaxWidth): Call calcWidth() on the child
2389          if we are going to use its marginLeft() or marginRight(), which is if they are
2390          given as a percentage or if the child is a list marker.
2391          * rendering/RenderBlock.h:
2392          (WebCore::RenderBlock::positionListMarker): Added this virtual function which
2393          RenderListItem implements and which is called from layoutBlock().
2394          * rendering/RenderFlow.cpp:
2395          (WebCore::RenderFlow::addFocusRingRects): Avoid adding focus rings around outside list
2396          markers. Previously it did not matter since the markers had zero width.
2397          * rendering/bidi.cpp:
2398          (WebCore::RenderBlock::findNextLineBreak): Outside list markers should not contribute
2399          to the line width, even now that they have width.
2400          * rendering/render_line.cpp:
2401          (WebCore::InlineFlowBox::placeBoxesHorizontally): Skip outside list markers.
2402          * rendering/render_list.cpp:
2403          (WebCore::RenderListItem::positionListMarker): Added.
2404          (WebCore::RenderListMarker::paint): Removed code that was used to right-align outside
2405          text markers, since that is achieved by margins now.
2406          (WebCore::RenderListMarker::calcMinMaxWidth): Changed the marker height to be the font height.
2407          Made the width of outside list markers non-zero and equal to the width of inside markers.
2408          Changed the width to include only the marker and not any padding. Increased the width of bullets
2409          by 2 to contain spillage due to antialiasing.
2410          (WebCore::RenderListMarker::calcWidth): Calculate horizontal margins. Padding that was
2411          previously included in the width is now part of the margins. 
2412          (WebCore::RenderListMarker::getRelativeMarkerRect): Adjusted for the changes to width and
2413          margins.
2414          * rendering/render_list.h:
2415
2416 2006-04-12  Darin Adler  <darin@apple.com>
2417
2418         Rubber-stamped by Hyatt.
2419
2420         - moved some more files out of KWQ to more-permanent homes
2421
2422         * WebCore.vcproj/WebCore/WebCore.vcproj: Updated for new locations.
2423         * WebCore.xcodeproj/project.pbxproj: Ditto.
2424
2425         * kwq/BlockExceptions.h: Removed.
2426         * kwq/BlockExceptions.mm: Removed.
2427         * kwq/ClipboardMac.h: Removed.
2428         * kwq/ClipboardMac.mm: Removed.
2429         * kwq/DeprecatedPtrList.h: Removed.
2430         * kwq/DeprecatedPtrListImpl.cpp: Removed.
2431         * kwq/DeprecatedPtrListImpl.h: Removed.
2432         * kwq/DeprecatedValueList.h: Removed.
2433         * kwq/DeprecatedValueListImpl.cpp: Removed.
2434         * kwq/DeprecatedValueListImpl.h: Removed.
2435         * kwq/WebCoreTextArea.h: Removed.
2436         * kwq/WebCoreTextArea.mm: Removed.
2437         * kwq/WebCoreTextField.h: Removed.
2438         * kwq/WebCoreTextField.mm: Removed.
2439         * platform/DeprecatedPtrList.h: Added.
2440         * platform/DeprecatedPtrListImpl.cpp: Added.
2441         * platform/DeprecatedPtrListImpl.h: Added.
2442         * platform/DeprecatedValueList.h: Added.
2443         * platform/DeprecatedValueListImpl.cpp: Added.
2444         * platform/DeprecatedValueListImpl.h: Added.
2445         * platform/mac/BlockExceptions.h: Added.
2446         * platform/mac/BlockExceptions.mm: Added.
2447         * platform/mac/ClipboardMac.h: Added.
2448         * platform/mac/ClipboardMac.mm: Added.
2449         * platform/mac/WebCoreTextArea.h: Added.
2450         * platform/mac/WebCoreTextArea.mm: Added.
2451         * platform/mac/WebCoreTextField.h: Added.
2452         * platform/mac/WebCoreTextField.mm: Added.
2453
2454 2006-04-12  David Harrison  <harrison@apple.com>
2455
2456         Reviewed by Darin.
2457
2458         <rdar://problem/4386640> AX: AXPreviousSentenceStartTextMarkerForTextMarker does not respect paragraph boundary
2459         <rdar://problem/4414575> AX: Dictionary popup cannot find some words on Dictionary.app
2460
2461         AXPreviousSentenceStartTextMarkerForTextMarker failed to stop at the beginning a block because
2462         SimplifiedBackwardsTextIterator::handleNonTextNode() emitted a space when exiting the block.
2463         Fixed by emitting a newline instead.
2464         
2465         Word boundary failed to stop at the beginning of a block because no character at all was emitted
2466         when leaving the block, because the exitNode was checking specific html tags to decide whether the
2467         node is block, but the node was xml.  Fixed by using the node's renderer, if present.
2468         
2469         (see related changes in WebKit)
2470         
2471         Tests added:
2472         * editing/selection/extend-by-sentence-001.html: Added.
2473         * fast/dom/inner-text-001.html: Added.
2474         
2475         * bridge/mac/WebCoreFrameBridge.h:
2476         * bridge/mac/WebCoreFrameBridge.mm:
2477         (-[WebCoreFrameBridge alterCurrentSelection:direction:granularity:]):
2478         Add sentence navigation/selection.
2479         
2480         * editing/Selection.cpp:
2481         (WebCore::Selection::validate):
2482         Add sentence navigation/selection.
2483
2484         * editing/SelectionController.cpp:
2485         (WebCore::SelectionController::modifyExtendingRightForward):
2486         (WebCore::SelectionController::modifyMovingRightForward):
2487         (WebCore::SelectionController::modifyExtendingLeftBackward):
2488         (WebCore::SelectionController::modifyMovingLeftBackward):
2489         (WebCore::SelectionController::modify):
2490         Add sentence navigation/selection.
2491
2492         * editing/TextGranularity.h:
2493         (WebCore::):
2494         Add SentenceGranularity and SentenceBoundary.
2495
2496         * editing/TextIterator.cpp:
2497         (WebCore::isTableCell):
2498         (WebCore::shouldEmitTabBeforeNode):
2499         (WebCore::shouldEmitNewlineForNode):
2500         (WebCore::shouldEmitNewlinesBeforeAndAfterNode):
2501         (WebCore::shouldEmitExtraNewlineForNode):
2502         New utility functions that prefer renderers over html tag names.
2503
2504         (WebCore::TextIterator::handleNonTextNode):
2505         (WebCore::TextIterator::exitNode):
2506         (WebCore::SimplifiedBackwardsTextIterator::advance):
2507         Use new utility functions.
2508         
2509         (WebCore::SimplifiedBackwardsTextIterator::handleNonTextNode):
2510         Use new utility functions.  Also emit linefeed instead of space,
2511         so sentence parsing works across block boundaries.
2512         
2513         (WebCore::SimplifiedBackwardsTextIterator::exitNode):
2514         Use new utility functions.
2515
2516         (WebCore::SimplifiedBackwardsTextIterator::emitNewline):
2517         Renamed from emitNewlineForBROrText because it is not always for BR or text.
2518         
2519         * editing/TextIterator.h:
2520         Renamed emitNewlineForBROrText to emitNewline.
2521         
2522         * editing/visible_units.cpp:
2523         * editing/visible_units.h:
2524         (WebCore::previousBoundary):
2525         (WebCore::nextBoundary):
2526         (WebCore::previousSentencePosition):
2527         (WebCore::nextSentencePosition):
2528         Add sentence navigation/selection.
2529
2530 2006-04-12  Darin Adler  <darin@apple.com>
2531
2532         Rubber-stamped by Hyatt.
2533
2534         - moved Decoder and FormData classes into loader directory
2535           (Decoder, because it's part of the loading process.
2536            FormData, because it's used as a parameter when specifying
2537            what to load. Arguably either could be in page instead.)
2538         - moved Length.h from css to renderer, cause that's where Hyatt
2539           says it belongs
2540
2541         * WebCore.vcproj/WebCore/WebCore.vcproj: Updated for new locations.
2542         * WebCore.xcodeproj/project.pbxproj: Ditto.
2543
2544         * khtml: Removed.
2545         * loader/Decoder.cpp: Added.
2546         * loader/Decoder.h: Added.
2547         * loader/FormData.cpp: Added.
2548         * loader/FormData.h: Added.
2549
2550         * css/Length.h: Removed.
2551         * rendering/Length.h: Added.
2552
2553         * bridge/mac/WebCoreEncodings.mm:
2554         * dom/Document.h:
2555         * kwq/KWQFormData.mm:
2556         * loader/CachedXBLDocument.cpp:
2557         * loader/CachedXSLStyleSheet.cpp:
2558         * page/ResourceRequest.h:
2559         * platform/TransferJobInternal.h:
2560         * xml/xmlhttprequest.cpp:
2561         Updated includes.
2562
2563 2006-04-12  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2564
2565         Reviewed by darin
2566
2567         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8337
2568           Incomplete repaint of inlines' outline during editing
2569
2570         * manual-tests/inline-outline-repaint.html: Added.
2571         * rendering/RenderBlock.cpp:
2572         (WebCore::RenderBlock::layoutBlock): Add the maximal outline width to the
2573         inlines' repaint rect.
2574
2575 2006-04-12  Justin Garcia  <justin.garcia@apple.com>
2576
2577         Reviewed by darin
2578         
2579         <http://bugzilla.opendarwin.org/show_bug.cgi?id=8335>
2580         Implement execCommand(InsertHorizontalRule)
2581
2582         * editing/JSEditor.cpp:
2583
2584 2006-04-12  Darin Adler  <darin@apple.com>
2585
2586         Rubber-stamped by Hyatt.
2587
2588         - moved xsl files into xml directory, removed xbl files (for now)
2589
2590         * WebCore.vcproj/WebCore/WebCore.vcproj: Updated for new locations.
2591         * WebCore.xcodeproj/project.pbxproj: Ditto.
2592         * khtml/xbl: Removed.
2593         * khtml/xsl: Removed.
2594         * xml/XSLStyleSheet.cpp: Added.
2595         * xml/XSLStyleSheet.h: Added.
2596         * xml/XSLTProcessor.cpp: Added.
2597         * xml/XSLTProcessor.h: Added.
2598
2599 2006-04-12  David Hyatt  <hyatt@apple.com>
2600
2601         Fix for 5283, make sure overflow doesn't paint on top of positioned elements.
2602
2603         Reviewed by beth
2604
2605         * kwq/RenderTreeAsText.cpp:
2606         (writeLayers):
2607         * rendering/RenderLayer.cpp:
2608         (WebCore::RenderLayer::RenderLayer):
2609         (WebCore::RenderLayer::~RenderLayer):
2610         (WebCore::RenderLayer::addChild):
2611         (WebCore::RenderLayer::removeChild):
2612         (WebCore::RenderLayer::paintLayer):
2613         (WebCore::RenderLayer::hitTestLayer):
2614         (WebCore::RenderLayer::dirtyOverflowList):
2615         (WebCore::RenderLayer::updateOverflowList):
2616         (WebCore::RenderLayer::collectLayers):
2617         (WebCore::RenderLayer::shouldBeOverflowOnly):
2618         (WebCore::RenderLayer::styleChanged):
2619         * rendering/RenderLayer.h:
2620         (WebCore::RenderLayer::isOverflowOnly):
2621         (WebCore::RenderLayer::overflowList):
2622
2623 2006-04-12  Darin Adler  <darin@apple.com>
2624
2625         * WebCore.xcodeproj/project.pbxproj: Turn SVG support back on.
2626         I accidentally checked in this file with SVG off last night.
2627
2628 2006-04-12  Darin Adler  <darin@apple.com>
2629
2630         - try to fix Windows build
2631
2632         * platform/TransferJobInternal.h: Declare HANDLE.
2633         * platform/image-decoders/gif/GIFImageReader.h: Include GIFImageDecoder.h.
2634         * rendering/RenderThemeWin.h: Declare HANDLE and HMODULE.
2635
2636 2006-04-12  Darin Adler  <darin@apple.com>
2637
2638         - another attempt to get things building
2639
2640         * bindings/js/kjs_proxy.cpp: Add "kjs_events.h" include, needed when not
2641         building SVG (so for Windows too).
2642         * editing/TextIterator.h: Add back include of Vector.h.
2643
2644 2006-04-11  Darin Adler  <darin@apple.com>
2645
2646         - try to fix Windows build
2647
2648         * html/HTMLCollection.h: Add back include of Vector.h.
2649         * page/Frame.h: Ditto.
2650         * platform/Timer.h: Ditto.
2651
2652         - more changes for no-SVG (not working yet though)
2653
2654         * editing/CompositeEditCommand.h: Added css_valueimpl.h include.
2655
2656 2006-04-11  Darin Adler  <darin@apple.com>
2657
2658         - try to fix no-SVG build
2659
2660         * kwq/RenderTreeAsText.cpp: Added back an include only needed for non-SVG.
2661         * rendering/RenderObject.h: Ditto.
2662
2663 2006-04-11  Darin Adler  <darin@apple.com>
2664
2665         - try to fix Windows build
2666
2667         * ForwardingHeaders/kxmlcore/HashForward.h: Removed.
2668         * dom/xml_tokenizer.h: Include another header instead of HashForward.h.
2669         * loader/Cache.h: Ditto.
2670         * page/Page.h: Ditto.
2671         * platform/TransferJob.h: Ditto.
2672
2673 2006-04-11  Justin Garcia  <justin.garcia@apple.com>
2674
2675         Reviewed by harrison
2676         
2677         Fixes more instances of:
2678         <rdar://problem/3950559>
2679         CrashTracer: 2116 crashes in Mail at com.apple.WebCore: khtml::CompositeEditCommand::insertNodeAfter + 32
2680
2681         * editing/ReplaceSelectionCommand.cpp:
2682         (WebCore::ReplaceSelectionCommand::doApply): Do paragraph merging using moveParagraphs.
2683
2684 2006-04-11  Justin Garcia  <justin.garcia@apple.com>
2685
2686         Reviewed by harrison
2687         
2688         Some setup for work on paste performance.
2689
2690         * editing/CompositeEditCommand.cpp:
2691         (WebCore::CompositeEditCommand::moveParagraph): 
2692         Moved code from mergeParagraphs so that it can be used in ReplaceSelectionCommand.
2693         * editing/CompositeEditCommand.h:
2694         * editing/DeleteSelectionCommand.cpp:
2695         (WebCore::DeleteSelectionCommand::mergeParagraphs):
2696         (WebCore::DeleteSelectionCommand::doApply):
2697         * editing/VisiblePosition.cpp:
2698         (WebCore::VisiblePosition::init): Put the code that chooses m_deepPosition into initDeepPosition.
2699         (WebCore::VisiblePosition::initDeepPosition): 
2700         Fixed a bug: don't fall through to the code that's only for positions inside unrendered space between blocks when
2701         downstream() is a candidate.  Added a comment about why the fall through code is necessary.
2702         * editing/VisiblePosition.h:
2703
2704 2006-04-11  John Sullivan  <sullivan@apple.com>
2705
2706         Reviewed by Darin Adler.
2707         
2708         - fixed <rdar://problem/4509328> highlight all matches hangs when searching for tab character on www.google.com (and others)
2709         
2710         For reasons not yet completely understood, searching for a tab character on some pages (Google, Amazon) finds a match
2711         with a non-collapsed range but then claims that the end visible position of the match is the original start visible 
2712         position of the search range. This was causing the highlightAllMatches code to loop forever. Fixed the loop by 
2713         checking for the non-advancing search range explicitly. I'm going to track down a reduction of the bogus 
2714         search-for-tab issue, and write that up as a separate bug (that bug is not a regression; you can "find" a tab on 
2715         google in Tiger also).
2716
2717         * page/Frame.cpp:
2718         (WebCore::Frame::highlightAllMatchesForString):
2719         break the loop if the search range hasn't advanced
2720
2721 2006-04-10  Darin Adler  <darin@apple.com>
2722
2723         Rubber-stamped by John Sullivan (except for pbxproj change).
2724
2725         - updated to use the new Forward.h and HashForward.h headers
2726         - moved the showTree debugging functions out of the WebCore
2727           namespace so they are easier to call from gdb, and renamed
2728           the showTree member functions so they don't get in the way;
2729           now you can do "call showTree(x)" in gdb and it just works
2730         - removed a lot of unneeded includes
2731
2732         * WebCore.xcodeproj/project.pbxproj: Fixed a lot of paths that
2733         were not relative to the enclosing group.
2734
2735         * ForwardingHeaders/kxmlcore/Forward.h: Added.
2736         * ForwardingHeaders/kxmlcore/HashForward.h: Added.
2737         * bindings/js/JSCanvasRenderingContext2DBase.cpp:
2738         * bindings/js/JSXMLHttpRequest.cpp:
2739         * bindings/js/JSXMLHttpRequest.h:
2740         * bindings/js/JSXSLTProcessor.h:
2741         * bindings/js/kjs_binding.h:
2742         * bindings/js/kjs_dom.cpp:
2743         * bindings/js/kjs_dom.h:
2744         * bindings/js/kjs_events.cpp:
2745         * bindings/js/kjs_events.h:
2746         * bindings/js/kjs_html.cpp:
2747         * bindings/js/kjs_navigator.cpp:
2748         * bindings/js/kjs_navigator.h:
2749         * bindings/js/kjs_proxy.cpp:
2750         * bindings/js/kjs_traversal.h:
2751         * bindings/js/kjs_window.cpp:
2752         * bindings/js/kjs_window.h:
2753         * bindings/objc/DOM.mm:
2754         * bindings/objc/DOMCSS.mm:
2755         * bindings/objc/DOMCore.h:
2756         * bindings/objc/DOMEvents.mm:
2757         * bindings/objc/DOMHTML.mm:
2758         * bindings/objc/DOMImplementationFront.h:
2759         * bindings/objc/DOMInternal.mm:
2760         * bindings/objc/DOMUtility.mm:
2761         * bindings/objc/DOMViews.mm:
2762         * bridge/BrowserExtension.h:
2763         * bridge/mac/BrowserExtensionMac.mm:
2764         * bridge/mac/FrameMac.h:
2765         * bridge/mac/FrameMac.mm:
2766         * bridge/mac/WebCoreFrameBridge.mm:
2767         * bridge/mac/WebCoreFrameNamespaces.mm:
2768         * bridge/mac/WebCoreJavaScript.mm:
2769         * bridge/win/PageWin.cpp:
2770         * css/CSSComputedStyleDeclaration.cpp:
2771         * css/css_base.h:
2772         * css/css_ruleimpl.h:
2773         * css/css_valueimpl.cpp:
2774         * css/cssparser.cpp:
2775         * css/cssparser.h:
2776         * css/cssstyleselector.cpp:
2777         * css/cssstyleselector.h:
2778         * dom/AbstractView.h:
2779         * dom/AtomicStringList.h:
2780         * dom/Attribute.cpp:
2781         * dom/Attribute.h:
2782         * dom/Comment.cpp:
2783         * dom/ContainerNode.cpp:
2784         * dom/DOMImplementation.cpp:
2785         * dom/DOMImplementation.h:
2786         * dom/Document.cpp:
2787         * dom/Document.h:
2788         * dom/Element.h:
2789         * dom/EventTargetNode.cpp:
2790         (WebCore::EventTargetNode::dump):
2791         (WebCore::forbidEventDispatch):
2792         (WebCore::allowEventDispatch):
2793         (WebCore::eventDispatchForbidden):
2794         * dom/EventTargetNode.h:
2795         (WebCore::EventTargetNode::postDispatchEventHandler):
2796         * dom/NamedAttrMap.h:
2797         * dom/Node.cpp:
2798         (WebCore::Node::showNode):
2799         (WebCore::Node::showTree):
2800         (WebCore::Node::showTreeAndMark):
2801         (showTree):
2802         * dom/Node.h:
2803         * dom/NodeList.cpp:
2804         * dom/NodeList.h:
2805         * dom/Position.cpp:
2806         (showTree):
2807         * dom/Position.h:
2808         * dom/Range.cpp:
2809         * dom/Range.h:
2810         * dom/StyledElement.cpp:
2811         * dom/StyledElement.h:
2812         * dom/dom2_eventsimpl.cpp:
2813         * dom/dom2_eventsimpl.h:
2814         * dom/dom2_traversalimpl.h:
2815         * dom/dom_xmlimpl.cpp:
2816         * dom/xml_tokenizer.cpp:
2817         * dom/xml_tokenizer.h:
2818         * editing/AppendNodeCommand.cpp:
2819         * editing/ApplyStyleCommand.cpp:
2820         * editing/ApplyStyleCommand.h:
2821         * editing/BreakBlockquoteCommand.cpp:
2822         * editing/CompositeEditCommand.cpp:
2823         * editing/CreateLinkCommand.cpp:
2824         * editing/DeleteFromTextNodeCommand.cpp:
2825         * editing/DeleteFromTextNodeCommand.h:
2826         * editing/DeleteSelectionCommand.cpp:
2827         * editing/EditCommand.cpp:
2828         * editing/EditCommand.h:
2829         * editing/HTMLInterchange.cpp:
2830         * editing/InsertIntoTextNodeCommand.cpp:
2831         * editing/InsertIntoTextNodeCommand.h:
2832         * editing/InsertLineBreakCommand.cpp:
2833         * editing/InsertNodeBeforeCommand.cpp:
2834         * editing/InsertParagraphSeparatorCommand.cpp:
2835         * editing/InsertTextCommand.cpp:
2836         * editing/JSEditor.cpp:
2837         * editing/JoinTextNodesCommand.cpp:
2838         * editing/MergeIdenticalElementsCommand.cpp:
2839         * editing/ModifySelectionListLevelCommand.cpp:
2840         * editing/MoveSelectionCommand.cpp:
2841         * editing/RebalanceWhitespaceCommand.h:
2842         * editing/RemoveCSSPropertyCommand.h:
2843         * editing/ReplaceSelectionCommand.cpp:
2844         * editing/ReplaceSelectionCommand.h:
2845         * editing/Selection.cpp:
2846         (WebCore::Selection::formatForDebugger):
2847         (WebCore::Selection::showTree):
2848         (showTree):
2849         * editing/Selection.h:
2850         * editing/SelectionController.cpp:
2851         (WebCore::SelectionController::formatForDebugger):
2852         (WebCore::SelectionController::showTree):
2853         (showTree):
2854         * editing/SelectionController.h:
2855         * editing/TextIterator.cpp:
2856         * editing/TextIterator.h:
2857         * editing/TypingCommand.cpp:
2858         * editing/TypingCommand.h:
2859         * editing/UnlinkCommand.cpp:
2860         * editing/VisiblePosition.cpp:
2861         (WebCore::isEqualIgnoringAffinity):
2862         (WebCore::VisiblePosition::formatForDebugger):
2863         (WebCore::VisiblePosition::showTree):
2864         (showTree):
2865         * editing/VisiblePosition.h:
2866         (WebCore::VisiblePosition::VisiblePosition):
2867         (WebCore::operator==):
2868         * editing/WrapContentsInDummySpanCommand.cpp:
2869         * editing/htmlediting.h:
2870         * editing/markup.cpp:
2871         * editing/markup.h:
2872         (WebCore::):
2873         * editing/visible_units.cpp:
2874         * html/CanvasGradient.cpp:
2875         * html/CanvasRenderingContext2D.h:
2876         * html/CanvasStyle.cpp:
2877         * html/CanvasStyle.h:
2878         * html/FormDataList.cpp:
2879         * html/FormDataList.h:
2880         * html/HTMLCollection.cpp:
2881         * html/HTMLCollection.h:
2882         * html/HTMLDocument.cpp:
2883         * html/HTMLDocument.h:
2884         * html/HTMLElement.cpp:
2885         * html/HTMLElementFactory.cpp:
2886         * html/HTMLElementFactory.h:
2887         * html/HTMLFormCollection.cpp:
2888         * html/HTMLFormElement.cpp:
2889         * html/HTMLFormElement.h:
2890         * html/HTMLInputElement.cpp:
2891         * html/HTMLParser.cpp:
2892         * html/HTMLSelectElement.cpp:
2893         * html/HTMLSelectElement.h:
2894         * html/HTMLTokenizer.cpp:
2895         * html/HTMLTokenizer.h:
2896         * html/html_baseimpl.cpp:
2897         * html/html_headimpl.h:
2898         * kcanvas/KCanvasCreator.cpp:
2899         * kcanvas/KCanvasFilters.h:
2900         * kcanvas/KCanvasPath.h:
2901         * kcanvas/KCanvasResources.h:
2902         * kcanvas/KCanvasTreeDebug.cpp:
2903         * kcanvas/RenderPath.cpp:
2904         * kcanvas/RenderPath.h:
2905         * kcanvas/device/KRenderingDevice.h:
2906         * kcanvas/device/KRenderingPaintServerGradient.h:
2907         * kcanvas/device/KRenderingPaintServerPattern.h:
2908         * kcanvas/device/KRenderingPaintServerSolid.h:
2909         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
2910         * kcanvas/device/quartz/KCanvasMaskerQuartz.h:
2911         * kcanvas/device/quartz/KCanvasResourcesQuartz.h:
2912         * kcanvas/device/quartz/KCanvasResourcesQuartz.mm:
2913         * kcanvas/device/quartz/KRenderingPaintServerQuartz.h:
2914         * khtml/misc/decoder.cpp:
2915         * khtml/misc/decoder.h:
2916         * khtml/xsl/XSLStyleSheet.cpp:
2917         * khtml/xsl/XSLTProcessor.cpp:
2918         * khtml/xsl/XSLTProcessor.h:
2919         * ksvg2/css/SVGRenderStyle.h:
2920         * ksvg2/ecma/GlobalObject.cpp:
2921         * ksvg2/misc/KCanvasRenderingStyle.h:
2922         * ksvg2/misc/SVGDocumentExtensions.h:
2923         * ksvg2/svg/SVGAngle.h:
2924         * ksvg2/svg/SVGAnimateColorElement.h:
2925         * ksvg2/svg/SVGAnimatedColor.h:
2926         * ksvg2/svg/SVGAnimatedLengthList.h:
2927         * ksvg2/svg/SVGAnimatedNumberList.h:
2928         * ksvg2/svg/SVGAnimatedString.h:
2929         * ksvg2/svg/SVGAnimatedTransformList.h:
2930         * ksvg2/svg/SVGAnimationElement.h:
2931         * ksvg2/svg/SVGColor.h:
2932         * ksvg2/svg/SVGCursorElement.h:
2933         * ksvg2/svg/SVGHelper.h:
2934         * ksvg2/svg/SVGLength.h:
2935         * ksvg2/svg/SVGList.h:
2936         * ksvg2/svg/SVGPaint.h:
2937         * ksvg2/svg/SVGPathSeg.h:
2938         * ksvg2/svg/SVGPatternElement.h:
2939         * ksvg2/svg/SVGSVGElement.cpp:
2940         * ksvg2/svg/SVGSVGElement.h:
2941         * ksvg2/svg/SVGStringList.h:
2942         * ksvg2/svg/SVGTransform.h:
2943         * kwq/AccessibilityObjectCache.mm:
2944         * kwq/ClipboardMac.mm:
2945         * kwq/JavaAppletWidget.mm:
2946         * kwq/KWQComboBox.mm:
2947         * kwq/KWQEditCommand.mm:
2948         * kwq/KWQFileButton.mm:
2949         * kwq/KWQKHTMLSettings.h:
2950         * kwq/KWQKSSLKeyGen.mm:
2951         * kwq/KWQLoader.mm:
2952         * kwq/KWQPageState.mm:
2953         * kwq/KWQTextEdit.mm:
2954         * kwq/RegularExpression.h:
2955         * kwq/RenderTreeAsText.cpp:
2956         * kwq/RenderTreeAsText.h:
2957         * kwq/WebCoreAXObject.mm:
2958         * loader/Cache.cpp:
2959         * loader/Cache.h:
2960         * loader/CachedCSSStyleSheet.cpp:
2961         * loader/CachedObject.h:
2962         * loader/CachedScript.cpp:
2963         * loader/CachedXBLDocument.cpp:
2964         * loader/CachedXBLDocument.h:
2965         * loader/CachedXSLStyleSheet.cpp:
2966         * loader/CachedXSLStyleSheet.h:
2967         * loader/DocLoader.cpp:
2968         * page/Frame.cpp:
2969         * page/Frame.h:
2970         * page/FramePrivate.h:
2971         * page/FrameTree.cpp:
2972         * page/FrameTree.h:
2973         * page/FrameView.cpp:
2974         * page/FrameView.h:
2975         * page/Page.cpp:
2976         * page/Page.h:
2977         * page/Plugin.h:
2978         (WebCore::Plugin::Plugin):
2979         (WebCore::Plugin::view):
2980         * platform/Color.cpp:
2981         * platform/FloatRect.h:
2982         * platform/Font.cpp:
2983         * platform/Font.h:
2984         * platform/FontFamily.cpp:
2985         * platform/GraphicsContext.cpp:
2986         * platform/Image.cpp:
2987         * platform/Image.h:
2988         * platform/IntRect.h:
2989         * platform/KURL.cpp:
2990         * platform/KURL.h:
2991         * platform/SegmentedString.h:
2992         * platform/Shared.h:
2993         * platform/StreamingTextDecoder.cpp:
2994         * platform/StringImpl.cpp:
2995         * platform/StringImpl.h:
2996         * platform/TextEncoding.h:
2997         * platform/Timer.cpp:
2998         * platform/Timer.h:
2999         * platform/TransferJob.cpp:
3000         * platform/TransferJob.h:
3001         * platform/TransferJobInternal.h:
3002         * platform/cairo/GraphicsContextCairo.cpp:
3003         * platform/cairo/ImageCairo.cpp:
3004         * platform/cairo/ImageSourceCairo.cpp:
3005         * platform/image-decoders/gif/GIFImageReader.cpp:
3006         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
3007         * platform/mac/FontFamilyMac.mm:
3008         * platform/mac/FontMac.mm:
3009         * platform/mac/ImageMac.mm:
3010         * platform/mac/TextEncodingMac.cpp:
3011         * platform/mac/TransferJobMac.mm:
3012         * platform/win/FontPlatformDataWin.cpp:
3013         * platform/win/TransferJobWin.cpp:
3014         * rendering/RenderBlock.cpp:
3015         * rendering/RenderBlock.h:
3016         * rendering/RenderBox.cpp:
3017         * rendering/RenderBox.h:
3018         * rendering/RenderCanvas.cpp:
3019         * rendering/RenderCanvas.h:
3020         * rendering/RenderContainer.cpp:
3021         * rendering/RenderFlexibleBox.h:
3022         * rendering/RenderFlow.cpp:
3023         * rendering/RenderFlow.h:
3024         * rendering/RenderImage.cpp:
3025         * rendering/RenderImage.h:
3026         * rendering/RenderLayer.cpp:
3027         * rendering/RenderLayer.h:
3028         * rendering/RenderObject.cpp:
3029         (showTree):
3030         * rendering/RenderObject.h:
3031         * rendering/RenderTableCell.h:
3032         * rendering/RenderTableSection.h:
3033         * rendering/RenderText.cpp:
3034         * rendering/RenderText.h:
3035         * rendering/RenderTextField.cpp:
3036         * rendering/RenderTextFragment.h:
3037         * rendering/RenderTheme.h:
3038         * rendering/RenderThemeMac.mm:
3039         * rendering/RenderThemeWin.cpp:
3040         * rendering/bidi.cpp:
3041         * rendering/render_form.h:
3042         * rendering/render_line.cpp:
3043         (showTree):
3044         * rendering/render_line.h:
3045         * rendering/render_list.cpp:
3046         * rendering/render_replaced.cpp:
3047         * rendering/render_replaced.h:
3048         * rendering/render_style.cpp:
3049         * rendering/render_style.h:
3050         * xml/xmlhttprequest.h:
3051
3052 2006-04-10  Darin Adler  <darin@apple.com>
3053
3054         - try to fix the Windows build
3055
3056         * WebCore.vcproj/WebCore/WebCore.vcproj: Fix mistaken bad editing of
3057         AdditionalIncludeDirectories.
3058
3059 2006-04-10  David Hyatt  <hyatt@apple.com>
3060
3061         Make focus ring painting respect clips set by WebCore (e.g., overflow).
3062
3063         Reviewed by darin
3064
3065         * platform/GraphicsContext.h:
3066         * platform/mac/GraphicsContextMac.mm:
3067         (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
3068         (WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate):
3069         (WebCore::GraphicsContext::setFocusRingClip):
3070         (WebCore::GraphicsContext::clearFocusRingClip):
3071         (WebCore::GraphicsContext::drawFocusRing):
3072         * platform/mac/WebCoreGraphicsBridge.h:
3073         * platform/mac/WebCoreGraphicsBridge.m:
3074         (-[WebCoreGraphicsBridge drawFocusRingWithPath:radius:color:clipRect:]):
3075         * rendering/RenderLayer.cpp:
3076         (WebCore::setClip):
3077         (WebCore::restoreClip):
3078
3079 2006-04-10  Darin Adler  <darin@apple.com>
3080
3081         Reviewed by Geoff.
3082
3083         - death to khtml/ecma, long live bindings/js
3084
3085         * khtml/ecma: Removed. Moved all files to bindings/js.
3086
3087         * bindings/js/JSDOMParser.cpp: Added.
3088         * bindings/js/JSDOMParser.h: Added.
3089         * bindings/js/JSXMLHttpRequest.cpp: Added.
3090         * bindings/js/JSXMLHttpRequest.h: Added.
3091         * bindings/js/JSXMLSerializer.cpp: Added.
3092         * bindings/js/JSXMLSerializer.h: Added.
3093         * bindings/js/JSXSLTProcessor.cpp: Added.
3094         * bindings/js/JSXSLTProcessor.h: Added.
3095         * bindings/js/kjs_binding.cpp: Added.
3096         * bindings/js/kjs_binding.h: Added.
3097         * bindings/js/kjs_css.cpp: Added.
3098         * bindings/js/kjs_css.h: Added.
3099         * bindings/js/kjs_dom.cpp: Added.
3100         * bindings/js/kjs_dom.h: Added.
3101         * bindings/js/kjs_events.cpp: Added.
3102         * bindings/js/kjs_events.h: Added.
3103         * bindings/js/kjs_html.cpp: Added.
3104         * bindings/js/kjs_html.h: Added.
3105         * bindings/js/kjs_navigator.cpp: Added.
3106         * bindings/js/kjs_navigator.h: Added.
3107         * bindings/js/kjs_proxy.cpp: Added.
3108         * bindings/js/kjs_proxy.h: Added.
3109         * bindings/js/kjs_traversal.cpp: Added.
3110         * bindings/js/kjs_traversal.h: Added.
3111         * bindings/js/kjs_views.cpp: Added.
3112         * bindings/js/kjs_views.h: Added.
3113         * bindings/js/kjs_window.cpp: Added.
3114         * bindings/js/kjs_window.h: Added.
3115
3116         * DerivedSources.make: Removed khtml/ecma from directory list.
3117         * WebCore.vcproj/WebCore/WebCore.vcproj: Moved files from
3118         khtml/ecma to bindings/js.
3119         * WebCore.xcodeproj/project.pbxproj: Ditto.
3120
3121 2006-04-10  Darin Adler  <darin@apple.com>
3122
3123         Reviewed by Geoff.
3124
3125         - try to fix the Windows build
3126
3127         * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::reset):
3128         Put code to release m_drawingContext into an __APPLE__ ifdef.
3129
3130         * platform/win/TemporaryLinkStubs.cpp:
3131
3132 2006-04-10  Mitz Pettel  <opendarwin.org@mitzpettel.com>
3133
3134         Reviewed by Eric, landed by ap.
3135
3136         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8295
3137           Dictionary pop-up panel targets the wrong word in a scrolled IFRAME
3138
3139         * kwq/WebCoreAXObject.mm:
3140         (-[WebCoreAXObject doAXTextMarkerForPosition:]): Removed the addition of scroll
3141         offsets, which is redundant for scrolled views, then changed the first view
3142         to be the document's scrolled view instead of its scroll view (all subsequent views were
3143         already scrolled views).
3144         * manual-tests/dictionary-scrolled-iframe.html: Added.
3145
3146 2006-04-09  Alexey Proskuryakov  <ap@nypop.com>
3147
3148         Reviewed by Darin.
3149
3150         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7877
3151         XMLHttpRequest ignores username/password passed to open()
3152
3153         Test: http/tests/xmlhttprequest/basic-auth.html
3154
3155         * platform/KURL.cpp:
3156         (KURL::setUser): Enable a code path that handles non-empty user name -
3157         it was already present, but commented out and protected with an assertion.
3158         (KURL::setPass): Ditto.
3159
3160 2006-04-09  Darin Adler  <darin@apple.com>
3161
3162         Reviewed by Anders.
3163
3164         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=4884
3165           Canvas element breaks when RenderObject creation is deferred by external CSS
3166
3167         Test: fast/canvas/canvas-before-css.html
3168
3169         This patch makes us match the canvas documentation in Hixie's Web Applications
3170         draft as far as when the canvas is created and recreated and how it's sized.
3171         It also gets rid of the compositeOperation attribute of the canvas element.
3172         We can add that back if we need it. Anders points out that this specifically
3173         changes behavior for canvas elements where the size is set in CSS and not with
3174         width and height attributes. The CSS size now determines how big a box the canvas
3175         is rendered into, but has no effect on the size of the canvas's buffer.
3176
3177         * html/CanvasRenderingContext2D.h: Added overloads of drawImage that take
3178         HTMLCanvasElement, which is no longer derived from HTMLImageElement.
3179         * html/CanvasRenderingContext2D.cpp:
3180         (WebCore::imageSize): Renamed from imageOrCanvasSize. Now used for images only,
3181         because canvas is no longer derived from image.
3182         (WebCore::CanvasRenderingContext2D::drawImage): Split the implementation of this
3183         for image sources from the implementation for canvas sources.
3184         (WebCore::CanvasRenderingContext2D::willDraw): Changed to call a new willDraw
3185         function on the canvas element.
3186         (WebCore::CanvasRenderingContext2D::drawingContext): Changed to call drawingContext
3187         on the canvas element rather than the renderer.
3188
3189         * html/HTMLCanvasElement.h: Changed HTMLCanvasElement to derive from HTMLElement
3190         instead of HTMLImageElement. Added width, height, setWidth, setHeight, willDraw,
3191         paint, drawingContext, createDrawingContext, and reset functions. Added m_size,
3192         m_createdDrawingContext, m_data, and m_drawingContext data members. Removed
3193         mapToEntry, attach, detach, and isURLAttribute functins.
3194
3195         * html/HTMLCanvasElement.cpp:
3196         (WebCore::HTMLCanvasElement::HTMLCanvasElement): Added initializers for new m_size,
3197         m_createdDrawingContext, m_data, and m_drawingContext data members.
3198         (WebCore::HTMLCanvasElement::~HTMLCanvasElement): Free m_data and m_drawingContext.
3199         (WebCore::HTMLCanvasElement::parseMappedAttribute): Got rid of special case for
3200         srcAttr, which is no longer needed since we aren't deriving from HTMLImageElement.
3201         Added code that triggers a reset when either width or height is set.
3202         (WebCore::HTMLCanvasElement::createRenderer): Added code to set the intrinsic
3203         width and height of the renderer to the size of the element.
3204         (WebCore::HTMLCanvasElement::setHeight): Added. Sets the height attribute.
3205         (WebCore::HTMLCanvasElement::setWidth): Added. Sets the width attribute.
3206         (WebCore::HTMLCanvasElement::willDraw): Added. Tells the renderer to repaint.
3207         Also has FIXME mentioning we could dirty only the part that has changed in the future.
3208         (WebCore::HTMLCanvasElement::reset): Added. Sets the size of the canvas and discards
3209         the old buffer, which is an indirect way of resetting the buffer to transparent black.
3210         (WebCore::HTMLCanvasElement::paint): Added. Draws the canvas image into the graphics
3211         context that's passed in.
3212         (WebCore::HTMLCanvasElement::createDrawingContext): Added. Allocates a buffer for
3213         the bits, then creates a bitmap context for drawing into the buffer.
3214         (WebCore::HTMLCanvasElement::drawingContext): Added. Calls createDrawingContext if
3215         needed, then returns the current drawing context.
3216         (WebCore::HTMLCanvasElement::createPlatformImage): Changed to always call CGContextFlush
3217         and to create the image from the context in this class.
3218
3219         * rendering/RenderHTMLCanvas.h: Remove almost all of the contents of this file.
3220         Removed ~RenderHTMLCanvas, setNeedsImageUpdate, element, updateDrawnImage, drawingContext,
3221         createDrawingContext, and drawnImage functions and _drawingContext, _drawingContextData,
3222         _drawnImage, and _needsImageUpdate booleans. Changed RenderHTMLCanvas to derive from
3223         RenderReplaced instead of RenderImage.
3224
3225         * rendering/RenderHTMLCanvas.cpp:
3226         (WebCore::RenderHTMLCanvas::RenderHTMLCanvas): Changed to only initialize RenderReplaced.
3227         (WebCore::RenderHTMLCanvas::renderName): Moved this in here, since there's no good reason
3228         to have this virtual function inlined.
3229         (WebCore::RenderHTMLCanvas::paint): Changed implementation to use HTMLCanvasElement::paint
3230         instead ofcalling CGContextDrawImage directly.
3231         (WebCore::RenderHTMLCanvas::layout): Removed the code that detects changes in width and
3232         causes the drawing context to be recreated; instead, if the width and height changes we
3233         scale when we paint the canvas.
3234
3235         * bindings/js/JSCanvasRenderingContext2DBase.cpp:
3236         (WebCore::JSCanvasRenderingContext2DBaseProtoFunc::callAsFunction):
3237         Separated out handling for <canvas> vs. <img> elements in drawRect, since
3238         HTMLCanvasElement is no longer derived from HTMLImageElement.
3239
3240 2006-04-09  Rob Buis  <buis@kde.org>
3241
3242         Reviewed by eseidel.  Landed by eseidel.
3243
3244         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=6027:
3245         Dirty rect invalidation issues in mozilla sample
3246
3247         Make sure the paths calculate the new bounding box and not
3248         use the cached bbox.
3249
3250         No automated test case possible.
3251
3252         * kcanvas/RenderPath.cpp:
3253         (WebCore::RenderPath::setPath):
3254
3255 2006-04-09  Rob Buis  <buis@kde.org>
3256
3257         Reviewed by darin.  Landed by eseidel.
3258
3259         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=6930:
3260         % width/height on nested <svg> tags do not work
3261
3262         Set the context correctly for inner <svg>, so calculation of
3263         width/height for inner <svg> elements is done against the
3264         viewport element.
3265
3266         Test: svg/custom/inner-percent.svg
3267
3268         * ksvg2/svg/SVGSVGElement.cpp:
3269         (WebCore::SVGSVGElement::width):
3270         (WebCore::SVGSVGElement::height):
3271
3272 2006-04-08  Rob Buis  <buis@kde.org>
3273
3274         Reviewed by eseidel.  Landed by eseidel.
3275
3276         No automated test case possible.
3277
3278         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=7531:
3279         hang in SVGPolygonElementImpl::toPathData in polygon test case
3280
3281         Make sure the points list is cleared, just like the path
3282         list is cleared first before (re)parsing.
3283
3284         * ksvg2/svg/SVGPolyElement.cpp:
3285         (SVGPolyElement::parseMappedAttribute):
3286
3287 2006-04-08  Darin Adler  <darin@apple.com>
3288
3289         Reviewed by Beth.
3290
3291         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7622
3292           REGRESSION: New text fields should compute maxlength considering composed character sequences
3293
3294         Test: fast/forms/input-text-maxlength.html
3295         Test: fast/forms/input-text-paste-maxlength.html
3296
3297         * html/HTMLInputElement.h: Removed all friend classes (not needed any more). Renamed
3298         typeEnum to InputType. Made init() function private. Tweaked parameter names and formatting
3299         in many function declarations. Made canHaveSelection, selectionStart, and selectionEnd
3300         const. Made data members except for m_name private instead of protected. Added private
3301         functions constrainValue and recheckValue. Removed unused isEditable function.
3302
3303         * html/HTMLInputElement.cpp:
3304         (WebCore::numGraphemeClusters): Added.
3305         (WebCore::numCharactersInGraphemeClusters): Added.
3306         (WebCore::HTMLInputElement::isKeyboardFocusable): Use inputType() instead of using m_type
3307         directly.
3308         (WebCore::HTMLInputElement::isMouseFocusable): Ditto.
3309         (WebCore::HTMLInputElement::focus): Ditto.
3310         (WebCore::HTMLInputElement::setInputType): Added code to call constrainValue or recheckValue
3311         so we will enforce maxLen if changing from a type that doesn't have maxLen to one that does.
3312         (WebCore::HTMLInputElement::type): More-standard formatting for switch statement. Put
3313         cases into alphabetical order.
3314         (WebCore::HTMLInputElement::state): Changed switch statement to include all case values and
3315         not include a default case to take advantage of gcc's missing case warning.
3316         (WebCore::HTMLInputElement::restoreState): Ditto.
3317         (WebCore::HTMLInputElement::canHaveSelection): Ditto.
3318         (WebCore::HTMLInputElement::selectionStart): Ditto.
3319         (WebCore::HTMLInputElement::selectionEnd): Ditto.
3320         (WebCore::HTMLInputElement::setSelectionStart): Ditto.
3321         (WebCore::HTMLInputElement::setSelectionEnd): Ditto.
3322         (WebCore::HTMLInputElement::select): Ditto.
3323         (WebCore::HTMLInputElement::setSelectionRange): Ditto.
3324         (WebCore::HTMLInputElement::click): Ditto.
3325         (WebCore::HTMLInputElement::accessKeyAction): Ditto.
3326         (WebCore::HTMLInputElement::parseMappedAttribute): Use inputType() instead of using m_type
3327         directly. Added call to recheckValue when parsing a new value for the maxlength attribute.
3328         (WebCore::HTMLInputElement::rendererIsNeeded): Changed switch statement to include all case
3329         values and not include a default case to take advantage of gcc's missing case warning.
3330         (WebCore::HTMLInputElement::createRenderer): Ditto.
3331         (WebCore::HTMLInputElement::attach): Remove code to condition the value attribute when done
3332         parsing. This is now all handled by constrainValue and recheckValue as needed.
3333         (WebCore::HTMLInputElement::isSuccessfulSubmitButton): Use inputType() instead of using
3334         m_type directly.
3335         (WebCore::HTMLInputElement::appendFormData): Ditto. Rearranged code a little.
3336         (WebCore::HTMLInputElement::setChecked): Ditto.
3337         (WebCore::HTMLInputElement::setIndeterminate): Ditto.
3338         (WebCore::HTMLInputElement::value): Ditto. Call constrainValue when reading the value out
3339         of the value attribute.
3340         (WebCore::HTMLInputElement::valueWithDefault): Use inputType() instead of using
3341         m_type directly. Changed switch statement to include all case values and not include a
3342         default case to take advantage of gcc's missing case warning.
3343         (WebCore::HTMLInputElement::setValue): Ditto. Call constrainValue when storing a value.
3344         (WebCore::HTMLInputElement::setValueFromRenderer): Added an assertion.
3345         (WebCore::HTMLInputElement::storesValueSeparateFromAttribute): Use inputType() instead of
3346         using m_type directly.
3347         (WebCore::HTMLInputElement::preDispatchEventHandler): Ditto.
3348         (WebCore::HTMLInputElement::postDispatchEventHandler): Ditto.
3349         (WebCore::HTMLInputElement::defaultEventHandler): Ditto. Changed code to truncate inserted
3350         text in a BeforeTextInsertedEvent to use the new constrainValue function and also the
3351         numGraphemeClusters function, so it's based on grapheme clusters instead of characters and
3352         shares code.
3353         (WebCore::HTMLInputElement::constrainValue): Added.
3354         (WebCore::HTMLInputElement::recheckValue): Added.
3355
3356         * html/HTMLIsIndexElement.cpp: (WebCore::HTMLIsIndexElement::HTMLIsIndexElement):
3357         Removed unneeded code to set m_type to TEXT, which is already what it gets set to by
3358         the base class's constructor.
3359
3360         * html/HTMLGenericFormElement.h: Removed unused isEditable function.
3361         * html/HTMLGenericFormElement.cpp: Ditto.
3362         * html/HTMLTextAreaElement.h: Ditto.
3363         * html/HTMLTextAreaElement.cpp: Ditto.
3364
3365         * platform/StringImpl.cpp: (WebCore::StringImpl::truncate): Changed > to >= so that
3366         truncating to the size of the string does nothing, efficiently.
3367
3368         * rendering/RenderText.h: Added declaration of characterBreakIterator.
3369         * rendering/RenderText.cpp:
3370         (WebCore::characterBreakIterator): Made this public so it can be used in other files.
3371         Maybe we should also move it to another source file later. Also renamed to remove the
3372         "get" from the title.
3373         (WebCore::RenderText::previousOffset): Updated for name change.
3374         (WebCore::RenderText::nextOffset): Updated for name change.
3375
3376         * rendering/RenderTextField.cpp: (WebCore::RenderTextField::updateFromElement):
3377         Removed code to implement maxlength checking. That's handled entirely in the DOM now.
3378         Also moved down the code to get the value into a string so that it's done only in the
3379         case where the string is used.
3380
3381         * rendering/render_form.cpp: (WebCore::RenderFileButton::valueChanged): Use setValueFromRenderer
3382         instead of setting the value directly in the input element. We changed this for all the other
3383         types a while ago, and it works just as well for the input element.
3384
3385         * dom/BeforeTextInsertedEvent.h: Added setText function. Previously, clients changed the text
3386         by modifying the text object in place, but going forward we'd like to avoid that sort of thing.
3387  
3388         * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplacementFragment::ReplacementFragment):
3389         Changed code to assume clients will change the text in the event rather than mutating the
3390         text object itself. This is compatible with possible future changes to String to be copy
3391         on write.
3392         * editing/TypingCommand.cpp: (WebCore::TypingCommand::insertText): Ditto.
3393
3394 2006-04-07  Darin Adler  <darin@apple.com>
3395
3396         Reviewed by Hyatt.
3397
3398         - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=8134
3399           REGRESSION: dragging down from the middle of a text field does not select to end of field
3400
3401         * editing/Selection.cpp:
3402         (WebCore::comparePositions): Added. Takes shadow content into account.
3403         (WebCore::Selection::validate): Changed to call comparePositions instead of calling
3404         Range::compareBoundaryPoints directly. Also removed unneeded code to redundantly set
3405         m_start and m_end to null and did a bit of reformatting.
3406
3407         - some tiny efficiency improvements to the tokenizer -- no measurable speedup, but removes
3408           a little bit of unneeded code
3409
3410         * html/HTMLTokenizer.cpp: (WebCore::HTMLTokenizer::parseTag): Changed all the places
3411         that do "unsigned short x = *c" to "unsigned short x = c->unicode()" when c is a QChar,
3412         otherwise we do an unnecessary conversion to char (which requires a branch to see if
3413         the c fits in a char).
3414
3415 2006-04-07  Justin Garcia  <justin.garcia@apple.com>
3416
3417         Reviewed by harrison
3418         
3419         Rolled the fix for 8250 back in and fixed a bug:
3420         The local variables for the first and last nodes in the fragment
3421         need to be reset when the fragment is changed for plaintext-only mode
3422         or a change from the beforetextinserted event handler.
3423
3424         * editing/ReplaceSelectionCommand.cpp:
3425         (WebCore::ReplacementFragment::ReplacementFragment):
3426
3427 2006-04-07  Maciej Stachowiak  <mjs@apple.com>
3428
3429         Reviewed by Darin.
3430         
3431         - fixed REGRESSION: offsetParent on element with no offset parent crashes
3432
3433         * dom/Element.cpp:
3434         (WebCore::Element::offsetParent): Add missing null check.
3435
3436 2006-04-07  Justin Garcia  <justin.garcia@apple.com>
3437
3438         Reviewed by adele
3439         
3440         maxlength truncation in text fields didn't work if the fragment was a
3441         single text node.
3442
3443         * editing/ReplaceSelectionCommand.cpp:
3444         (WebCore::ReplacementFragment::ReplacementFragment):
3445
3446 2006-04-07  Justin Garcia  <justin.garcia@apple.com>
3447
3448         Reviewed by harrison
3449         
3450         <http://bugzilla.opendarwin.org/show_bug.cgi?id=8250>
3451         REGRESSION: Interchange newlines aren't passed with the khtmlBeforeTextInsertedEvent
3452
3453         * editing/ReplaceSelectionCommand.cpp:
3454         (WebCore::ReplacementFragment::ReplacementFragment):
3455         Interchange content removal happened before khtmlBeforeTextInsertedEvent was sent.
3456
3457 2006-04-07  Justin Garcia  <justin.garcia@apple.com>
3458
3459         Reviewed by adele
3460         
3461         <http://bugzilla.opendarwin.org/show_bug.cgi?id=8219>
3462         REGRESSION: Two extra newlines added when pasting a single styled line into a plaintext-only region
3463
3464         * editing/ReplaceSelectionCommand.cpp:
3465         (WebCore::ReplacementFragment::ReplacementFragment):
3466         Converting the fragment to plaintext introduced an extraneous newline because
3467         the range passed to plainText ended after the paragraph containing the fragment
3468         built from the markup that TextEdit put on the paste board.  TextIterator will
3469         emit a newline when it exits a paragraph.
3470         Two extra newlines were added because the '\n' in the plaintext string turns
3471         into an interchange newline, which isn't removed because of 8250, and the
3472         interchange newline looks like inline content that requires the insertion of
3473         a paragraph separator during paste.
3474         Fixed by creating a range using VisiblePositions at the start and the end of 
3475         the node that holds the fragment during paste's test rendering.
3476
3477 2006-04-06  Justin Garcia  <justin.garcia@apple.com>
3478
3479         Reviewed by harrison
3480         
3481         <http://bugzilla.opendarwin.org/show_bug.cgi?id=8145>