Title: [208446] trunk/Source/WebCore
Revision
208446
Author
[email protected]
Date
2016-11-09 10:32:02 -0800 (Wed, 09 Nov 2016)

Log Message

Shave 16 bytes off HTMLInputElement
https://bugs.webkit.org/show_bug.cgi?id=164488

Reviewed by Sam Weinig.

Shave 16 bytes off HTMLInputElement (232 -> 216) by packing data members
better.

* html/HTMLFormControlElement.h:
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::HTMLTextFormControlElement):
* html/HTMLTextFormControlElement.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (208445 => 208446)


--- trunk/Source/WebCore/ChangeLog	2016-11-09 18:28:08 UTC (rev 208445)
+++ trunk/Source/WebCore/ChangeLog	2016-11-09 18:32:02 UTC (rev 208446)
@@ -1,3 +1,18 @@
+2016-11-09  Chris Dumez  <[email protected]>
+
+        Shave 16 bytes off HTMLInputElement
+        https://bugs.webkit.org/show_bug.cgi?id=164488
+
+        Reviewed by Sam Weinig.
+
+        Shave 16 bytes off HTMLInputElement (232 -> 216) by packing data members
+        better.
+
+        * html/HTMLFormControlElement.h:
+        * html/HTMLTextFormControlElement.cpp:
+        (WebCore::HTMLTextFormControlElement::HTMLTextFormControlElement):
+        * html/HTMLTextFormControlElement.h:
+
 2016-11-09  Youenn Fablet  <[email protected]>
 
         [WebRTC] Introduce asynchronous backend for other RTCPeerConnection API

Modified: trunk/Source/WebCore/html/HTMLFormControlElement.h (208445 => 208446)


--- trunk/Source/WebCore/html/HTMLFormControlElement.h	2016-11-09 18:28:08 UTC (rev 208445)
+++ trunk/Source/WebCore/html/HTMLFormControlElement.h	2016-11-09 18:32:02 UTC (rev 208446)
@@ -183,14 +183,14 @@
     HTMLFormControlElement* asFormNamedItem() final { return this; }
 
     std::unique_ptr<ValidationMessage> m_validationMessage;
-    bool m_disabled : 1;
-    bool m_isReadOnly : 1;
-    bool m_isRequired : 1;
-    bool m_valueMatchesRenderer : 1;
-    bool m_disabledByAncestorFieldset : 1;
+    unsigned m_disabled : 1;
+    unsigned m_isReadOnly : 1;
+    unsigned m_isRequired : 1;
+    unsigned m_valueMatchesRenderer : 1;
+    unsigned m_disabledByAncestorFieldset : 1;
 
     enum DataListAncestorState { Unknown, InsideDataList, NotInsideDataList };
-    mutable enum DataListAncestorState m_dataListAncestorState;
+    mutable unsigned m_dataListAncestorState : 2;
 
     // The initial value of m_willValidate depends on the derived class. We can't
     // initialize it with a virtual function in the constructor. m_willValidate
@@ -200,11 +200,11 @@
 
     // Cache of validity()->valid().
     // But "candidate for constraint validation" doesn't affect m_isValid.
-    bool m_isValid : 1;
+    unsigned m_isValid : 1;
 
-    bool m_wasChangedSinceLastFormControlChangeEvent : 1;
+    unsigned m_wasChangedSinceLastFormControlChangeEvent : 1;
 
-    bool m_hasAutofocused : 1;
+    unsigned m_hasAutofocused : 1;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp (208445 => 208446)


--- trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp	2016-11-09 18:28:08 UTC (rev 208445)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp	2016-11-09 18:32:02 UTC (rev 208446)
@@ -58,11 +58,11 @@
 
 HTMLTextFormControlElement::HTMLTextFormControlElement(const QualifiedName& tagName, Document& document, HTMLFormElement* form)
     : HTMLFormControlElementWithState(tagName, document, form)
-    , m_cachedSelectionStart(-1)
-    , m_cachedSelectionEnd(-1)
     , m_cachedSelectionDirection(SelectionHasNoDirection)
     , m_lastChangeWasUserEdit(false)
     , m_isPlaceholderVisible(false)
+    , m_cachedSelectionStart(-1)
+    , m_cachedSelectionEnd(-1)
 {
 }
 

Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.h (208445 => 208446)


--- trunk/Source/WebCore/html/HTMLTextFormControlElement.h	2016-11-09 18:28:08 UTC (rev 208445)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.h	2016-11-09 18:32:02 UTC (rev 208446)
@@ -151,6 +151,10 @@
 
     bool placeholderShouldBeVisible() const;
 
+    unsigned m_cachedSelectionDirection : 2;
+    unsigned m_lastChangeWasUserEdit : 1;
+    unsigned m_isPlaceholderVisible : 1;
+
     String m_textAsOfLastFormControlChangeEvent;
 
     int m_cachedSelectionStart;
@@ -158,10 +162,6 @@
 
     int m_maxLength { -1 };
     int m_minLength { -1 };
-
-    unsigned char m_cachedSelectionDirection : 2;
-    unsigned char m_lastChangeWasUserEdit : 1;
-    unsigned char m_isPlaceholderVisible : 1;
 };
 
 HTMLTextFormControlElement* enclosingTextFormControl(const Position&);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to