Use copyLCharsFromUCharSource() for IdentifierLCharFromUCharTranslator translation
https://bugs.webkit.org/show_bug.cgi?id=98335

Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-10-04
Reviewed by Michael Saboff.

Michael Saboff added an optimized version of UChar->LChar conversion in r125846.
Use this function in JSC::Identifier.

* runtime/Identifier.cpp:
(JSC::IdentifierLCharFromUCharTranslator::translate):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130418 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Lower minimum table size of WTF::HashTable to reduce memory usage.
<http://webkit.org/b/98406>
<rdar://problem/12432140>

Reviewed by Anders Carlsson.

Lower the default minimumTableSize for WTF hash tables from 64 to 8 entries.
This reduces WebProcess memory consumption by ~16MB on Membuster3 (a 6% progression!)

No significant movement on PLT or JSC benchmarks on my machine. If there's a perf regression somewhere
from this, we can tweak individual tables to have a larger minimumTableSize.

* wtf/HashTraits.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130419 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Qt rebaseline after r130411.

* platform/qt/editing/deleting/delete-block-merge-contents-018-expected.txt:
* platform/qt/editing/deleting/delete-block-merge-contents-019-expected.txt:
* platform/qt/editing/deleting/delete-block-merge-contents-022-expected.txt:
* platform/qt/editing/deleting/merge-no-br-expected.txt:
* platform/qt/editing/execCommand/find-after-replace-expected.txt:
* platform/qt/editing/execCommand/paste-1-expected.txt:
* platform/qt/editing/execCommand/paste-2-expected.txt:
* platform/qt/editing/pasteboard/4944770-2-expected.txt:
* platform/qt/editing/pasteboard/5006779-expected.txt:
* platform/qt/editing/pasteboard/5028447-expected.txt:
* platform/qt/editing/pasteboard/8145-3-expected.txt:
* platform/qt/editing/pasteboard/merge-end-borders-expected.txt:
* platform/qt/editing/pasteboard/paste-line-endings-009-expected.txt:
* platform/qt/editing/pasteboard/paste-line-endings-010-expected.txt:
* platform/qt/editing/pasteboard/paste-match-style-001-expected.txt:
* platform/qt/editing/pasteboard/paste-text-008-expected.txt:
* platform/qt/editing/pasteboard/paste-text-009-expected.txt:
* platform/qt/editing/pasteboard/smart-paste-007-expected.txt:
* platform/qt/editing/pasteboard/unrendered-br-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130421 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Layout broken after cloning and re-inserting a table with a misplaced <form>
https://bugs.webkit.org/show_bug.cgi?id=86746

Patch by Pravin D <pravind.2k4@gmail.com> on 2012-10-04
Reviewed by Julien Chaffraix.

Source/WebCore:

There is a concept of demotion for a <form> contained in a table. A <form> is demoted if its immediate parent
is either a <table>, table sections (tbody, etc) or a table row (tr). A renderer for such a <form> is created only
if its display is one of the table display types (TABLE, INLINE_TABLE, TABLE_FOOTER_GROUP, etc).
However when a <table> containing a demoted <form> is cloned, the <form> does not retain its demotion state and
results in the table getting improperly rendered.

Test: fast/table/form-with-non-table-display-inside-table-elements.html

* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::copyNonAttributePropertiesFromElement):
  Extended the virtual function for HTMLFormElement class specific implementation.
  The function is used to copy any necessary state information(member variables) associated with
  the <form> element being cloned to the current node.
  For HTMLFormElement node the member variable can be classified into five groups based on the
  information they hold:
    1) Variables containing information regarding <form> subtree and elements associated with it.
       These get updated as and when an element is added to the <form> subtree.
    2) Variables containing <form> submit state information.
    3) Flag to hold information if reset() has been called.
    4) Flag(m_wasDemoted) that indicates whether the form is demoted or not, based on which it needs to
       be handled differently during creation of its renderer.
       This information is currently being updated only during the HTML tree construction phase.
    5) Flag(m_wasMalformed) to hold information if the <form> is malformed or not.

  Variables of group (1) will be updated as and when elements are added to the <form> subtree. Whereas,
  (2) and (3) hold instance specific information, thus copying them is not required. Also (5) is currently not
  being used(not set by any code).

  On the other hand, (4) is required to be copied during cloning as this information cannot be accessed
  during the cloning process.

