govuk_publishing_components 21.53.0 → 21.55.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/govuk_publishing_components/action-link--nhs.png +0 -0
- data/app/assets/images/govuk_publishing_components/action-link--nhs.svg +1 -0
- data/app/assets/images/govuk_publishing_components/action-link-arrow--dark.png +0 -0
- data/app/assets/images/govuk_publishing_components/action-link-arrow--simple.png +0 -0
- data/app/assets/images/govuk_publishing_components/action-link-arrow.png +0 -0
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +5 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +38 -7
- data/app/assets/stylesheets/govuk_publishing_components/components/_back-link.scss +0 -38
- data/app/controllers/govuk_publishing_components/component_guide_controller.rb +34 -22
- data/app/views/govuk_publishing_components/components/_action_link.html.erb +23 -3
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +28 -8
- data/app/views/govuk_publishing_components/components/docs/action_link.yml +43 -15
- data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_header.yml +23 -0
- data/lib/govuk_publishing_components/presenters/breadcrumb_selector.rb +11 -9
- data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_priority.rb +8 -1
- data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +1 -1
- data/lib/govuk_publishing_components/presenters/machine_readable/faq_page_schema.rb +7 -6
- data/lib/govuk_publishing_components/presenters/machine_readable/html_publication_schema.rb +77 -0
- data/lib/govuk_publishing_components/presenters/schema_org.rb +24 -16
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/axe-core/CHANGELOG.md +6 -0
- data/node_modules/axe-core/axe.js +19 -3
- data/node_modules/axe-core/axe.min.js +2 -2
- data/node_modules/axe-core/bower.json +1 -1
- data/node_modules/axe-core/lib/commons/dom/get-element-stack.js +27 -1
- data/node_modules/axe-core/package.json +21 -21
- data/node_modules/axe-core/sri-history.json +4 -0
- data/node_modules/govuk-frontend/README.md +6 -6
- data/node_modules/govuk-frontend/govuk/_base.scss +3 -0
- data/node_modules/govuk-frontend/govuk/all.js +1 -1
- data/node_modules/govuk-frontend/govuk/all.scss +1 -3
- data/node_modules/govuk-frontend/govuk/components/_all.scss +31 -29
- data/node_modules/govuk-frontend/govuk/components/accordion/_accordion.scss +2 -208
- data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +207 -0
- data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js +1 -1
- data/node_modules/govuk-frontend/govuk/components/back-link/_back-link.scss +2 -65
- data/node_modules/govuk-frontend/govuk/components/back-link/_index.scss +112 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_breadcrumbs.scss +2 -118
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_index.scss +138 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/macro-options.json +6 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/template.njk +12 -1
- data/node_modules/govuk-frontend/govuk/components/button/_button.scss +2 -284
- data/node_modules/govuk-frontend/govuk/components/button/_index.scss +280 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/_character-count.scss +2 -31
- data/node_modules/govuk-frontend/govuk/components/character-count/_index.scss +28 -0
- data/node_modules/govuk-frontend/govuk/components/checkboxes/_checkboxes.scss +2 -308
- data/node_modules/govuk-frontend/govuk/components/checkboxes/_index.scss +304 -0
- data/node_modules/govuk-frontend/govuk/components/date-input/_date-input.scss +2 -30
- data/node_modules/govuk-frontend/govuk/components/date-input/_index.scss +26 -0
- data/node_modules/govuk-frontend/govuk/components/details/_details.scss +2 -88
- data/node_modules/govuk-frontend/govuk/components/details/_index.scss +84 -0
- data/node_modules/govuk-frontend/govuk/components/error-message/_error-message.scss +2 -15
- data/node_modules/govuk-frontend/govuk/components/error-message/_index.scss +11 -0
- data/node_modules/govuk-frontend/govuk/components/error-summary/_error-summary.scss +2 -59
- data/node_modules/govuk-frontend/govuk/components/error-summary/_index.scss +55 -0
- data/node_modules/govuk-frontend/govuk/components/fieldset/_fieldset.scss +2 -68
- data/node_modules/govuk-frontend/govuk/components/fieldset/_index.scss +64 -0
- data/node_modules/govuk-frontend/govuk/components/file-upload/_file-upload.scss +2 -81
- data/node_modules/govuk-frontend/govuk/components/file-upload/_index.scss +77 -0
- data/node_modules/govuk-frontend/govuk/components/footer/_footer.scss +2 -244
- data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +238 -0
- data/node_modules/govuk-frontend/govuk/components/header/_header.scss +2 -318
- data/node_modules/govuk-frontend/govuk/components/header/_index.scss +312 -0
- data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +7 -1
- data/node_modules/govuk-frontend/govuk/components/header/template.njk +2 -2
- data/node_modules/govuk-frontend/govuk/components/hint/_hint.scss +2 -50
- data/node_modules/govuk-frontend/govuk/components/hint/_index.scss +46 -0
- data/node_modules/govuk-frontend/govuk/components/input/_index.scss +99 -0
- data/node_modules/govuk-frontend/govuk/components/input/_input.scss +2 -103
- data/node_modules/govuk-frontend/govuk/components/inset-text/_index.scss +24 -0
- data/node_modules/govuk-frontend/govuk/components/inset-text/_inset-text.scss +2 -28
- data/node_modules/govuk-frontend/govuk/components/label/_index.scss +41 -0
- data/node_modules/govuk-frontend/govuk/components/label/_label.scss +2 -45
- data/node_modules/govuk-frontend/govuk/components/panel/_index.scss +40 -0
- data/node_modules/govuk-frontend/govuk/components/panel/_panel.scss +2 -44
- data/node_modules/govuk-frontend/govuk/components/phase-banner/_index.scss +27 -0
- data/node_modules/govuk-frontend/govuk/components/phase-banner/_phase-banner.scss +2 -31
- data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +342 -0
- data/node_modules/govuk-frontend/govuk/components/radios/_radios.scss +2 -346
- data/node_modules/govuk-frontend/govuk/components/select/_index.scss +53 -0
- data/node_modules/govuk-frontend/govuk/components/select/_select.scss +2 -57
- data/node_modules/govuk-frontend/govuk/components/skip-link/_index.scss +33 -0
- data/node_modules/govuk-frontend/govuk/components/skip-link/_skip-link.scss +2 -37
- data/node_modules/govuk-frontend/govuk/components/summary-list/_index.scss +153 -0
- data/node_modules/govuk-frontend/govuk/components/summary-list/_summary-list.scss +2 -157
- data/node_modules/govuk-frontend/govuk/components/table/_index.scss +50 -0
- data/node_modules/govuk-frontend/govuk/components/table/_table.scss +2 -54
- data/node_modules/govuk-frontend/govuk/components/tabs/_index.scss +138 -0
- data/node_modules/govuk-frontend/govuk/components/tabs/_tabs.scss +2 -142
- data/node_modules/govuk-frontend/govuk/components/tag/_index.scss +87 -0
- data/node_modules/govuk-frontend/govuk/components/tag/_tag.scss +2 -91
- data/node_modules/govuk-frontend/govuk/components/textarea/_index.scss +51 -0
- data/node_modules/govuk-frontend/govuk/components/textarea/_textarea.scss +2 -55
- data/node_modules/govuk-frontend/govuk/components/warning-text/_index.scss +56 -0
- data/node_modules/govuk-frontend/govuk/components/warning-text/_warning-text.scss +2 -60
- data/node_modules/govuk-frontend/govuk/core/_global-styles.scss +5 -3
- data/node_modules/govuk-frontend/govuk/core/_links.scss +5 -3
- data/node_modules/govuk-frontend/govuk/core/_lists.scss +17 -3
- data/node_modules/govuk-frontend/govuk/core/_section-break.scss +5 -3
- data/node_modules/govuk-frontend/govuk/core/_template.scss +5 -3
- data/node_modules/govuk-frontend/govuk/core/_typography.scss +5 -3
- data/node_modules/govuk-frontend/govuk/helpers/_clearfix.scss +1 -1
- data/node_modules/govuk-frontend/govuk/helpers/_focused.scss +1 -1
- data/node_modules/govuk-frontend/govuk/helpers/_grid.scss +2 -1
- data/node_modules/govuk-frontend/govuk/helpers/_links.scss +1 -1
- data/node_modules/govuk-frontend/govuk/helpers/_media-queries.scss +1 -1
- data/node_modules/govuk-frontend/govuk/helpers/_shape-arrow.scss +1 -1
- data/node_modules/govuk-frontend/govuk/helpers/_spacing.scss +1 -1
- data/node_modules/govuk-frontend/govuk/helpers/_typography.scss +1 -1
- data/node_modules/govuk-frontend/govuk/helpers/_visually-hidden.scss +1 -1
- data/node_modules/govuk-frontend/govuk/objects/_form-group.scss +1 -3
- data/node_modules/govuk-frontend/govuk/objects/_grid.scss +1 -3
- data/node_modules/govuk-frontend/govuk/objects/_main-wrapper.scss +5 -3
- data/node_modules/govuk-frontend/govuk/objects/_width-container.scss +2 -4
- data/node_modules/govuk-frontend/govuk/overrides/_display.scss +5 -3
- data/node_modules/govuk-frontend/govuk/overrides/_spacing.scss +5 -3
- data/node_modules/govuk-frontend/govuk/overrides/_typography.scss +5 -3
- data/node_modules/govuk-frontend/govuk/overrides/_width.scss +5 -3
- data/node_modules/govuk-frontend/govuk/settings/_ie8.scss +1 -1
- data/node_modules/govuk-frontend/govuk/tools/_compatibility.scss +1 -1
- data/node_modules/govuk-frontend/govuk/tools/_font-url.scss +1 -1
- data/node_modules/govuk-frontend/govuk/tools/_ie8.scss +1 -1
- data/node_modules/govuk-frontend/govuk/tools/_image-url.scss +1 -1
- data/node_modules/govuk-frontend/govuk/tools/_px-to-em.scss +1 -1
- data/node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss +1 -1
- data/node_modules/govuk-frontend/package.json +21 -21
- metadata +49 -2
@@ -20,9 +20,32 @@ examples:
|
|
20
20
|
data:
|
21
21
|
title: 'Coronavirus: businesses and self-employed people'
|
22
22
|
path: /childcare-parenting/pregnancy-and-birth
|
23
|
+
with_margin_bottom:
|
24
|
+
description: |
|
25
|
+
The component accepts a number for margin bottom from 0 to 9 (0px to 60px) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having a margin bottom of 30px.
|
26
|
+
data:
|
27
|
+
title: 'Learn to practice flexible spacing: step by step'
|
28
|
+
margin_bottom: 9
|
23
29
|
with_unique_tracking:
|
24
30
|
description: In order to identify the step by step navigation the component is part of, we need to track a unique ID of the navigation in Google Analytics. This ID should be the same across all pages that are linked from and are part of that navigation. Its value is included in any tracking events, specifically in dimension96. It refers to the ID of the step nav that the component links to.
|
25
31
|
data:
|
26
32
|
title: 'With a tracking id'
|
27
33
|
path: '#'
|
28
34
|
tracking_id: 'this-is-the-tracking-id'
|
35
|
+
with_custom_tracking:
|
36
|
+
data:
|
37
|
+
title: 'With a custom tracking'
|
38
|
+
path: '#'
|
39
|
+
tracking_category: "customTrackingCategoryClicked"
|
40
|
+
tracking_action: "customTrackingAction"
|
41
|
+
tracking_label: "customTrackingLabel"
|
42
|
+
tracking_dimension: "customTrackingDimension"
|
43
|
+
tracking_dimension_index: "23"
|
44
|
+
without_custom_dimension:
|
45
|
+
data:
|
46
|
+
title: 'Without custom dimensions'
|
47
|
+
path: '#'
|
48
|
+
tracking_category: "customTrackingCategoryClicked"
|
49
|
+
tracking_action: "customTrackingAction"
|
50
|
+
tracking_label: "customTrackingLabel"
|
51
|
+
tracking_dimension_enabled: false
|
@@ -46,30 +46,32 @@ module GovukPublishingComponents
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def output
|
49
|
-
return content_item_options unless content_item_navigation.
|
49
|
+
return content_item_options unless content_item_navigation.html_publication_with_parent?
|
50
50
|
return parent_item_options if parent_item_navigation.priority_breadcrumbs
|
51
51
|
|
52
|
+
step_by_step_header = parent_item_options[:step_by_step]
|
53
|
+
|
52
54
|
{
|
53
|
-
step_by_step:
|
54
|
-
breadcrumbs: parent_breadcrumbs,
|
55
|
+
step_by_step: step_by_step_header,
|
56
|
+
breadcrumbs: step_by_step_header ? parent_breadcrumbs.first : parent_breadcrumbs,
|
55
57
|
}
|
56
58
|
end
|
57
59
|
|
58
60
|
def options(navigation)
|
59
|
-
if navigation.
|
61
|
+
if navigation.content_tagged_to_a_finder?
|
60
62
|
{
|
61
|
-
step_by_step:
|
62
|
-
breadcrumbs: navigation.
|
63
|
+
step_by_step: false,
|
64
|
+
breadcrumbs: navigation.breadcrumbs,
|
63
65
|
}
|
64
66
|
elsif navigation.content_tagged_to_current_step_by_step?
|
65
67
|
{
|
66
68
|
step_by_step: true,
|
67
69
|
breadcrumbs: navigation.step_nav_helper.header,
|
68
70
|
}
|
69
|
-
elsif navigation.
|
71
|
+
elsif navigation.priority_breadcrumbs
|
70
72
|
{
|
71
|
-
step_by_step:
|
72
|
-
breadcrumbs: navigation.
|
73
|
+
step_by_step: true,
|
74
|
+
breadcrumbs: navigation.priority_breadcrumbs,
|
73
75
|
}
|
74
76
|
elsif navigation.content_is_tagged_to_a_live_taxon? && prioritise_taxon_breadcrumbs
|
75
77
|
{
|
@@ -25,7 +25,14 @@ module GovukPublishingComponents
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def breadcrumbs
|
28
|
-
taxon && {
|
28
|
+
taxon && {
|
29
|
+
title: taxon["title"],
|
30
|
+
path: taxon["base_path"],
|
31
|
+
tracking_category: "breadcrumbClicked",
|
32
|
+
tracking_action: "superBreadcrumb",
|
33
|
+
tracking_label: content_item["base_path"],
|
34
|
+
tracking_dimension_enabled: false,
|
35
|
+
}
|
29
36
|
end
|
30
37
|
|
31
38
|
private
|
@@ -24,9 +24,8 @@ module GovukPublishingComponents
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def questions_and_answers_markup
|
27
|
-
question_and_answers
|
28
|
-
|
29
|
-
.map do |question, value|
|
27
|
+
question_and_answers.select { |_, value| value[:answer].present? }
|
28
|
+
.map do |question, value|
|
30
29
|
q_and_a_url = section_url(value[:anchor])
|
31
30
|
|
32
31
|
{
|
@@ -52,9 +51,7 @@ module GovukPublishingComponents
|
|
52
51
|
#
|
53
52
|
# - :anchor: the id of the h2 (autogenerated by the markdown converter).
|
54
53
|
# This is used to build links directly to the section in question
|
55
|
-
def question_and_answers
|
56
|
-
doc = Nokogiri::HTML(html)
|
57
|
-
|
54
|
+
def question_and_answers
|
58
55
|
question = page.title
|
59
56
|
|
60
57
|
doc.xpath("html/body").children.each_with_object({}) do |element, q_and_as|
|
@@ -71,6 +68,10 @@ module GovukPublishingComponents
|
|
71
68
|
end
|
72
69
|
end
|
73
70
|
|
71
|
+
def doc
|
72
|
+
@doc ||= Nokogiri::HTML(page.body)
|
73
|
+
end
|
74
|
+
|
74
75
|
def question_hash_is_unset?(q_and_as, question)
|
75
76
|
q_and_as[question].nil?
|
76
77
|
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
module GovukPublishingComponents
|
2
|
+
module Presenters
|
3
|
+
class HtmlPublicationSchema < FaqPageSchema
|
4
|
+
attr_reader :page
|
5
|
+
|
6
|
+
def initialize(page)
|
7
|
+
@page = page
|
8
|
+
end
|
9
|
+
|
10
|
+
def structured_data
|
11
|
+
return ArticleSchema.new(page).structured_data if less_than_two_headings_of_any_one_type?
|
12
|
+
|
13
|
+
super
|
14
|
+
end
|
15
|
+
|
16
|
+
def heading_counts
|
17
|
+
@heading_counts ||= (1..5).each_with_object({}) do |n, hash|
|
18
|
+
heading = "h#{n}"
|
19
|
+
hash[heading] = doc.xpath("//*[@class=\"govspeak\"]//#{heading}").count
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def less_than_two_headings_of_any_one_type?
|
24
|
+
heading_counts.values.max < 2
|
25
|
+
end
|
26
|
+
|
27
|
+
def question_and_answers
|
28
|
+
headings.each_with_object({}) do |heading, hash|
|
29
|
+
question = heading.text
|
30
|
+
|
31
|
+
next_heading = heading_pairs[heading]
|
32
|
+
next_heading_path = next_heading && next_heading.path
|
33
|
+
answer = content_between(heading.path, next_heading_path)
|
34
|
+
|
35
|
+
hash[question] = {
|
36
|
+
answer: answer.map(&:to_s).join,
|
37
|
+
anchor: heading.attr(:id),
|
38
|
+
}
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def headings
|
43
|
+
@headings ||= doc.xpath("//*[@class=\"govspeak\"]//#{first_heading_type_with_more_than_one_occurance}")
|
44
|
+
end
|
45
|
+
|
46
|
+
def first_heading_type_with_more_than_one_occurance
|
47
|
+
heading_counts.detect { |_k, v| v > 1 }.first
|
48
|
+
end
|
49
|
+
|
50
|
+
def heading_pairs
|
51
|
+
@heading_pairs ||= pairs_hash(headings)
|
52
|
+
end
|
53
|
+
|
54
|
+
# Converts [:a, :b, :c] into
|
55
|
+
# {:a => :b, :b => :c}
|
56
|
+
def pairs_hash(array)
|
57
|
+
all_but_last = array[0..-2]
|
58
|
+
all_but_first = array[1..-1]
|
59
|
+
pairs = [all_but_last, all_but_first].transpose
|
60
|
+
Hash[pairs]
|
61
|
+
end
|
62
|
+
|
63
|
+
# From: https://stackoverflow.com/a/7816046/1014251
|
64
|
+
# If `stop_xpath` is `nil` gets text to end of content
|
65
|
+
def content_between(start_xpath, stop_xpath = nil)
|
66
|
+
node = doc.at_xpath(start_xpath).next_element
|
67
|
+
stop = stop_xpath && doc.at_xpath(stop_xpath)
|
68
|
+
[].tap do |content|
|
69
|
+
while node && node != stop
|
70
|
+
content << node
|
71
|
+
node = node.next_element
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -4,6 +4,7 @@ require "govuk_publishing_components/presenters/machine_readable/creative_work_s
|
|
4
4
|
require "govuk_publishing_components/presenters/machine_readable/faq_page_schema"
|
5
5
|
require "govuk_publishing_components/presenters/machine_readable/government_service_schema"
|
6
6
|
require "govuk_publishing_components/presenters/machine_readable/has_part_schema"
|
7
|
+
require "govuk_publishing_components/presenters/machine_readable/html_publication_schema"
|
7
8
|
require "govuk_publishing_components/presenters/machine_readable/is_part_of_schema"
|
8
9
|
require "govuk_publishing_components/presenters/machine_readable/news_article_schema"
|
9
10
|
require "govuk_publishing_components/presenters/machine_readable/organisation_schema"
|
@@ -22,22 +23,29 @@ module GovukPublishingComponents
|
|
22
23
|
end
|
23
24
|
|
24
25
|
def structured_data
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
26
|
+
schema_for_page.new(page).structured_data
|
27
|
+
end
|
28
|
+
|
29
|
+
def schema_for_page
|
30
|
+
case page.schema
|
31
|
+
when :faq
|
32
|
+
FaqPageSchema
|
33
|
+
when :article
|
34
|
+
ArticleSchema
|
35
|
+
when :government_service
|
36
|
+
GovernmentServiceSchema
|
37
|
+
when :news_article
|
38
|
+
NewsArticleSchema
|
39
|
+
when :person
|
40
|
+
PersonSchema
|
41
|
+
when :organisation
|
42
|
+
OrganisationSchema
|
43
|
+
when :search_results_page
|
44
|
+
SearchResultsPageSchema
|
45
|
+
when :dataset
|
46
|
+
DatasetSchema
|
47
|
+
when :html_publication
|
48
|
+
HtmlPublicationSchema
|
41
49
|
else
|
42
50
|
raise "#{page.schema} is not supported"
|
43
51
|
end
|
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
4
4
|
|
5
|
+
### [3.5.4](https://github.com/dequelabs/axe-core/compare/v3.5.3...v3.5.4) (2020-05-22)
|
6
|
+
|
7
|
+
### Bug Fixes
|
8
|
+
|
9
|
+
- **get-element-stack:** properly calculate position of children of floated elements ([28a8c58](https://github.com/dequelabs/axe-core/commit/28a8c58b409461600da07eac164e5b0ca4744502))
|
10
|
+
|
5
11
|
### [3.5.3](https://github.com/dequelabs/axe-core/compare/v3.5.2...v3.5.3) (2020-03-31)
|
6
12
|
|
7
13
|
### Bug Fixes
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! axe v3.5.
|
1
|
+
/*! axe v3.5.4
|
2
2
|
* Copyright (c) 2020 Deque Systems, Inc.
|
3
3
|
*
|
4
4
|
* Your use of this Source Code Form is subject to the terms of the Mozilla Public
|
@@ -27,7 +27,7 @@
|
|
27
27
|
return _typeof(obj);
|
28
28
|
}
|
29
29
|
var axe = axe || {};
|
30
|
-
axe.version = '3.5.
|
30
|
+
axe.version = '3.5.4';
|
31
31
|
if (typeof define === 'function' && define.amd) {
|
32
32
|
define('axe-core', [], function() {
|
33
33
|
'use strict';
|
@@ -21533,12 +21533,28 @@
|
|
21533
21533
|
}
|
21534
21534
|
return false;
|
21535
21535
|
}
|
21536
|
+
function isFloated(vNode) {
|
21537
|
+
if (!vNode) {
|
21538
|
+
return false;
|
21539
|
+
}
|
21540
|
+
if (vNode._isFloated !== undefined) {
|
21541
|
+
return vNode._isFloated;
|
21542
|
+
}
|
21543
|
+
var floatStyle = vNode.getComputedStylePropertyValue('float');
|
21544
|
+
if (floatStyle !== 'none') {
|
21545
|
+
vNode._isFloated = true;
|
21546
|
+
return true;
|
21547
|
+
}
|
21548
|
+
var floated = isFloated(vNode.parent);
|
21549
|
+
vNode._isFloated = floated;
|
21550
|
+
return floated;
|
21551
|
+
}
|
21536
21552
|
function getPositionOrder(vNode) {
|
21537
21553
|
if (vNode.getComputedStylePropertyValue('position') === 'static') {
|
21538
21554
|
if (vNode.getComputedStylePropertyValue('display').indexOf('inline') !== -1) {
|
21539
21555
|
return 2;
|
21540
21556
|
}
|
21541
|
-
if (vNode
|
21557
|
+
if (isFloated(vNode)) {
|
21542
21558
|
return 1;
|
21543
21559
|
}
|
21544
21560
|
return 0;
|