', 'No image displayed when no image is attached and no default image specified.');
+ $this->assertNoPattern('
', 'No image displayed when no image is attached and no default image specified.');
$cache_tags_header = $this->drupalGetHeader('X-Drupal-Cache-Tags');
$this->assertTrue(!preg_match('/ image_style\:/', $cache_tags_header), 'No image style cache tag found.');
diff --git a/core/modules/options/src/Tests/OptionsFieldUITest.php b/core/modules/options/src/Tests/OptionsFieldUITest.php
index baecfca..7eb8239 100644
--- a/core/modules/options/src/Tests/OptionsFieldUITest.php
+++ b/core/modules/options/src/Tests/OptionsFieldUITest.php
@@ -337,7 +337,7 @@ function testNodeDisplay() {
$output = '1';
}
- $elements = $this->xpath('//div[text()="' . $output . '"]');
+ $elements = $this->xpath('//div[text()=:output]', array(':output' => $output));
$this->assertEqual(count($elements), 1, 'Correct options found.');
}
}
diff --git a/core/modules/search/src/Tests/SearchExcerptTest.php b/core/modules/search/src/Tests/SearchExcerptTest.php
index ff7eaeb..7d30531 100644
--- a/core/modules/search/src/Tests/SearchExcerptTest.php
+++ b/core/modules/search/src/Tests/SearchExcerptTest.php
@@ -70,7 +70,7 @@ function testSearchExcerpt() {
// The node body that will produce this rendered $text is:
// 123456789 HTMLTest +123456789+‘ +‘ +‘ +‘ +12345678 +‘ +‘ +‘ ‘
- $text = "
123456789 HTMLTest +123456789+‘ +‘ +‘ +‘ +12345678 +‘ +‘ +‘ ‘
\n
";
+ $text = "
123456789 HTMLTest +123456789+‘ +‘ +‘ +‘ +12345678 +‘ +‘ +‘ ‘
\n
";
$result = search_excerpt('HTMLTest', $text);
$this->assertFalse(empty($result), 'Rendered Multi-byte HTML encodings are not corrupted in search excerpts');
}
diff --git a/core/modules/system/css/system.theme.css b/core/modules/system/css/system.theme.css
index c8908b5..77b2f52 100644
--- a/core/modules/system/css/system.theme.css
+++ b/core/modules/system/css/system.theme.css
@@ -621,19 +621,31 @@ table tr.error {
.messages--error p.error {
color: #a51b00;
}
+/* @todo: remove these test classes for attributes merging */
+div[role*="attributes-role"]{ background:gray;}
+div[role*="title-attributes-role"]{font-style: italic; color:white;}
+div[role*="content_attributes-role"]{ color:pink;}
+div[role*="item-attributes-role"]{border:1px solid red;}
+.test-attribute-merge-1{text-transform: uppercase;}
+.test-attribute-merge-2{ font-size:30px;}
+.field {
+ margin: 10px 0;
+}
+/* attribute merging test end */
/* Field display */
-.field .field-label {
+.field__label {
font-weight: bold;
+ vertical-align: top;
}
-.field-label-inline .field-label,
-.field-label-inline .field-items {
- float:left; /*LTR*/
+.field--label-inline .field__label,
+.field--label-inline > .field__item,
+.field--label-inline .field__items {
+ display: inline-block;
padding-right: 0.5em;
}
-[dir="rtl"] .field-label-inline .field-label,
-[dir="rtl"] .field-label-inline .field-items {
- float: right;
+[dir="rtl"] .field--label-inline .field__label,
+[dir="rtl"] .field--label-inline .field__items {
padding-left: 0.5em;
}
diff --git a/core/modules/system/src/Tests/Ajax/MultiFormTest.php b/core/modules/system/src/Tests/Ajax/MultiFormTest.php
index 5eb13e5..016de1b 100644
--- a/core/modules/system/src/Tests/Ajax/MultiFormTest.php
+++ b/core/modules/system/src/Tests/Ajax/MultiFormTest.php
@@ -65,8 +65,8 @@ function testMultiForm() {
// desired elements.
$field_name = 'field_ajax_test';
$field_xpaths = array(
- 'page-node-form' => '//form[@id="page-node-form"]//div[contains(@class, "field-name-field-ajax-test")]',
- 'page-node-form--2' => '//form[@id="page-node-form--2"]//div[contains(@class, "field-name-field-ajax-test")]',
+ 'page-node-form' => '//form[@id="page-node-form"]//div[contains(@class, "field--name-field-ajax-test")]',
+ 'page-node-form--2' => '//form[@id="page-node-form--2"]//div[contains(@class, "field--name-field-ajax-test")]',
);
$button_name = $field_name . '_add_more';
$button_value = t('Add another item');
diff --git a/core/modules/system/src/Tests/Form/RebuildTest.php b/core/modules/system/src/Tests/Form/RebuildTest.php
index 1f91e80..721975f 100644
--- a/core/modules/system/src/Tests/Form/RebuildTest.php
+++ b/core/modules/system/src/Tests/Form/RebuildTest.php
@@ -98,7 +98,7 @@ function testPreserveFormActionAfterAJAX() {
// field items in the field for which we just added an item.
$this->drupalGet('node/add/page');
$this->drupalPostAjaxForm(NULL, array(), array('field_ajax_test_add_more' => t('Add another item')), 'system/ajax', array(), array(), 'page-node-form');
- $this->assert(count($this->xpath('//div[contains(@class, "field-name-field-ajax-test")]//input[@type="text"]')) == 2, 'AJAX submission succeeded.');
+ $this->assert(count($this->xpath('//div[contains(@class, "field--name-field-ajax-test")]//input[@type="text"]')) == 2, 'AJAX submission succeeded.');
// Submit the form with the non-Ajax "Save" button, leaving the title field
// blank to trigger a validation error, and ensure that a validation error
diff --git a/core/modules/system/templates/field.html.twig b/core/modules/system/templates/field.html.twig
index a0d527a..8aa35cc 100644
--- a/core/modules/system/templates/field.html.twig
+++ b/core/modules/system/templates/field.html.twig
@@ -17,25 +17,90 @@
*
* Available variables:
* - attributes: HTML attributes for the containing element.
- * - label_hidden: Whether to show the field label or not.
+ * - label_visible: Whether to show the field label or not.
* - title_attributes: HTML attributes for the title.
* - label: The label for the field.
* - content_attributes: HTML attributes for the content.
* - items: List of all the field items.
* - item_attributes: List of HTML attributes for each item.
+ * - field_type: @todo: needs description
+ * - field_name: @todo: needs description
+ * - field_label: @todo: needs description
*
* @see template_preprocess_field()
*
* @ingroup themeable
*/
#}
-
- {% if not label_hidden %}
-
{{ label }}:
- {% endif %}
-
+
+{#
+{{ attributes.class }} provides a way for modules to add attributes.class to fields
+dynamically.
+#}
+
+{% if multiple and not label_hidden %}
+{#
+ the field is a multiple value field with a visible label
+ Finale markup pattern:
+
+#}
+
+
{{ label }}:
+
+ {% for delta, item in items %}
+
{{ item }}
+ {% endfor %}
+
+
+
+{% elseif multiple and label_hidden %}
+{#
+ We check if its a multiple value field and if its label is hidden
+
+
+ attributes are merged with content_attributes
+#}
+
{% for delta, item in items %}
-
{{ item }}
+
{{ item }}
{% endfor %}
-
+
+{% elseif not multiple and not label_hidden %}
+{#
+ The field is a single field with the label visible
+
+ content_attributes are merged with item_attributes
+#}
+
+
{{ label }}:
+ {% for delta, item in items %}
+
{{ item }}
+ {% endfor %}
+
+
+{% elseif not multiple and label_hidden %}
+{#
+ The field is a single field with no label
+
+ data
+
+ attributes are merged with content_attributes and item_attributes
+#}
+ {% for delta, item in items %}
+
{{ item }}
+ {% endfor %}
+
+{% endif %}
\ No newline at end of file
diff --git a/core/modules/taxonomy/src/Tests/TermTest.php b/core/modules/taxonomy/src/Tests/TermTest.php
index d309e30..2eb6359 100644
--- a/core/modules/taxonomy/src/Tests/TermTest.php
+++ b/core/modules/taxonomy/src/Tests/TermTest.php
@@ -352,12 +352,12 @@ function testTermInterface() {
$this->assertText($edit['description[0][value]'], 'The randomly generated term description is present.');
// Did this page request display a 'term-listing-heading'?
- $this->assertTrue($this->xpath('//div[contains(@class, "field-taxonomy-term--description")]'), 'Term page displayed the term description element.');
+ $this->assertTrue($this->xpath('//div[contains(@class,"taxonomy-term")] //div[contains(@class, "field--name-description")]'), 'Term page displayed the term description element.');
// Check that it does NOT show a description when description is blank.
$term->setDescription(NULL);
$term->save();
$this->drupalGet('taxonomy/term/' . $term->id());
- $this->assertFalse($this->xpath('//div[contains(@class, "field-taxonomy-term--description")]'), 'Term page did not display the term description when description was blank.');
+ $this->assertFalse($this->xpath('//div[contains(@class,"taxonomy-term")] //div[contains(@class, "field--name-description")]'), 'Term page did not display the term description when description was blank.');
// Check that the description value is processed.
$value = $this->randomName();
diff --git a/core/themes/bartik/css/style.css b/core/themes/bartik/css/style.css
index c221415..fa55368 100644
--- a/core/themes/bartik/css/style.css
+++ b/core/themes/bartik/css/style.css
@@ -130,7 +130,7 @@ ul.contextual-links,
ul.links,
ul.primary,
.item-list .pager,
-div.field-type-taxonomy-term-reference,
+.field--type-taxonomy-term-reference,
div.messages,
div.meta,
p.comment-time,
@@ -710,46 +710,44 @@ h1#page-title {
color: #68696b;
margin-bottom: -5px;
}
-.submitted .field-name-field-user-picture img {
- float: left; /* LTR */
+.submitted .field--name-field-user-picture img {
margin: 1px 20px 0 0; /* LTR */
}
-[dir="rtl"] .submitted .field-name-field-user-picture img {
- float: right;
+[dir="rtl"] .submitted .field--name-field-user-picture img {
margin-left: 20px;
margin-right: 0;
}
-.field-type-taxonomy-term-reference {
+.field--type-taxonomy-term-reference {
margin: 0 0 1.2em;
}
-.field-type-taxonomy-term-reference .field-label {
+.field--type-taxonomy-term-reference .field__label {
font-weight: normal;
margin: 0;
padding-right: 5px; /* LTR */
}
-[dir="rtl"] .field-type-taxonomy-term-reference .field-label {
+[dir="rtl"] .field--type-taxonomy-term-reference .field__label {
padding-left: 5px;
padding-right: 0;
}
-.field-type-taxonomy-term-reference .field-label,
-.field-type-taxonomy-term-reference ul.links {
+.field--type-taxonomy-term-reference .field__label,
+.field--type-taxonomy-term-reference ul.links {
font-size: 0.8em;
}
-.view-mode-teaser .field-type-taxonomy-term-reference .field-label,
-.view-mode-teaser .field-type-taxonomy-term-reference ul.links {
+.view-mode-teaser .field--type-taxonomy-term-reference .field__label,
+.view-mode-teaser .field--type-taxonomy-term-reference ul.links {
font-size: 0.821em;
}
-.field-type-taxonomy-term-reference ul.links {
+.field--type-taxonomy-term-reference ul.links {
padding: 0;
margin: 0;
list-style: none;
}
-.field-type-taxonomy-term-reference ul.links li {
+.field--type-taxonomy-term-reference ul.links li {
float: left; /* LTR */
padding: 0 1em 0 0; /* LTR */
white-space: nowrap;
}
-[dir="rtl"] .field-type-taxonomy-term-reference ul.links li {
+[dir="rtl"] .field--type-taxonomy-term-reference ul.links li {
padding: 0 0 0 1em;
float: right;
}
@@ -761,8 +759,8 @@ h1#page-title {
margin-right: 236px;
margin-left: 0;
}
-.field-type-image img,
-.field-name-field-user-picture img {
+.field--type-image img,
+.field--name-field-user-picture img {
margin: 0 0 1em;
}
ul.links {
@@ -783,10 +781,10 @@ ul.links {
.comment h2.title {
margin-bottom: 1em;
}
-.comment .field-name-field-user-picture img {
+.comment .field--name-field-user-picture img {
margin-left: 0; /* LTR */
}
-[dir="rtl"] .comment .field-name-field-user-picture img {
+[dir="rtl"] .comment .field--name-field-user-picture img {
margin-right: 0;
}
.comment {
@@ -1229,7 +1227,7 @@ div.messages {
/* -------------- User Profile -------------- */
-.profile .field-name-field-user-picture {
+.profile .field--name-field-user-picture {
float: none;
}