(WebCore):
* html/HTMLFormElement.h:
  Added copyNonAttributePropertiesFromElement() declaration.

LayoutTests:

* fast/table/form-with-non-table-display-inside-table-elements-expected.txt: Added.
* fast/table/form-with-non-table-display-inside-table-elements.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130422 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Chromium rebaselines after r130411.

* platform/chromium-linux-x86/editing/pasteboard/paste-xml-expected.txt:
* platform/chromium-linux/editing/pasteboard/4944770-2-expected.txt:
* platform/chromium-linux/editing/pasteboard/paste-xml-expected.txt:
* platform/chromium-linux/editing/pasteboard/smart-drag-drop-expected.txt:
* platform/chromium-linux/editing/pasteboard/subframe-dragndrop-1-expected.txt:
* platform/chromium-mac-snowleopard/editing/pasteboard/paste-text-008-expected.txt: Removed.
* platform/chromium-mac-snowleopard/editing/pasteboard/paste-xml-expected.txt: Added.
* platform/chromium-mac/editing/pasteboard/paste-xml-expected.txt:
* platform/chromium-win-xp/editing/pasteboard/paste-xml-expected.txt:
* platform/chromium-win/editing/deleting/delete-block-merge-contents-018-expected.txt:
* platform/chromium-win/editing/deleting/delete-block-merge-contents-019-expected.txt:
* platform/chromium-win/editing/deleting/delete-block-merge-contents-020-expected.txt:
* platform/chromium-win/editing/deleting/delete-block-merge-contents-021-expected.txt:
* platform/chromium-win/editing/deleting/delete-block-merge-contents-022-expected.txt:
* platform/chromium-win/editing/deleting/merge-no-br-expected.txt:
* platform/chromium-win/editing/execCommand/find-after-replace-expected.txt:
* platform/chromium-win/editing/execCommand/paste-1-expected.txt:
* platform/chromium-win/editing/execCommand/paste-2-expected.txt:
* platform/chromium-win/editing/pasteboard/4944770-2-expected.txt:
* platform/chromium-win/editing/pasteboard/5028447-expected.txt:
* platform/chromium-win/editing/pasteboard/8145-3-expected.txt:
* platform/chromium-win/editing/pasteboard/drag-drop-modifies-page-expected.txt:
* platform/chromium-win/editing/pasteboard/merge-end-borders-expected.txt:
* platform/chromium-win/editing/pasteboard/paste-line-endings-007-expected.txt:
* platform/chromium-win/editing/pasteboard/paste-line-endings-008-expected.txt:
* platform/chromium-win/editing/pasteboard/paste-line-endings-009-expected.txt:
* platform/chromium-win/editing/pasteboard/paste-line-endings-010-expected.txt:
* platform/chromium-win/editing/pasteboard/paste-match-style-001-expected.txt:
* platform/chromium-win/editing/pasteboard/paste-text-008-expected.txt:
* platform/chromium-win/editing/pasteboard/paste-text-009-expected.txt:
* platform/chromium-win/editing/pasteboard/paste-xml-expected.txt:
* platform/chromium-win/editing/pasteboard/smart-paste-007-expected.txt:
* platform/chromium-win/editing/pasteboard/subframe-dragndrop-1-expected.txt:
* platform/chromium-win/editing/pasteboard/unrendered-br-expected.txt:
* platform/chromium-win/fast/lists/drag-into-marker-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130423 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash in Safari at com.apple.JavaScriptCore: WTF::StringImpl::is8Bit const + 12
https://bugs.webkit.org/show_bug.cgi?id=98433

Reviewed by Jessie Berlin.

The problem is due to a String with a null StringImpl (i.e. a null string).
Added a length check before the is8Bit() check since length() checks for a null StringImpl.  Changed the
characters16() call to characters() since it can handle a null StringImpl as well.

* API/JSValueRef.cpp:
(JSValueMakeFromJSONString):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130424 268f45cc-cd09-0410-ab3c-d52691b4dbfc