This repository has been archived by the owner on Oct 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Gallery page performance improvements #3289
Merged
johnbender
merged 10 commits into
jquery-archive:master
from
sgrebnov:performance-gallery-page
Feb 14, 2012
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
59abc6f
slider control improvements
83765f0
checkboxradio control improvements
ca2ada8
custom selectmenu: markup creation loop improvements
9afaf8b
custom selectmenu: dialog page creation improvements.
fcbf106
modified 'if' statement in custom selectmenu markup creation loop
8293af5
speed tests for checkbox, slider and custom select menu
9236f20
more generic identifier for performance test pages (list-page->perf-t…
31b5fe4
updated custom selectmenu unit tests to be compliant with new logic
sgrebnov a77ed1d
checkboxradio plugin - replaced setAttribute function with className …
sgrebnov f86eb66
IE7 support: replaced setAttribute('class') with className property
sgrebnov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>jQuery Mobile Docs - Checkboxradio</title> | ||
<link rel="stylesheet" href="../../css/themes/default/" /> | ||
<script src="../../js/jquery.js"></script> | ||
<script src="../../js/"></script> | ||
</head> | ||
<body> | ||
|
||
<div data-role="page"> | ||
|
||
<div data-role="header"> | ||
<h1>Checkboxradio</h1> | ||
</div><!-- /header --> | ||
|
||
<div data-role="content" data-filter="true"> | ||
|
||
<input type="checkbox" name="checkbox1" id="checkbox1" /> | ||
<label for="checkbox1">Checkbox</label> | ||
|
||
<input type="checkbox" name="checkbox2" id="checkbox2" /> | ||
<label for="checkbox2">Checkbox</label> | ||
|
||
<input type="checkbox" name="checkbox3" id="checkbox3" /> | ||
<label for="checkbox3">Checkbox</label> | ||
|
||
<input type="checkbox" name="checkbox4" id="checkbox4" /> | ||
<label for="checkbox4">Checkbox</label> | ||
|
||
<input type="checkbox" name="checkbox5" id="checkbox5" /> | ||
<label for="checkbox5">Checkbox</label> | ||
|
||
<input type="checkbox" name="checkbox6" id="checkbox6" /> | ||
<label for="checkbox6">Checkbox</label> | ||
|
||
<input type="checkbox" name="checkbox7" id="checkbox7" /> | ||
<label for="checkbox7">Checkbox</label> | ||
|
||
<input type="checkbox" name="checkbox8" id="checkbox8" /> | ||
<label for="checkbox8">Checkbox</label> | ||
|
||
<input type="checkbox" name="checkbox9" id="checkbox9" /> | ||
<label for="checkbox9">Checkbox</label> | ||
|
||
<input type="checkbox" name="checkbox10" id="checkbox10" /> | ||
<label for="checkbox10">Checkbox</label> | ||
|
||
</div><!-- /content --> | ||
</div><!-- /page --> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>jQuery Mobile Docs - Checkboxradio</title> | ||
<link rel="stylesheet" href="../../css/themes/default/" /> | ||
<script src="../../js/jquery.js"></script> | ||
<script type="text/javascript" src="stats/perf.js"></script> | ||
<script type="text/javascript" src="stats/startup.js"></script> | ||
<script src="../../js/"></script> | ||
</head> | ||
<body> | ||
|
||
<div data-role="page" id="perf-test-page"> | ||
|
||
<div data-role="header"> | ||
<h1>Checkboxradio</h1> | ||
</div><!-- /header --> | ||
|
||
<div data-role="content" data-filter="true"> | ||
|
||
<input type="checkbox" name="checkbox1" id="checkbox1" /> | ||
<label for="checkbox1">Checkbox</label> | ||
|
||
<input type="checkbox" name="checkbox2" id="checkbox2" /> | ||
<label for="checkbox2">Checkbox</label> | ||
|
||
<input type="checkbox" name="checkbox3" id="checkbox3" /> | ||
<label for="checkbox3">Checkbox</label> | ||
|
||
<input type="checkbox" name="checkbox4" id="checkbox4" /> | ||
<label for="checkbox4">Checkbox</label> | ||
|
||
<input type="checkbox" name="checkbox5" id="checkbox5" /> | ||
<label for="checkbox5">Checkbox</label> | ||
|
||
<input type="checkbox" name="checkbox6" id="checkbox6" /> | ||
<label for="checkbox6">Checkbox</label> | ||
|
||
<input type="checkbox" name="checkbox7" id="checkbox7" /> | ||
<label for="checkbox7">Checkbox</label> | ||
|
||
<input type="checkbox" name="checkbox8" id="checkbox8" /> | ||
<label for="checkbox8">Checkbox</label> | ||
|
||
<input type="checkbox" name="checkbox9" id="checkbox9" /> | ||
<label for="checkbox9">Checkbox</label> | ||
|
||
<input type="checkbox" name="checkbox10" id="checkbox10" /> | ||
<label for="checkbox10">Checkbox</label> | ||
|
||
</div><!-- /content --> | ||
</div><!-- /page --> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there ever a case where the parent might be a select node and also have a
nodeName
of optgroup? Or is this just to short circuit quickly before a string comparison where possible?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We iterate only through elements in the loop and their parent might be < select > or < optgroup >. nodeName is a read only property that always returns tag name for a nodes so we have ‘select’ or ‘optgroup’.
Thus basically we can just perform 'parent !== select' comparison which should run faster. The second part is for the possible future changes. I will double check the performance improvement using this statement and add additional comment to code.