1. 16 Jan, 2003 1 commit
    • darin's avatar
      Reviewed by Maciej. · 389288b2
      darin authored
      	- rolled in a change from the KJS folks
      
              * kjs/number_object.h: Use ObjectImp *, not Object, for the proto.
              * kjs/number_object.cpp:
              (NumberInstanceImp::NumberInstanceImp): Use ObjectImp *, not Object, for the proto.
              (NumberPrototypeImp::NumberPrototypeImp): Pass ObjectImp.
              (NumberObjectImp::construct): Use ObjectImp.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3338 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      389288b2
  2. 20 Nov, 2002 1 commit
    • darin's avatar
      - decrease ref/deref -- 5% speedup in iBench · c758b286
      darin authored
              * JavaScriptCore.pbproj/project.pbxproj: Added array_instance.h
              * kjs/array_instance.h: Added so it can be shared by function.h.
      
              * kjs/array_object.cpp:
              * kjs/array_object.h:
              * kjs/bool_object.cpp:
              * kjs/bool_object.h:
              * kjs/collector.cpp:
              * kjs/date_object.cpp:
              * kjs/date_object.h:
              * kjs/error_object.cpp:
              * kjs/function.cpp:
              * kjs/function.h:
              * kjs/function_object.cpp:
              * kjs/internal.cpp:
              * kjs/internal.h:
              * kjs/math_object.cpp:
              * kjs/nodes.cpp:
              * kjs/number_object.cpp:
              * kjs/object.cpp:
              * kjs/object.h:
              * kjs/object_object.cpp:
              * kjs/property_map.cpp:
              * kjs/reference.cpp:
              * kjs/reference.h:
              * kjs/regexp_object.cpp:
              * kjs/string_object.cpp:
              * kjs/string_object.h:
              * kjs/value.cpp:
              * kjs/value.h:
      	Switched lots of interfaces so they don't require ref/deref.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c758b286
  3. 19 Nov, 2002 2 commits
    • darin's avatar
      - a few more globals for often-used property names · 55be9897
      darin authored
      	- conversion to Identifier from UString must now be explicit
      
              * kjs/error_object.cpp:
              * kjs/function.cpp:
              * kjs/function_object.cpp:
              * kjs/identifier.cpp:
              * kjs/identifier.h:
              * kjs/lexer.cpp:
              * kjs/nodes.cpp:
              * kjs/number_object.cpp:
              * kjs/object.cpp:
              * kjs/object.h:
              * kjs/string_object.cpp:
              * kjs/testkjs.cpp:
              * kjs/ustring.cpp:
              * kjs/ustring.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      55be9897
    • darin's avatar
      JavaScriptCore: · 880105d6
      darin authored
      	- a first step towards atomic identifiers in JavaScript
      
      	Most places that work with identifiers now use Identifier
      	instead of UString.
      
              * kjs/identifier.cpp: Added.
              * kjs/identifier.h: Added.
              * JavaScriptCore.pbproj/project.pbxproj: Added files.
      
              * kjs/array_object.cpp:
              * kjs/array_object.h:
              * kjs/completion.cpp:
              * kjs/completion.h:
              * kjs/date_object.cpp:
              * kjs/date_object.h:
              * kjs/function.cpp:
              * kjs/function.h:
              * kjs/function_object.cpp:
              * kjs/grammar.cpp:
              * kjs/grammar.cpp.h:
              * kjs/grammar.h:
              * kjs/grammar.y:
              * kjs/internal.cpp:
              * kjs/internal.h:
              * kjs/lexer.cpp:
              * kjs/lookup.cpp:
              * kjs/lookup.h:
              * kjs/math_object.cpp:
              * kjs/math_object.h:
              * kjs/nodes.cpp:
              * kjs/nodes.h:
              * kjs/number_object.cpp:
              * kjs/number_object.h:
              * kjs/object.cpp:
              * kjs/object.h:
              * kjs/property_map.cpp:
              * kjs/property_map.h:
              * kjs/reference.cpp:
              * kjs/reference.h:
              * kjs/regexp_object.cpp:
              * kjs/regexp_object.h:
              * kjs/string_object.cpp:
              * kjs/string_object.h:
      
      WebCore:
      
      	- a first step towards atomic identifiers in JavaScript
      
      	Most places that work with identifiers now use Identifier
      	instead of UString.
      
              * khtml/ecma/kjs_binding.cpp:
              * khtml/ecma/kjs_binding.h:
              * khtml/ecma/kjs_css.cpp:
              * khtml/ecma/kjs_css.h:
              * khtml/ecma/kjs_dom.cpp:
              * khtml/ecma/kjs_dom.h:
              * khtml/ecma/kjs_events.cpp:
              * khtml/ecma/kjs_events.h:
              * khtml/ecma/kjs_html.cpp:
              * khtml/ecma/kjs_html.h:
              * khtml/ecma/kjs_navigator.cpp:
              * khtml/ecma/kjs_navigator.h:
              * khtml/ecma/kjs_range.cpp:
              * khtml/ecma/kjs_range.h:
              * khtml/ecma/kjs_traversal.cpp:
              * khtml/ecma/kjs_traversal.h:
              * khtml/ecma/kjs_views.cpp:
              * khtml/ecma/kjs_views.h:
              * khtml/ecma/kjs_window.cpp:
              * khtml/ecma/kjs_window.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2760 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      880105d6
  4. 12 Aug, 2002 1 commit
    • darin's avatar
      top level: · 07f7cce0
      darin authored
              * Tests/WebFoundation-Misc/ifnsurlextensions-test.m: (TestURLCommon):
      	Add tests for the new WebNSURLExtras methods.
      
              * Tests/libiftest/IFCheckLeaks.c: (IFCheckLeaksAtExit): Remove workaround for
      	CFPreferences race condition; it's now in WebFoundation.
      
      JavaScriptCore:
      
      	Speed improvements. 19% faster on cvs-js-performance, 1% on cvs-static-urls.
      
      	Use global string objects for length and other common property names rather
      	than constantly making and destroying them. Use integer versions of get() and
      	other related calls rather than always making a string.
      
      	Also get rid of many unneeded constructors, destructors, copy constructors, and
      	assignment operators. And make some functions non-virtual.
      
              * kjs/internal.h:
              * kjs/internal.cpp:
              (NumberImp::toUInt32): Implement.
              (ReferenceImp::ReferenceImp): Special case for numeric property names.
              (ReferenceImp::getPropertyName): Moved guts here from ValueImp. Handle numeric case.
              (ReferenceImp::getValue): Moved guts here from ValueImp. Handle numeric case.
              (ReferenceImp::putValue): Moved guts here from ValueImp. Handle numeric case.
              (ReferenceImp::deleteValue): Added. Handle numeric case.
      
              * kjs/array_object.h:
              * kjs/array_object.cpp: All-new array implementation that stores the elements
      	in a C++ array rather than in a property map.
              (ArrayInstanceImp::ArrayInstanceImp): Allocate the C++ array.
              (ArrayInstanceImp::~ArrayInstanceImp): Delete the C++ array.
              (ArrayInstanceImp::get): Implement both the old version and the new overload that
      	takes an unsigned index for speed.
              (ArrayInstanceImp::put): Implement both the old version and the new overload that
      	takes an unsigned index for speed.
              (ArrayInstanceImp::hasProperty): Implement both the old version and the new overload that
      	takes an unsigned index for speed.
              (ArrayInstanceImp::deleteProperty): Implement both the old version and the new overload that
      	takes an unsigned index for speed.
              (ArrayInstanceImp::setLength): Added. Used by the above to resize the array.
              (ArrayInstanceImp::mark): Mark the elements of the array too.
              (ArrayPrototypeImp::ArrayPrototypeImp): Pass the length to the array instance constructor.
      
              * kjs/bool_object.cpp:
              * kjs/date_object.cpp:
              * kjs/error_object.cpp:
              * kjs/function.cpp:
              * kjs/function_object.cpp:
              * kjs/math_object.cpp:
              * kjs/nodes.cpp:
              * kjs/nodes.h:
              * kjs/number_object.cpp:
              * kjs/object_object.cpp:
              * kjs/regexp_object.cpp:
              * kjs/string_object.cpp:
      
              * kjs/nodes2string.cpp: (SourceStream::operator<<): Add a special case for char now that
      	you can't create a UString from a char implicitly.
      
              * kjs/object.h:
              * kjs/object.cpp:
              (ObjectImp::get): Call through to the string version if the numeric version is not implemented.
              (ObjectImp::put): Call through to the string version if the numeric version is not implemented.
              (ObjectImp::hasProperty): Call through to the string version if the numeric version is not implemented.
              (ObjectImp::deleteProperty): Call through to the string version if the numeric version is not implemented.
      
              * kjs/types.h:
              * kjs/types.cpp:
              (Reference::Reference): Added constructors for the numeric property name case.
      
              * kjs/ustring.h: Made the constructor that turns a character into a string be explicit so we
      	don't get numbers that turn themselves into strings.
              * kjs/ustring.cpp:
              (UString::UString): Detect the empty string case, and use a shared empty string.
              (UString::find): Add an overload for single character finds.
              (UString::rfind): Add an overload for single character finds.
              (KJS::operator==): Fix bug where it would call strlen(0) if the first string was not null.
      	Also handle non-ASCII characters consistently with the rest of the code by casting to unsigned char
      	just in case.
      
              * kjs/value.h: Make ValueImp and all subclasses non-copyable and non-assignable.
              * kjs/value.cpp:
              (ValueImp::toUInt32): New interface, mainly useful so we can detect array indices and not turn
      	them into strings and back.
              (ValueImp::toInteger): Use the new toUInt32. Probably can use more improvement.
              (ValueImp::toInt32): Use the new toUInt32. Probably can use more improvement.
              (ValueImp::toUInt16): Use the new toUInt32. Probably can use more improvement.
              (ValueImp::getBase): Remove handling of the Reference case. That's in ReferenceImp now.
              (ValueImp::getPropertyName): Remove handling of the Reference case. That's in ReferenceImp now.
              (ValueImp::getValue): Remove handling of the Reference case. That's in ReferenceImp now.
              (ValueImp::putValue): Remove handling of the Reference case. That's in ReferenceImp now.
              (ValueImp::deleteValue): Added. Used so we can do delete the same way we do put.
      
      WebFoundation:
      
              * CacheLoader.subproj/WebHTTPResourceLoader.m:
              (-[WebHTTPProtocolHandler createWFLoadRequest]): Fix handling of paths with queries
      	and some other subtle path and port number handling issues by using _web_hostWithPort
      	and _web_pathWithQuery.
      
              * Misc.subproj/WebNSURLExtras.h:
              * Misc.subproj/WebNSURLExtras.m:
              (-[NSURL _web_hostWithPort]): Added.
              (-[NSURL _web_pathWithQuery]): Added.
      
              * CacheLoader.subproj/WebResourceLoad.m:
              (initLoader): Get some random preference before creating threads. This makes it impossible
      	to run into the CFPreferences race condition.
      
      WebCore:
      
              * force-clean-timestamp: Need a full build because of KJS changes.
              * khtml/ecma/kjs_window.h: Need to store an Object, not an ObjectImp, because there's no way
      	to copy an ObjectImp. KJS changes caught this mistake.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1799 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      07f7cce0
  5. 15 Apr, 2002 1 commit
    • darin's avatar
      Merged KDE 3.0 final code in and: · b70665a4
      darin authored
      JavaScriptCore:
      
      	* kjs/internal.cpp:
      	* kjs/property_map.cpp:
      	* kjs/ustring.h:
      	Removed some unneeded <config.h> includes so we are more similar
      	to the real KDE sources.
      
      	Merged changes from KDE 3.0 final and did some build fixes.
      
      	* JavaScriptCore.pbproj/project.pbxproj: Added nodes2string.cpp.
      
      	* kjs/grammar.*: Regenerated.
      	* kjs/*.lut.h: Regenerated.
      
      WebCore:
      
      	* src/kdelibs/khtml/rendering/render_text.cpp: (TextSlave::printDecoration):
      	Remove some minor gratuitous diffs vs. KDE.
      
      	* src/kdelibs/khtml/rendering/render_text.cpp: (TextSlave::printDecoration):
              Richard updated to reflect changes in KDE.
      
      	* src/kdelibs/khtml/css/css_valueimpl.cpp:
      	(FontFamilyValueImpl::FontFamilyValueImpl): Fix comment.
      	* src/kdelibs/khtml/css/cssstyleselector.cpp: Remove some gratuitous diffs vs. KDE.
      	* src/kdelibs/khtml/html/html_objectimpl.cpp:
      	(HTMLEmbedElementImpl::parseAttribute): Remove unneeded copy from KWQ's early days.
      	* src/kdelibs/khtml/html/html_tableimpl.cpp:
      	(HTMLTableElementImpl::parseAttribute),
      	(HTMLTablePartElementImpl::parseAttribute): Remove unneeded copy from KWQ's early days.
      	* src/kdelibs/khtml/html/htmltokenizer.cpp: (HTMLTokenizer::processToken): Redo the
      	APPLE_CHANGES ifdef here.
      	* src/kdelibs/khtml/khtmlpart_p.h: Update to latest kde.
      	* src/kdelibs/khtml/khtmlview.cpp: (KHTMLView::KHTMLView): Add ifdef APPLE_CHANGES.
      	(KHTMLView::~KHTMLView): Add ifdef APPLE_CHANGES.
      	(KHTMLView::print): Remove code left in here during merge process.
      	* src/kwq/KWQKHTMLPart.mm: Remove unused setFontSizes(), fontSizes(), and
      	resetFontSizes(). After the merge is landed, remove more.
      	* src/libwebcore.exp: Export updateStyleSelector() for WebKit.
      
      	Fix text to it displays at the right font size.
      
      	* src/kdelibs/khtml/css/cssstyleselector.cpp:
      	(CSSStyleSelector::computeFontSizes): Apply the same SCREEN_RESOLUTION hack here
      	that we do elsewhere.
      	* src/kdelibs/khtml/rendering/font.cpp: (Font::width): Use kMin instead of max (oops).
      	(Font::update): Turn off font database chicanery.
      	* src/kwq/KWQKHTMLPart.mm: (KHTMLPart::zoomFactor): Use zoom factor 100, not 1.
      
      	More fixes so text displays (still at wrong font size).
      
      	* src/kdelibs/khtml/rendering/font.cpp: (max): New helper.
      	(Font::drawText): Simplified implementation for now.
      	(Font::width): Simplified implementation for now.
      	* src/kwq/KWQColorGroup.mm: Reinstated QCOLOR_GROUP_SIZE.
      
      	* src/kwq/qt/qfontmetrics.h: Removed charWidth and changed _width to take QChar *.
      	* src/kwq/KWQFontMetrics.mm: Removed charWidth and changed _width to take QChar *.
      
      	Merged changes from KDE 3.0 final. Other fixes to get things compiling.
      
      	* src/kdelibs/khtml/css/css_valueimpl.cpp:
      	(CSSStyleDeclarationImpl::setProperty): Fix unused variable.
      	* src/kdelibs/khtml/khtmlview.cpp: (KHTMLView::contentsContextMenuEvent):
      	Fix unused variable.
      	* src/kdelibs/khtml/rendering/font.cpp: (Font::drawText), (Font::width),
      	(Font::update): Disable special "nsbp" logic for now. We can reenable it
      	if necessary.
      	* src/kdelibs/khtml/rendering/render_replaced.cpp: Fix mismerge.
      	* src/kdelibs/khtml/rendering/render_text.cpp: (RenderText::nodeAtPoint):
      	Fix unused variable.
      	* src/kwq/KWQApplication.mm: (QDesktopWidget::width), (QApplication::desktop):
      	Fix mismerge.
      	* src/kwq/KWQColorGroup.mm: Fix QCOLOR_GROUP_SIZE.
      	* src/kwq/KWQFontMetrics.mm: (QFontMetrics::lineSpacing): New.
      	(QFontMetrics::width): Remove unused optimization.
      	* src/kwq/qt/qfontmetrics.h: Add lineSpacing().
      
              Merged changes from previous merge pass.
      
              2002-03-25  Darin Adler  <darin@apple.com>
      
              Last bit of making stuff compile and link. Probably will drop the merge now
              and take it up again when it's time to merge in KDE 3.0 final.
      
      	* src/kwq/KWQEvent.mm: (QFocusEvent::reason): New.
      	* src/kwq/KWQPainter.mm: (QPainter::drawText): New overload.
      
              2002-03-25  Darin Adler  <darin@apple.com>
      
      	* src/kdelibs/khtml/rendering/font.cpp: (Font::width): Make it call _width so we
              don't lose the optimization.
      
      	* src/kwq/KWQApplication.mm: (QDesktopWidget::screenNumber): New.
      	(QDesktopWidget::screenGeometry): New.
              (QApplication::style): New.
      	* src/kwq/KWQColorGroup.mm: (QColorGroup::highlight): New.
      	(QColorGroup::highlightedText): New.
      	* src/kwq/KWQFont.mm: (QFont::setPixelSize): New.
      	* src/kwq/KWQFontMetrics.mm: (QFontMetrics::charWidth): New.
      	* src/kwq/KWQKGlobal.mm: (KGlobal::locale): Implement.
              (KLocale::KLocale): New.
      	(KLocale::languageList): New.
      	* src/kwq/KWQKHTMLPart.mm: (KHTMLPart::sheetUsed): New.
      	(KHTMLPart::setSheetUsed): New.
              (KHTMLPart::zoomFactor): New.
      	* src/kwq/KWQKHTMLSettings.mm: (KHTMLSettings::mediumFontSize): New.
      	* src/kwq/KWQScrollView.mm: (QScrollView::childX): New.
              (QScrollView::childY): New.
      
      	* src/kwq/qt/qapplication.h: style() returns a QStyle &.
      	* src/kwq/qt/qpalette.h: Add Highlight and HighlightedText.
      
              2002-03-24  Darin Adler  <darin@apple.com>
      
              More compiling. Still won't link.
      
      	* src/kdelibs/khtml/khtmlview.cpp: Disable printing and drag and drop code.
      	* src/kdelibs/khtml/rendering/render_text.cpp: (TextSlave::printDecoration):
              Temporarily turn off our smarter underlining since it relies on access to the
              string, and TextSlave doesn't have that any more.
      	(RenderText::nodeAtPoint): Get rid of a workaround we don't need any more for
              a bug that was fixed by KDE folks.
      	* src/kwq/KWQApplication.mm: (QApplication::desktop): Make the desktop be a
              QDesktopWidget.
      	* src/kwq/qt/qnamespace.h: Add MetaButton.
      	* src/kwq/qt/qtooltip.h: Add a maybeTip virtual function member and a virtual
              destructor.
      
              2002-03-24  Darin Adler  <darin@apple.com>
      
              Some fixes to get more stuff to compile.
      
      	* src/kdelibs/khtml/ecma/kjs_dom.cpp: (DOMDocument::getValueProperty):
              Don't try to look at the private m_bComplete to display "complete". Just do
              "loading" and "loaded".
              * src/kdelibs/khtml/khtmlpart_p.h: #ifdef this all out for APPLE_CHANGES.
      	* src/kdelibs/khtml/rendering/font.cpp: (Font::update): Add an explicit cast to
              int to avoid float -> int warning.
      	* src/kdelibs/khtml/rendering/render_table.cpp: (RenderTable::calcColMinMax):
              Add an explicit cast to int to avoid uint compared with int warning.
      	* src/kdelibs/khtml/xml/dom_docimpl.cpp: (DocumentImpl::recalcStyleSelector):
              Use sheetUsed() and setSheetUsed() functions on KHTMLPart intead of getting
              at private fields the way the real KDE code does.
      
              * src/kwq/KWQKHTMLPart.h: Declare zoomFactor(), sheetUsed(), and setSheetUsed().
      	* src/kwq/KWQStyle.h: Add PM_DefaultFramWidth as another metric.
      	* src/kwq/kdecore/klocale.h: Add languageList().
      	* src/kwq/khtml/khtml_settings.h: Add mediumFontSize().
      	* src/kwq/qt/qapplication.h: Add style() and QDesktopWidget.
      	* src/kwq/qt/qevent.h: Add reason().
      	* src/kwq/qt/qfont.h: Add setPixelSize(int).
      	* src/kwq/qt/qfontmetrics.h: Add charWidth() and _charWidth() functions.
      	* src/kwq/qt/qpainter.h: Add drawText() overload with position parameter.
      	* src/kwq/qt/qpalette.h: Add highlight() and highlightedText().
      	* src/kwq/qt/qscrollview.h: Add childX() and childY().
      
      	* src/kwq/KWQApplication.mm: Change KWQDesktopWidget to QDesktopWidget.
      
      WebKit:
      
      	* WebView.subproj/IFPreferences.h:
      	* WebView.subproj/IFPreferences.mm: (+[IFPreferences load]): Remove the old
      	WebKitFontSizes preference.
      	(-[IFPreferences mediumFontSize]), (-[IFPreferences setMediumFontSize:]): New.
      
      	* WebView.subproj/IFWebView.mm: (-[IFWebView reapplyStyles]): Call
      	updateStyleSelector() instead of recalcStyle().
      
              Merged changes from previous merge branch.
      
              2002-03-25  Darin Adler  <darin@apple.com>
      
      	* WebView.subproj/IFPreferences.mm: (+[IFPreferences load]):
              Add WebKitMediumFontSizePreferenceKey.
      
      WebBrowser:
      
      	* Preferences.subproj/TextPreferences.m: (-[TextPreferences defaultFontSize]),
      	(-[TextPreferences setDefaultFontSize:]): Just get and set the new mediumFontSize
      	preference rather than doing the whole fontSizes preference dance.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1024 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b70665a4
  6. 21 Mar, 2002 1 commit
  7. 24 Aug, 2001 1 commit